This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[review] Allow not saving the signal state in SIGSETJMP
- From: "Christian Biesinger (Code Review)" <gerrit at gnutoolchain-gerrit dot osci dot io>
- To: Christian Biesinger <cbiesinger at google dot com>, gdb-patches at sourceware dot org
- Cc: Tom Tromey <tromey at sourceware dot org>
- Date: Wed, 16 Oct 2019 12:10:40 -0400
- Subject: [review] Allow not saving the signal state in SIGSETJMP
- Auto-submitted: auto-generated
- References: <gerrit.1571181623000.Ib3010966050c64b4cc8b47d8cb45871652b0b3ea@gnutoolchain-gerrit.osci.io>
- Reply-to: cbiesinger at google dot com, tromey at sourceware dot org, cbiesinger at google dot com, gdb-patches at sourceware dot org
Christian Biesinger has posted comments on this change.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/124
......................................................................
Patch Set 2:
> Patch Set 2:
>
> > Patch Set 2:
> >
> > Thank you for doing this.
> >
> > It seems reasonable to me. My only question is: how do we know it works?
> >
> > I guess one way would be to find a mangled string that causes a crash
> > (there may be some in bugzilla), then demangle it twice (using "demangle"
> > should be enough) -- the second time should still report the error.
>
> I went the easy way:
> + *(int*)0=0;
>
> And got this output:
> ../../gdb/cp-support.c:1589: demangler-warning: unable to demangle '__progname' (demangler failed with signal 11)
> Unable to dump core, use `ulimit -c unlimited' before executing GDB next time.
> ../../gdb/cp-support.c:1603: demangler-warning: unable to demangle '__progname' (demangler failed with signal 11)
> A problem internal to GDB has been detected,
> further debugging may prove unreliable.
> Quit this debugging session? (y or n) n
> then:
> (gdb) demangle __progname
> Can't demangle "__progname"
>
>
> The same as without this patch applied.
>
> Although I am confused because I don't see where error_reported gets reset.
In fact, with a printf in the signal handler, I get lots of output, so this does work.
Conversely, if I remove the sigprocmask call but keep the rest of the patch, I do get a segfault from gdb.
So this should be good!