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]

[commit] Eliminate PC_IN_SIGTRAMP from alpha


Hello (another frv/m68k clone), this eliminates the DEPRECATED_PC_IN_SIGTRAMP call in alpha-tdep.c. This time I moved it into the tdep structure - too many OSABIs are setting it for a straightforward clone to be possible.

committed,
Andrew
2004-05-01  Andrew Cagney  <cagney@redhat.com>

	* alpha-tdep.c (alpha_sigtramp_frame_sniffer): Use pc_in_sigtramp.
	* alpha-tdep.h (struct gdbarch_tdep): Add pc_in_sigtramp.
	* alphafbsd-tdep.c (alphafbsd_init_abi): Update.
	* alpha-osf1-tdep.c (alpha_osf1_init_abi): Update.
	* alpha-linux-tdep.c (alpha_linux_init_abi): Update.

Index: alpha-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/alpha-linux-tdep.c,v
retrieving revision 1.13
diff -p -u -r1.13 alpha-linux-tdep.c
--- alpha-linux-tdep.c	23 Mar 2004 14:47:54 -0000	1.13
+++ alpha-linux-tdep.c	1 May 2004 15:32:09 -0000
@@ -134,11 +134,10 @@ alpha_linux_init_abi (struct gdbarch_inf
   /* Hook into the MDEBUG frame unwinder.  */
   alpha_mdebug_init_abi (info, gdbarch);
 
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, alpha_linux_pc_in_sigtramp);
-
   tdep = gdbarch_tdep (gdbarch);
   tdep->dynamic_sigtramp_offset = alpha_linux_sigtramp_offset;
   tdep->sigcontext_addr = alpha_linux_sigcontext_addr;
+  tdep->pc_in_sigtramp = alpha_linux_pc_in_sigtramp;
   tdep->jb_pc = 2;
   tdep->jb_elt_size = 8;
 }
Index: alpha-osf1-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/alpha-osf1-tdep.c,v
retrieving revision 1.17
diff -p -u -r1.17 alpha-osf1-tdep.c
--- alpha-osf1-tdep.c	23 Mar 2004 14:47:54 -0000	1.17
+++ alpha-osf1-tdep.c	1 May 2004 15:32:09 -0000
@@ -54,13 +54,13 @@ alpha_osf1_init_abi (struct gdbarch_info
   /* Hook into the MDEBUG frame unwinder.  */
   alpha_mdebug_init_abi (info, gdbarch);
 
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, alpha_osf1_pc_in_sigtramp);
   /* The next/step support via procfs on OSF1 is broken when running
      on multi-processor machines. We need to use software single stepping
      instead.  */
   set_gdbarch_software_single_step (gdbarch, alpha_software_single_step);
 
   tdep->sigcontext_addr = alpha_osf1_sigcontext_addr;
+  tdep->pc_in_sigtramp = alpha_osf1_pc_in_sigtramp;
 
   tdep->jb_pc = 2;
   tdep->jb_elt_size = 8;
Index: alpha-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/alpha-tdep.c,v
retrieving revision 1.129
diff -p -u -r1.129 alpha-tdep.c
--- alpha-tdep.c	2 Apr 2004 23:01:14 -0000	1.129
+++ alpha-tdep.c	1 May 2004 15:32:13 -0000
@@ -863,14 +863,20 @@ alpha_sigtramp_frame_sniffer (struct fra
   CORE_ADDR pc = frame_pc_unwind (next_frame);
   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)
+  /* NOTE: cagney/2004-04-30: Do not copy/clone this code.  Instead
+     look at tramp-frame.h and other simplier per-architecture
+     sigtramp unwinders.  */
+
+  /* We shouldn't even bother to try if the OSABI didn't register a
+     sigcontext_addr handler or pc_in_sigtramp hander.  */
+  if (gdbarch_tdep (current_gdbarch)->sigcontext_addr == NULL)
+    return NULL;
+  if (gdbarch_tdep (current_gdbarch)->pc_in_sigtramp == NULL)
     return NULL;
 
   /* Otherwise we should be in a signal frame.  */
   find_pc_partial_function (pc, &name, NULL, NULL);
-  if (DEPRECATED_PC_IN_SIGTRAMP (pc, name))
+  if (gdbarch_tdep (current_gdbarch)->pc_in_sigtramp (pc, name))
     return &alpha_sigtramp_frame_unwind;
 
   return NULL;
Index: alpha-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/alpha-tdep.h,v
retrieving revision 1.20
diff -p -u -r1.20 alpha-tdep.h
--- alpha-tdep.h	2 Oct 2003 20:28:28 -0000	1.20
+++ alpha-tdep.h	1 May 2004 15:32:13 -0000
@@ -83,6 +83,12 @@ struct gdbarch_tdep
      the sigcontext structure for that signal handler.  */
   CORE_ADDR (*sigcontext_addr) (struct frame_info *);
 
+  /* Does the PC fall in a signal trampoline.  */
+  /* NOTE: cagney/2004-04-30: Do not copy/clone this code.  Instead
+     look at tramp-frame.h and other simplier per-architecture
+     sigtramp unwinders.  */
+  int (*pc_in_sigtramp) (CORE_ADDR pc, char *name);
+
   /* Offset of registers in `struct sigcontext'.  */
   int sc_pc_offset;
   int sc_regs_offset;
Index: alphafbsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/alphafbsd-tdep.c,v
retrieving revision 1.12
diff -p -u -r1.12 alphafbsd-tdep.c
--- alphafbsd-tdep.c	23 Mar 2004 14:47:55 -0000	1.12
+++ alphafbsd-tdep.c	1 May 2004 15:32:14 -0000
@@ -100,10 +100,9 @@ alphafbsd_init_abi (struct gdbarch_info 
 
   set_gdbarch_use_struct_convention (gdbarch, alphafbsd_use_struct_convention);
 
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, alphafbsd_pc_in_sigtramp);
-
   tdep->dynamic_sigtramp_offset = alphafbsd_sigtramp_offset;
   tdep->sigcontext_addr = alphafbsd_sigcontext_addr;
+  tdep->pc_in_sigtramp = alphafbsd_pc_in_sigtramp;
   tdep->sc_pc_offset = 288;
   tdep->sc_regs_offset = 24;
   tdep->sc_fpregs_offset = 320;
Index: alphanbsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/alphanbsd-tdep.c,v
retrieving revision 1.20
diff -p -u -r1.20 alphanbsd-tdep.c
--- alphanbsd-tdep.c	21 Apr 2004 17:47:10 -0000	1.20
+++ alphanbsd-tdep.c	1 May 2004 15:32:14 -0000
@@ -205,8 +205,6 @@ alphanbsd_init_abi (struct gdbarch_info 
   /* Hook into the MDEBUG frame unwinder.  */
   alpha_mdebug_init_abi (info, gdbarch);
 
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, alphanbsd_pc_in_sigtramp);
-
   /* NetBSD/alpha does not provide single step support via ptrace(2); we
      must use software single-stepping.  */
   set_gdbarch_software_single_step (gdbarch, alpha_software_single_step);
@@ -215,6 +213,7 @@ alphanbsd_init_abi (struct gdbarch_info 
                                  nbsd_lp64_solib_svr4_fetch_link_map_offsets);
 
   tdep->dynamic_sigtramp_offset = alphanbsd_sigtramp_offset;
+  tdep->pc_in_sigtramp = alphanbsd_pc_in_sigtramp;
   tdep->sigcontext_addr = alphanbsd_sigcontext_addr;
 
   tdep->jb_pc = 2;

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