This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cygwin build failure following [PATCH 3/3 v5] Demangler crash handler


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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]