This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
Re: [RFC] Set unwindonsignal to on by default
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Phil Muldoon <pmuldoon at redhat dot com>
- Cc: Project Archer <archer at sourceware dot org>
- Date: Wed, 17 Sep 2008 22:36:57 +0200
- Subject: Re: [RFC] Set unwindonsignal to on by default
- References: <48D1449C.8060400@redhat.com>
Hi Phil,
just my opinion of a C user:
On Wed, 17 Sep 2008 19:55:40 +0200, Phil Muldoon wrote:
> I propose via this patch that we set the flag to "on" as default. It can
> always be turned off if the user desires it. Defaulting to "on" will
> improve the C++ user experience
and worsen the C user experience. I find it common the called function
segfaults and I would like to know why.
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)
static int (*hook) (void);
int
func (void)
{
return (*hook) ();
}
int
main (void)
{
return 0;
}