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]

[PATCH] i386/amd64 check sigcontext_addr handler


When reviewing rth's alpha framify-patch I realised there was a
problem on i386 if a target didn't provide a sigcontext_addr handler.
For amd64 I put in an assertion.  Hopefully this will provide enough
incentive for people to provide a sigcontext_addr handler.

Checked in.

Mark

Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>
 
	* i386-tdep.c (i386_sigtramp_frame_p): Only handle frames if we
	have a sigcontext_addr handler.
	* x86-64-tdep.c (x86_64_sigtramp_frame_p): Assert that we have a
	sigcontext_addr handler.

Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.148
diff -u -p -r1.148 i386-tdep.c
--- i386-tdep.c 31 May 2003 16:25:13 -0000 1.148
+++ i386-tdep.c 31 May 2003 16:46:56 -0000
@@ -930,6 +930,11 @@ i386_sigtramp_frame_p (CORE_ADDR pc)
 {
   char *name;
 
+  /* We shouldn't even bother to try if the OSABI didn't register
+     a sigcontext_addr handler.  */
+  if (!gdbarch_tdep (current_gdbarch)->sigcontext_addr)
+    return NULL;
+
   find_pc_partial_function (pc, &name, NULL, NULL);
   if (PC_IN_SIGTRAMP (pc, name))
     return &i386_sigtramp_frame_unwind;
Index: x86-64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/x86-64-tdep.c,v
retrieving revision 1.73
diff -u -p -r1.73 x86-64-tdep.c
--- x86-64-tdep.c 31 May 2003 16:11:47 -0000 1.73
+++ x86-64-tdep.c 31 May 2003 16:46:56 -0000
@@ -1094,7 +1094,11 @@ x86_64_sigtramp_frame_p (CORE_ADDR pc)
 
   find_pc_partial_function (pc, &name, NULL, NULL);
   if (PC_IN_SIGTRAMP (pc, name))
-    return &x86_64_sigtramp_frame_unwind;
+    {
+      gdb_assert (gdbarch_tdep (current_gdbarch)->sigcontext_addr);
+
+      return &x86_64_sigtramp_frame_unwind;
+    }
 
   return NULL;
 }


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