public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* GDB commands
@ 2007-11-20 13:44 Guillaume MENANT
  2007-11-23  9:37 ` Guillaume MENANT
  0 siblings, 1 reply; 11+ messages in thread
From: Guillaume MENANT @ 2007-11-20 13:44 UTC (permalink / raw)
  To: gdb

Hello,

I am trying to do a wrapper between GDB (which will be controlled by 
Eclipse) and another protocol (specific debug protocol of a SPARC) and I 
don't know which GDB command is mandatory for Eclipse. I've seen the 
commands handled by the "sparc-stub.c" file but I wonder if it's 
sufficient. For example, the "sparc-stub.c" doesn't handle the 's' 
command which is obviously mandatory according to this page : 
http://sources.redhat.com/gdb/onlinedocs/gdb_33.html#SEC679

Thanks (sorry for my english, i'm french)

-- 

Guillaume MENANT


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

* Re: GDB commands
  2007-11-20 13:44 GDB commands Guillaume MENANT
@ 2007-11-23  9:37 ` Guillaume MENANT
  2007-11-23 11:05   ` Vladimir Prus
  2007-11-26 19:14   ` Michael Snyder
  0 siblings, 2 replies; 11+ messages in thread
From: Guillaume MENANT @ 2007-11-23  9:37 UTC (permalink / raw)
  To: gdb


Can't we know which command is mandatory ? I'm assuming that m, M, c, s, g,
and G are mandatory but i'm not sure.


