This is the mail archive of the gdb@sourceware.org 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: [GDB] Re: About break and run-time loaded lib


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
groks.

-- 
Pedro Alves


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