This is the mail archive of the gdb@sourceware.cygnus.com 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]

Re: gdb functionality query


Peter Leggett wrote:
> 
> Hello,
> 
> I hope that this list is the appropriate one to ask a general
> gdb question. If not please excuse this mail.
> 
> The research group I work in uses the Sun debugger/dbx which has some
> these extremly useful features without which we would find debugging
> our codes much harder. We are now also running on linux boxes
> and are exploring the possibilites of gdb.
> 
> I would very much appreciate it if anyone could tell me if gdb has
> the following specific functionality:-
> 
> a) Ability to pop program call frame stack and then continue. I know one
>    can browse up and down the frames in gdb but can one pop it and
>    continue from a calling frame up the stack.

Yes:

(gdb) help return
Make selected stack frame return to its caller.
Control remains in the debugger, but when you continue
execution will resume in the frame above the one now selected.
If an argument is given, it is an expression for the value to return.

(gdb) help finish
Execute until selected stack frame returns.
Upon return, the value returned is printed and put in the value history.

> b) make an arbitary call to user code (with possibly arguments and
>    expressions) from gdb  and break point within that call etc..
>    e.g.
> 
>    gdb-> break usersub
>    gdb-> call usersub(a,fred+2,jim*2+1)
>    ...
> 
>    where a, fred and kim are user variables.

Yes:

The commands are even identical.

(gdb) help call
Call a function in the program.
The argument is the function name and arguments, in the notation of the
current working language.  The result is printed and saved in the value
history, if it is not void.

	enjoy,
		Andrew

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