Dbx 1024 User's Guide Page 68

  • Download
  • Add to my manuals
  • Print
  • Page
    / 158
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 67
54
Chapter 5: Examining and Changing Data
Functions called interactively honor breakpoints. Thus you can debug a
function by setting breakpoints and then calling it interactively.
If you perform a stack trace using the where command while stopped in a
routine executed interactively, dbx displays only those activation levels
created by your interactive function call. The activation levels for your active
program are effectively invisible. For example, a stack trace looks like this
during an interactive function call:
(dbx) where
> 0 foo2(i = 9) [“/usr/var/tmp/dbx_examples/foo.c”:46, 0x10001214]
1 foo(i = 8) [“/usr/var/tmp/dbx_examples/foo.c”:40, 0x100011d4]
===== interactive function call =====
2 foo2(i = 5) [“/usr/var/tmp/dbx_examples/foo.c”:46, 0x10001214]
3 foo(i = 4) [“/usr/var/tmp/dbx_examples/foo.c”:40, 0x100011d4]
4 main(argc = 1, argv = 0xffffffad78) [“/usr/var/tmp/dbx_examples/
test4.c”:25, 0x10000fa0]
5 __start() [“/shamu/lib/libc/libc_64/csu/crt1text.s”:137, 0x10000f34]
If you stop execution of an interactively called function, you are responsible
for eventually “unstacking” the call and returning from the function call. To
unstack a call, you can complete the call using dbx commands such as cont,
resume, next, or step as many times as necessary. If you run or rerun your
program, dbx automatically unstacks all interactive function calls.
Using clearcalls
Another way to unstack an interactive function call is to execute the clearcalls
command, which clears all stopped interactive calls.
(dbx) clearcalls
When stopped or faulted within one or more nested interactive calls, the
clearcalls command removes these calls from the stack and returns the
program to its regular callstack. This command is useful when a
segmentation fault, infinite loop, or other fatal error is encountered within
the interactive call.
When stopped in an interactive call, the call stack displayed by where shows
the following line at the end of each stack of interactive call instantiation.
Page view 67
1 2 ... 63 64 65 66 67 68 69 70 71 72 73 ... 157 158

Comments to this Manuals

No comments