Date: Tue, 08 Oct 2002 16:58:12 +0100 From: Ian Dowse <iedowse@maths.tcd.ie> To: Andrew Gallatin <gallatin@cs.duke.edu> Cc: hackers@freebsd.org Subject: Re: gdb support for kernel modules Message-ID: <200210081658.aa35776@salmon.maths.tcd.ie> In-Reply-To: Your message of "Tue, 08 Oct 2002 09:37:22 EDT." <15778.57234.386016.42431@grasshopper.cs.duke.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <15778.57234.386016.42431@grasshopper.cs.duke.edu>, 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 majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi? <200210081658.aa35776>