Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* [GDB] Re: About break and run-time loaded lib
@ 2010-10-22 15:22 Salvatore Lionetti
  2010-10-22 15:39 ` Pedro Alves
  0 siblings, 1 reply; 2+ messages in thread
From: Salvatore Lionetti @ 2010-10-22 15:22 UTC (permalink / raw)
  To: gdb; +Cc: Pedro Alves

Many thanks Pedro, you are right, work like a charme. Could in generally 'O' packet like an event? (without a request)
^Cremote_interrupt called
remote_stop called
Packet received: O53414C5659
SALVYPacket received: S02
Sending packet: $p40#d4...Ack
Packet received: 00000000

Program received signal SIGINT, Interrupt.
0x00000000 in ?? ()
(gdb) 

(Yes PC is NULL, to be implemented)

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?

Have a good day

P.S: I've already 'consumed' the 'qOffsets' packet

--- Sab 16/10/10, Pedro Alves <pedro@codesourcery.com> ha scritto:

> Da: Pedro Alves <pedro@codesourcery.com>
> Oggetto: Re: About break
> A: gdb@sourceware.org
> Cc: "Salvatore Lionetti" <salvatorelionetti@yahoo.it>
> Data: Sabato 16 ottobre 2010, 19:49
> On Friday 15 October 2010 14:32:41,
> Salvatore Lionetti wrote:
> > Hi,
> > 
> > just two curiosity in creating my first gdbstub via
> tcp:
> > 1) On gdb6.8 or before, is there another way to
> accomplish the lack of 'set breakpoint always-inserted' ?
> 
> No.
> 
> > 2) When a Ctrl-c is sent to the target, is there a way
> from the target to reply with boths 'OABCD...' and 'SXX'?
> 
> Did you try making the target do just that?  It should
> work, I think.
> 
> -- 
> Pedro Alves
> 




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [GDB] Re: About break and run-time loaded lib
  2010-10-22 15:22 [GDB] Re: About break and run-time loaded lib Salvatore Lionetti
@ 2010-10-22 15:39 ` Pedro Alves
  0 siblings, 0 replies; 2+ messages in thread
From: Pedro Alves @ 2010-10-22 15:39 UTC (permalink / raw)
  To: Salvatore Lionetti; +Cc: gdb

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-22 15:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-22 15:22 [GDB] Re: About break and run-time loaded lib Salvatore Lionetti
2010-10-22 15:39 ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox