This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] arch-utils.c: Fix IN_SIGTRAMP usage
- From: Andrew Cagney <ac131313 at ges dot redhat dot com>
- To: Corinna Vinschen <vinschen at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Fri, 13 Sep 2002 16:20:06 -0400
- Subject: Re: [RFA] arch-utils.c: Fix IN_SIGTRAMP usage
- References: <20020913194147.H1574@cygbert.vinschen.de>
Hi,
the latest multiarching of SIGTRAMP stuff introduced a problem
when multiarched targets neither define PC_IN_SIGTRAMP nor
SIGTRAMP_START. In that case, legacy_pc_in_sigtramp() is called
which in turn uses a preprocessor expression which calls
SIGTRAMP_START() and SIGTRAMP_END() if SIGTRAMP_START is defined.
That's wrong for multiarched targets since SIGTRAMP_START is then
always defined. In turn, gdb fails in create_new_frame() due to
a NULL pointer in gdbarch->sigtramp_start.
Ulgh,
The fix is to use the already existing predicate SIGTRAMP_START_P
to guard against usage of SIGTRAMP_START().
Yes, ok, with tweak.
@@ -470,7 +458,15 @@ generic_register_byte (int regnum)
int
legacy_pc_in_sigtramp (CORE_ADDR pc, char *name)
{
+#if !defined (IN_SIGTRAMP)
+#if SIGTRAMP_START_P
I think this should be:
if (SIGTRAMP_START_P())
...
else
...
gdbarch.h should always define SIGTRAMP_START_P().
+ return (pc) >= SIGTRAMP_START(pc) && (pc) < SIGTRAMP_END(pc);
+#else
And ``strcmp ("_sigtramp", name) == 0'', we're trying to eliminate STREQ :-)
+ return name && STREQ ("_sigtramp", name);
+#endif
+#else
return IN_SIGTRAMP(pc, name);
+#endif
}
thanks for fixing it.
Andrew