This is the mail archive of the gdb-patches@sources.redhat.com 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: [RFA] arch-utils.c: Fix IN_SIGTRAMP usage


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



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