In message <[EMAIL PROTECTED]>, Andrew Gallatin writes: >gdbmods does an ugly thing which is incredibly useful. It assumes >that the modules you want to debug are sitting in your kernel build >pool. So what it does is extract the build directory from the kernel >(using strings), and runs a find rooted there for the module in >question. But its a shell script, so it can get away with stuff like >that ;)
Yes, I intend to attempt the same thing by extracting the path from version[] and using similar logic. It can probably use a list of likely locations and pick the first one where the module actually exists. GDB already has the `solib-absolute-prefix' and `solib-search-path' variables, but they are of limited use for kernel modules as the paths and module names you want for debugging are usually different to those that were actually loaded. >Perhaps we could embed the build directory somewhere the elf headers >of each kernel module (including the kernel) so that kgdb could find >the corresponding build file with symbols. Then your (very cool) >solib-fbsd-kld.c could easily find the kernel and modules which match >the kernel you're debugging.. True, even having the path as a variable inside the module should be sufficient I think. The other clever suggestion that was made to me was to maintain the standard r_debug* symbols in the kernel so that a virtually unmodified gdb could extract information about the loaded modules. Ian To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message