Guillaume MENANT wrote:
> 
> Hello,
> 
> I am trying to do a wrapper between GDB (which will be controlled by 
> Eclipse) and another protocol (specific debug protocol of a SPARC) and I 
> don't know which GDB command is mandatory for Eclipse. I've seen the 
> commands handled by the "sparc-stub.c" file but I wonder if it's 
> sufficient. For example, the "sparc-stub.c" doesn't handle the 's' 
> command which is obviously mandatory according to this page : 
> http://sources.redhat.com/gdb/onlinedocs/gdb_33.html#SEC679
> 
> Thanks (sorry for my english, i'm french)
> 
> -- 
> 
> Guillaume MENANT
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/GDB-commands-tf4843563.html#a13909280
Sent from the Sourceware - gdb list mailing list archive at Nabble.com.

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

* Re: GDB commands
  2007-11-23  9:37 ` Guillaume MENANT
@ 2007-11-23 11:05   ` Vladimir Prus
  2007-11-23 12:27     ` Guillaume MENANT
  2007-11-26 19:04     ` Michael Snyder
  2007-11-26 19:14   ` Michael Snyder
  1 sibling, 2 replies; 11+ messages in thread
From: Vladimir Prus @ 2007-11-23 11:05 UTC (permalink / raw)
  To: gdb

Guillaume MENANT wrote:

> 
> Can't we know which command is mandatory ? I'm assuming that m, M, c, s,
> g, and G are mandatory but i'm not sure.

I doubt a complete list is available. Off the top of my head, you need
vCont (and don't need c and s). You also need zN/ZN -- without breakpoints,
debugging is of no interest.

- Volodya


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

* Re: GDB commands
  2007-11-23 11:05   ` Vladimir Prus
@ 2007-11-23 12:27     ` Guillaume MENANT
  2007-11-23 12:58       ` Vladimir Prus
  2007-11-26 19:04     ` Michael Snyder
  1 sibling, 1 reply; 11+ messages in thread
From: Guillaume MENANT @ 2007-11-23 12:27 UTC (permalink / raw)
  To: gdb


Why vCont and not c and s (to be more accurate, I want to debug embedded
applications)? 


Vladimir Prus wrote:
> 
> Guillaume MENANT wrote:
> 
>> 
>> Can't we know which command is mandatory ? I'm assuming that m, M, c, s,
>> g, and G are mandatory but i'm not sure.
> 
> I doubt a complete list is available. Off the top of my head, you need
> vCont (and don't need c and s). You also need zN/ZN -- without
> breakpoints,
> debugging is of no interest.
> 
> - Volodya
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/GDB-commands-tf4843563.html#a13911418
Sent from the Sourceware - gdb list mailing list archive at Nabble.com.

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

* Re: GDB commands
  2007-11-23 12:27     ` Guillaume MENANT
@ 2007-11-23 12:58       ` Vladimir Prus
  0 siblings, 0 replies; 11+ messages in thread
From: Vladimir Prus @ 2007-11-23 12:58 UTC (permalink / raw)
  To: gdb

Guillaume MENANT wrote:

> 
> Why vCont and not c and s (to be more accurate, I want to debug embedded
> applications)?

Should you ever want threading support, you'll find that combination of
c, s and Hc packets has various bugs. For single-threaded target, it
does not matter, but even if you have single-threaded application, it might
change ;-)

- Volodya


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

* Re: GDB commands
  2007-11-23 11:05   ` Vladimir Prus
  2007-11-23 12:27     ` Guillaume MENANT
@ 2007-11-26 19:04     ` Michael Snyder
  2007-11-26 19:21       ` Vladimir Prus
  1 sibling, 1 reply; 11+ messages in thread
From: Michael Snyder @ 2007-11-26 19:04 UTC (permalink / raw)
  To: Vladimir Prus; +Cc: gdb

On Fri, 2007-11-23 at 14:05 +0300, Vladimir Prus wrote:
> Guillaume MENANT wrote:
> 
> > 
> > Can't we know which command is mandatory ? I'm assuming that m, M, c, s,
> > g, and G are mandatory but i'm not sure.
> 
> I doubt a complete list is available. Off the top of my head, you need
> vCont (and don't need c and s). 

I don't see how that is true -- you can still control a target
using c and s rather than using vCont...


> You also need zN/ZN -- without breakpoints,
> debugging is of no interest.

Neither is this true -- breakpoints can be set the old fashioned
way using memory read/write and trap instructions.



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

* Re: GDB commands
  2007-11-23  9:37 ` Guillaume MENANT
  2007-11-23 11:05   ` Vladimir Prus
@ 2007-11-26 19:14   ` Michael Snyder
  2007-11-26 19:22     ` Daniel Jacobowitz
  1 sibling, 1 reply; 11+ messages in thread
From: Michael Snyder @ 2007-11-26 19:14 UTC (permalink / raw)
  To: Guillaume MENANT; +Cc: gdb

On Fri, 2007-11-23 at 01:37 -0800, Guillaume MENANT wrote:
> Can't we know which command is mandatory ? I'm assuming that m, M, c, s, g,
> and G are mandatory but i'm not sure.

Sorry, didn't really understand your question at first.

I'm afraid we have not really sat down and tried to list
which commands are mandatory in recent times.

Many of the commands are designed to be optional (and of course,
any target-side gdb agent is required to quietly ignore any
command that it does not understand).

However, a number of commands can be used as substitutes for
one another.  Hence it is hard to say that one particular command
is "manditory", given that it can be replaced by another command.

Let me make an attempt, and please realize that I am 
doing this "off the top of my head".

1) You need a way to read and write memory.  There are 
several candidates, one being the original 'm' and 'M', 
another being the newer 'x' and 'X' (binary encoded).

2) You need a way to read and write registers.  Again there
are several possible ways, for instance the original pair of
commands 'g' and 'G' (read/write entire register set), another
the more recent 'p' and 'P' (read/write individual register).

3) You need a way to control execution.  As mentioned, there is
the original pair of commands 's' and 'c' (step and continue), 
and there is a newer set of commands built around the string 
"vCont"

Of the many other command sequences, most can be considered optional
depending on what extra functionality you require (eg. if you need
multi-thread debugging).  But at this point I would have to advise 
you to implement the above subset, then try debugging and see what
happens.

Cheers,
Michael



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

* Re: GDB commands
  2007-11-26 19:04     ` Michael Snyder
@ 2007-11-26 19:21       ` Vladimir Prus
  0 siblings, 0 replies; 11+ messages in thread
From: Vladimir Prus @ 2007-11-26 19:21 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb

On Monday 26 November 2007 21:52:34 Michael Snyder wrote:
> On Fri, 2007-11-23 at 14:05 +0300, Vladimir Prus wrote:
> > Guillaume MENANT wrote:
> > 
> > > 
> > > Can't we know which command is mandatory ? I'm assuming that m, M, c, s,
> > > g, and G are mandatory but i'm not sure.
> > 
> > I doubt a complete list is available. Off the top of my head, you need
> > vCont (and don't need c and s). 
> 
> I don't see how that is true -- you can still control a target
> using c and s rather than using vCont...

If the target is multi-threaded, vCont is much better idea. And given
that implementing vCont is about as much work as c/s/Hc, it's probably
better to just implement vCont even for single-threaded target.

> > You also need zN/ZN -- without breakpoints,
> > debugging is of no interest.
> 
> Neither is this true -- breakpoints can be set the old fashioned
> way using memory read/write and trap instructions.

Yes, you're right.

- Volodya

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

* Re: GDB commands
  2007-11-26 19:14   ` Michael Snyder
@ 2007-11-26 19:22     ` Daniel Jacobowitz
  2007-11-26 19:30       ` Michael Snyder
  0 siblings, 1 reply; 11+ messages in thread
From: Daniel Jacobowitz @ 2007-11-26 19:22 UTC (permalink / raw)
  To: Michael Snyder; +Cc: Guillaume MENANT, gdb

On Mon, Nov 26, 2007 at 11:01:47AM -0800, Michael Snyder wrote:
> 1) You need a way to read and write memory.  There are 
> several candidates, one being the original 'm' and 'M', 
> another being the newer 'x' and 'X' (binary encoded).

