Regards,
Jan
------------------------------------------------------------------------------
(gdb) set unwindonsignal on
(gdb) start
Temporary breakpoint 1 at 0x40048f: file /tmp/callfunc.c, line 12.
Starting program: /tmp/callfunc
Temporary breakpoint 1, main () at /tmp/callfunc.c:12
12 return 0;
(gdb) p func()
Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
The program being debugged was signaled while in a function called from GDB.
GDB has restored the context to what it was before the call.
To change this behavior use "set unwindonsignal off"
Evaluation of the expression containing the function (func) will be abandoned.
(gdb) bt
#0 main () at /tmp/callfunc.c:12
(gdb)
------------------------------------------------------------------------------
but before:
(gdb) start
Temporary breakpoint 1 at 0x40048f: file /tmp/callfunc.c, line 12.
Starting program: /tmp/callfunc
Temporary breakpoint 1, main () at /tmp/callfunc.c:12
12 return 0;
(gdb) p func()
Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on"
Evaluation of the expression containing the function (func) will be abandoned.
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x0000000000400489 in func () at /tmp/callfunc.c:6
#2 <function called from gdb>
#3 main () at /tmp/callfunc.c:12
(gdb) up
#1 0x0000000000400489 in func () at /tmp/callfunc.c:6
6 return (*hook) ();
(gdb)