This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: qXfer:libraries:read

A Friday 04 April 2008 10:34:50, wrote:
> Hi,
> I'm using GDB (because it has bug fixes that I need), to
> debug using the remote protocol.
> I have written a version of gdbserver for my remote target (ELF on x86),
> which supports the qXfer:libraries:read packet. GDB is compiled with
> target=i686-linux-elf.
> GDB reports that support for the packet is switched on:
> (gdb)
> show remote library-info-packet
> 341-interpreter-exec console "show remote library-info-packet"
> Support for the `qXfer:libraries:read' packet is currently enabled.

> After the process being debugged loads a library, the target reports a stop
> event:
> 	$T05thread:00000f10;library:XXX;#cf
> However, GDB never asks for the list of loaded libraries.
> Should this work, or does the cygwin port of GDB not support this feature?
> If the latter, would it be possible for someone to point me at the part of
> the source I need to update to get it working?

A gdb build as --target=i686-linux-elf doesn't know how to fetch the
shared libs using qXfer:libraries:read.

You're talking about gdbserver, so I take it you have a full blown OS,
so probably you're going to need to add smarts to gdb sooner or later.

So, on the GDB side, you'll need to add basic support for your 
target.  Make sure your target configuration links in solib-target.c, and
that its -tdep.c file registers solib_target_so_ops as solib_ops handler.

You may want to look at i368-cygwin-tdep.c for an example.  Minimally,
you'd add the triplet of your OS in the relevant configure.* and
config.* files so you can build with e.g: --target=i386-unknown-myosname.
In gdb/ you'd add a i386-myosname-tdep.c, and in it, you'd
add an i386_myosname_osabi_sniffer, an i386_my_osname_init_abi
and an _initialize_i386_myosname_tdep routines.

Pedro Alves

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]