Just 'X', no 'x'; 'x' would be a logical addition but no one's been
round to it.

All the rest of what Michael's written looks correct to me.  You can
get by with very few packets... but if you want a useful debugging
stub, you may need more.

I suspect '?' is mandatory.


-- 
Daniel Jacobowitz
CodeSourcery

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

* Re: GDB commands
  2007-11-26 19:22     ` Daniel Jacobowitz
@ 2007-11-26 19:30       ` Michael Snyder
  2007-11-27 10:46         ` Guillaume MENANT
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Snyder @ 2007-11-26 19:30 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: Guillaume MENANT, gdb

On Mon, 2007-11-26 at 14:22 -0500, Daniel Jacobowitz wrote:
> On Mon, Nov 26, 2007 at 11:01:47AM -0800, Michael Snyder wrote:
> > 1) You need a way to read and write memory.  There are 
> > several candidates, one being the original 'm' and 'M', 
> > another being the newer 'x' and 'X' (binary encoded).
> 
> Just 'X', no 'x'; 'x' would be a logical addition but no one's been
> round to it.
> 
> All the rest of what Michael's written looks correct to me.  You can
> get by with very few packets... but if you want a useful debugging
> stub, you may need more.
> 
> I suspect '?' is mandatory.

Ah, yes.   ;-)


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

* Re: GDB commands
  2007-11-26 19:30       ` Michael Snyder
@ 2007-11-27 10:46         ` Guillaume MENANT
  0 siblings, 0 replies; 11+ messages in thread
From: Guillaume MENANT @ 2007-11-27 10:46 UTC (permalink / raw)
  To: gdb




Michael Snyder-3 wrote:
> 
> On Mon, 2007-11-26 at 14:22 -0500, Daniel Jacobowitz wrote:
>> On Mon, Nov 26, 2007 at 11:01:47AM -0800, Michael Snyder wrote:
>> > 1) You need a way to read and write memory.  There are 
>> > several candidates, one being the original 'm' and 'M', 
>> > another being the newer 'x' and 'X' (binary encoded).
>> 
>> Just 'X', no 'x'; 'x' would be a logical addition but no one's been
>> round to it.
>> 
>> All the rest of what Michael's written looks correct to me.  You can
>> get by with very few packets... but if you want a useful debugging
>> stub, you may need more.
>> 
>> I suspect '?' is mandatory.
> 
> Ah, yes.   ;-)
> 
> 
Thanks a lot for your answers. For now, I handle m, M, c, S, g, G, z, Z,
vFlashWrite, vFlashErase and vFlashDone.
-- 
View this message in context: http://www.nabble.com/GDB-commands-tf4843563.html#a13968586
Sent from the Sourceware - gdb list mailing list archive at Nabble.com.

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

end of thread, other threads:[~2007-11-27 10:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-20 13:44 GDB commands Guillaume MENANT
2007-11-23  9:37 ` Guillaume MENANT
2007-11-23 11:05   ` Vladimir Prus
2007-11-23 12:27     ` Guillaume MENANT
2007-11-23 12:58       ` Vladimir Prus
2007-11-26 19:04     ` Michael Snyder
2007-11-26 19:21       ` Vladimir Prus
2007-11-26 19:14   ` Michael Snyder
2007-11-26 19:22     ` Daniel Jacobowitz
2007-11-26 19:30       ` Michael Snyder
2007-11-27 10:46         ` Guillaume MENANT

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).