Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: Salvatore Lionetti <salvatorelionetti@yahoo.it>
Cc: gdb@sourceware.org
Subject: Re: [GDB] Re: About break and run-time loaded lib
Date: Fri, 22 Oct 2010 15:39:00 -0000	[thread overview]
Message-ID: <201010221638.56458.pedro@codesourcery.com> (raw)
In-Reply-To: <530805.97008.qm@web27201.mail.ukl.yahoo.com>

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


      reply	other threads:[~2010-10-22 15:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-22 15:22 Salvatore Lionetti
2010-10-22 15:39 ` Pedro Alves [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201010221638.56458.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb@sourceware.org \
    --cc=salvatorelionetti@yahoo.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox