public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Call function but step by step?
@ 2011-11-06  9:47 phoeagon
  2011-11-06  9:54 ` Jan Kratochvil
  0 siblings, 1 reply; 2+ messages in thread
From: phoeagon @ 2011-11-06  9:47 UTC (permalink / raw)
  To: gdb

eh, i wonder if this feature exists or if it's appropriate to add.
 that is to call a function explicitly (just like "call func" command)
but instead of executing the function all at once, the cursor stops at
the entry (as if the function is called at the point and we used step
in to trace into it) and wait for further commands (which can be, say,
step or next, which is very useful)...

Cheers.

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

* Re: Call function but step by step?
  2011-11-06  9:47 Call function but step by step? phoeagon
@ 2011-11-06  9:54 ` Jan Kratochvil
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kratochvil @ 2011-11-06  9:54 UTC (permalink / raw)
  To: phoeagon; +Cc: gdb

On Sun, 06 Nov 2011 10:46:58 +0100, phoeagon wrote:
> eh, i wonder if this feature exists or if it's appropriate to add.
>  that is to call a function explicitly (just like "call func" command)
> but instead of executing the function all at once, the cursor stops at
> the entry (as if the function is called at the point and we used step
> in to trace into it) and wait for further commands (which can be, say,
> step or next, which is very useful)...

It is a common practice:

(gdb) break new_block
Breakpoint 2 at 0x7d44fb: file mdebugread.c, line 4867.
(gdb) p new_block(0)

Breakpoint 2, new_block (type=FUNCTION_BLOCK) at mdebugread.c:4867
4867	  struct block *retval = xzalloc (sizeof (struct block));
The program being debugged stopped while in a function called from GDB.
Evaluation of the expression containing the function
(new_block) will be abandoned.
When the function is done executing, GDB will silently stop.
(gdb) bt
#0  new_block (type=FUNCTION_BLOCK) at mdebugread.c:4867
#1  <function called from gdb>
#2  main (argc=1, argv=0x7fffffffdfe8) at gdb.c:30
(gdb) next
4869	  if (type == FUNCTION_BLOCK)


Regards,
Jan

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

end of thread, other threads:[~2011-11-06  9:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-06  9:47 Call function but step by step? phoeagon
2011-11-06  9:54 ` Jan Kratochvil

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).