This is the mail archive of the
mailing list for the GDB project.
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb at sourceware dot org
- Cc: gdb at semi-evolved dot org
- Date: Fri, 4 Apr 2008 12:38:54 +0100
- Subject: Re: qXfer:libraries:read
- References: <004701c89637$228665a0$679330e0$@org>
A Friday 04 April 2008 10:34:50, email@example.com wrote:
> I'm using GDB 220.127.116.1180320 (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
> GDB reports that support for the packet is switched on:
> 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
> 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.