This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Cygwin build failure following [PATCH 3/3 v5] Demangler crash handler
- From: Gary Benson <gbenson at redhat dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: Pierre Muller <pierre dot muller at ics-cnrs dot unistra dot fr>, gdb-patches at sourceware dot org, "'Andrew Burgess'" <aburgess at broadcom dot com>, "'Doug Evans'" <xdje42 at gmail dot com>, "'Eli Zaretskii'" <eliz at gnu dot org>, "'Florian Weimer'" <fw at deneb dot enyo dot de>, "'Mark Kettenis'" <mark dot kettenis at xs4all dot nl>, "'Pedro Alves'" <palves at redhat dot com>, "'Tom Tromey'" <tromey at redhat dot com>, "'Corinna Vinschen'" <vinschen at redhat dot com>
- Date: Mon, 14 Jul 2014 12:42:41 +0100
- Subject: Re: Cygwin build failure following [PATCH 3/3 v5] Demangler crash handler
- Authentication-results: sourceware.org; auth=none
- References: <20140609152229 dot GA27494 at blade dot nx> <20140609152434 dot GD27494 at blade dot nx> <000901cf9eb5$16841da0$438c58e0$ at muller@ics-cnrs.unistra.fr> <20140714085154 dot GA27730 at blade dot nx> <mvm8unwpbgi dot fsf at hawking dot suse dot de>
Andreas Schwab wrote:
> Gary Benson <gbenson@redhat.com> writes:
> > diff --git a/gdb/cp-support.c b/gdb/cp-support.c
> > index a8ea6fc..6a09b46 100644
> > --- a/gdb/cp-support.c
> > +++ b/gdb/cp-support.c
> > @@ -1557,7 +1557,9 @@ gdb_demangle (const char *name, int options)
> > #if defined (HAVE_SIGACTION) && defined (SA_RESTART)
> > sa.sa_handler = gdb_demangle_signal_handler;
> > sigemptyset (&sa.sa_mask);
> > +#ifdef HAVE_SIGALTSTACK
> > sa.sa_flags = SA_ONSTACK;
> > +#endif
>
> You probably need to initialize sa.sa_flags in any case.
Good spot, thanks Andreas.
Pierre, I've inlined an updated patch below.
Thanks,
Gary
--
diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index a8ea6fc..5464117 100644
--- a/gdb/cp-support.c
+++ b/gdb/cp-support.c
@@ -1557,7 +1557,11 @@ gdb_demangle (const char *name, int options)
#if defined (HAVE_SIGACTION) && defined (SA_RESTART)
sa.sa_handler = gdb_demangle_signal_handler;
sigemptyset (&sa.sa_mask);
+#ifdef HAVE_SIGALTSTACK
sa.sa_flags = SA_ONSTACK;
+#else
+ sa.sa_flags = 0;
+#endif
sigaction (SIGSEGV, &sa, &old_sa);
#else
ofunc = (void (*)()) signal (SIGSEGV, gdb_demangle_signal_handler);