?
Use the gdb command backtrace. In the backtrace below, we can see that we are currently inside func2()
, which was called by func1()
, which was called from main()
(gdb) backtrace #0 func2 (x=30) at test.c:5 #1 0x80483e6 in func1 (a=30) at test.c:10 #2 0x8048414 in main (argc=1, argv=0xbffffaf4) at test.c:19 #3 0x40037f5c in __libc_start_main () from /lib/libc.so.6