Name

backtrace

Synopsis

backtrace [count]

Print a full list of all stack frames. With a positive count, print only the innermost count stack frames. With a negative count, print only the outermost count stack frames.

Example

Show a backtrace upon hitting a breakpoint:

    ...
    Breakpoint 1, do_print (tree=0x924f9e0) at builtin.c:1573
    1573            struct redirect *rp = NULL;
    (gdb) backtrace
    #0  do_print (tree=0x924f9e0) at builtin.c:1573
    #1  0x08087bef in interpret (tree=0x924f9e0) at eval.c:784
    #2  0x08086b68 in interpret (tree=0x924f980) at eval.c:453
    #3  0x08072804 in main (argc=2, argv=0xbfe41bd4) at main.c:584

Get Unix in a Nutshell, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.