Re: GDB commands

Michael Snyder
2007-11-26T19:14:07Z

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