Date: Wed, 30 Jan 2008 08:21:56 -0500 From: John Baldwin <jhb@freebsd.org> To: Doug Rabson <dfr@rabson.org> Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/gnu/usr.bin/gdb/kgdb kgdb.h kld.c trgt.c Message-ID: <200801300821.56714.jhb@freebsd.org> In-Reply-To: <9C890129-C909-49DD-A996-2C3D93B0D484@rabson.org> References: <200801292344.m0TNiYrd039016@repoman.freebsd.org> <9C890129-C909-49DD-A996-2C3D93B0D484@rabson.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 30 January 2008 04:47:06 am Doug Rabson wrote: > > On 29 Jan 2008, at 23:44, John Baldwin wrote: > > > jhb 2008-01-29 23:44:34 UTC > > > > FreeBSD src repository > > > > Modified files: > > gnu/usr.bin/gdb/kgdb kgdb.h kld.c trgt.c > > Log: > > - Rework the kld support to hook into GDB's shared library support. > > kgdb(8) now treats kld's as shared libraries relative to the kernel > > "binary". Thus, you can use 'info sharedlibrary' to list the kld's > > along with 'sharedlibrary' and 'nosharedlibrary' to manage symbol > > loading and unloading. Note that there isn't an easy way to > > force GDB > > to use a specific path for a shared library. However, you can use > > 'nosharedlibrary' to unload all the klds and then use > > 'sharedlibrary' > > to load specific klds where it gets the kld correct and use > > 'add-kld' for the kld's where the default open behavior doesn't > > work. > > klds opened via 'sharedlibrary' (and during startup) do have their > > sections listed in 'info files'. > > - Change the 'add-kld' command to use filename completion to > > complete its > > argument. > > This was how it used to work long ago (I forget exactly how long). I > had things set up so that GDB's standard ELF shared library code would > find KLDs automatically - you can see remnants of this in link_elf.c > in 'ifdef GDB' sections which build an RTLD-like list of loaded files > which GDB looked for starting at the global symbol r_debug. This might still work for remote kgdb as the current stuff in kgdb doesn't handle remote kgdb. The above works by redefining the so_ops to work such that they traverse the linker_file list. The GDB stuff in link_elf.c should make it so that the solib-svr4 stuff works with klds. I usually don't include 'options GDB' in my kernels so didn't see that. :-/ I'll do some further testing to see if that still works. I believe that live kgdb on amd64 has some issues in general (I think the kernel side has bugs), but I mostly use kgdb on crash dumps so don't run into that. -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801300821.56714.jhb>