This is the mail archive of the
mailing list for the GDB project.
Re: [GDB] Re: About break and run-time loaded lib
- From: Pedro Alves <pedro at codesourcery dot com>
- To: Salvatore Lionetti <salvatorelionetti at yahoo dot it>
- Cc: gdb at sourceware dot org
- Date: Fri, 22 Oct 2010 16:38:56 +0100
- Subject: Re: [GDB] Re: About break and run-time loaded lib
- References: <firstname.lastname@example.org>
On Friday 22 October 2010 16:22:28, Salvatore Lionetti wrote:
> Many thanks Pedro, you are right, work like a charme. Could in generally 'O' packet like an event? (without a request)
You can send 'O' packets whenever gdb is waiting for a stop reply,
and few other circustances (I'm looking at gdb/remote.c for
remote_console_output calls). 'O' is mainly used as a simple
remote console, so you can wire it to, say your stub's or your
program's debug printf output.
> Now i've a less trivial problem (surely due to my ignorance):
> My OS load dinamically some modules, at offset different (although near) over every boot.
> So target know the base address (Text/Data/Bss)
> - How could i explain to host gdb this information, when some of these library are loaded on the host?
> P.S: I've already 'consumed' the 'qOffsets' packet
I think you want to teach your stub about the qXfer:libraries:read
packet. If you use GDB 7.2 (or mainline), gdb defaults to query
the target about shared libraries using that packet. If you're
using previous GDBs, you'll need to teach gdb that your target
uses gdb/solib-target.c as shared library backend. (You don't
need to do that in 7.2, because solib-target.c was made the default).
Then, gdb will see your target's dynamically loaded modules as
shared libraries, and the user can see them with "info sharedlibrary".
This assumes your modules are elf or some other format gdb already