[ob] Eliminate DEPRECATED_USE_GENERIC_DUMMY_FRAMES, always 1

Andrew Cagney cagney@gnu.org
Sat May 8 19:04:00 GMT 2004


Since DEPRECATED_USE_GENERIC_DUMMY_FRAMES is always one, some code can 
be simplified.

committed,
Andrew
Index: ChangeLog
2004-05-08  Andrew Cagney  <cagney@redhat.com>

	* gdbarch.sh (DEPRECATED_USE_GENERIC_DUMMY_FRAMES): Delete.
	* gdbarch.h, gdbarch.c: Re-generate.
	* blockframe.c (legacy_frame_chain_valid): Simplify by eliminating
	DEPRECATED_USE_GENERIC_DUMMY_FRAMES.
	* infcall.c (legacy_push_dummy_code, call_function_by_hand): Ditto.
	* frame.c (frame_type_from_pc, legacy_get_prev_frame): Ditto.

Index: blockframe.c
===================================================================
RCS file: /cvs/src/src/gdb/blockframe.c,v
retrieving revision 1.99
diff -p -u -r1.99 blockframe.c
--- blockframe.c	8 May 2004 18:37:17 -0000	1.99
+++ blockframe.c	8 May 2004 19:01:28 -0000
@@ -527,8 +527,7 @@ int
 legacy_frame_chain_valid (CORE_ADDR fp, struct frame_info *fi)
 {
   /* Don't prune CALL_DUMMY frames.  */
-  if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES
-      && DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), 0, 0))
+  if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), 0, 0))
     return 1;
 
   /* If the new frame pointer is zero, then it isn't valid.  */
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.180
diff -p -u -r1.180 frame.c
--- frame.c	8 May 2004 18:47:20 -0000	1.180
+++ frame.c	8 May 2004 19:01:29 -0000
@@ -1062,8 +1062,9 @@ const struct frame_unwind *legacy_saved_
 static enum frame_type
 frame_type_from_pc (CORE_ADDR pc)
 {
-  if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES
-      && deprecated_pc_in_call_dummy (pc, 0, 0))
+  /* NOTE: cagney/2004-05-08: Eliminating this function depends on all
+     architectures being forced to use the frame-unwind code.  */
+  if (deprecated_pc_in_call_dummy (pc, 0, 0))
     return DUMMY_FRAME;
   else
     return NORMAL_FRAME;
@@ -1581,8 +1582,7 @@ legacy_get_prev_frame (struct frame_info
      has previously set it.  This is really somewhat bogus.  The
      initialization, as seen in create_new_frame(), should occur
      before the INIT function has been called.  */
-  if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES
-      && deprecated_pc_in_call_dummy (get_frame_pc (prev), 0, 0))
+  if (deprecated_pc_in_call_dummy (get_frame_pc (prev), 0, 0))
     prev->type = DUMMY_FRAME;
 
   if (prev->type == NORMAL_FRAME)
Index: gdbarch.h
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.h,v
retrieving revision 1.248
diff -p -u -r1.248 gdbarch.h
--- gdbarch.h	7 May 2004 14:55:59 -0000	1.248
+++ gdbarch.h	8 May 2004 19:01:29 -0000
@@ -52,9 +52,6 @@ struct obstack;
 
 extern struct gdbarch *current_gdbarch;
 
-/* Always one, being eliminated.  */
-#define DEPRECATED_USE_GENERIC_DUMMY_FRAMES 1
-
 /* If any of the following are defined, the target wasn't correctly
    converted. */
 
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.312
diff -p -u -r1.312 gdbarch.sh
--- gdbarch.sh	7 May 2004 14:55:59 -0000	1.312
+++ gdbarch.sh	8 May 2004 19:01:32 -0000
@@ -864,9 +864,6 @@ struct obstack;
 
 extern struct gdbarch *current_gdbarch;
 
-/* Always one, being eliminated.  */
-#define DEPRECATED_USE_GENERIC_DUMMY_FRAMES 1
-
 /* If any of the following are defined, the target wasn't correctly
    converted. */
 
Index: infcall.c
===================================================================
RCS file: /cvs/src/src/gdb/infcall.c,v
retrieving revision 1.42
diff -p -u -r1.42 infcall.c
--- infcall.c	7 May 2004 14:08:52 -0000	1.42
+++ infcall.c	8 May 2004 19:01:33 -0000
@@ -292,8 +292,7 @@ legacy_push_dummy_code (struct gdbarch *
      dummy_addr.  Ulgh!  Blame the HP/UX target.  */
   (*real_pc) += DEPRECATED_CALL_DUMMY_START_OFFSET;
   write_memory (start_sp, (char *) dummy1, sizeof_dummy1);
-  if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES)
-    generic_save_call_dummy_addr (start_sp, start_sp + sizeof_dummy1);
+  generic_save_call_dummy_addr (start_sp, start_sp + sizeof_dummy1);
   return sp;
 }
 
@@ -596,10 +595,9 @@ call_function_by_hand (struct value *fun
       internal_error (__FILE__, __LINE__, "bad switch");
     }
 
-  if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES)
-    /* Save where the breakpoint is going to be inserted so that the
-       dummy-frame code is later able to re-identify it.  */
-    generic_save_call_dummy_addr (bp_addr, bp_addr + 1);
+  /* Save where the breakpoint is going to be inserted so that the
+     dummy-frame code is later able to re-identify it.  */
+  generic_save_call_dummy_addr (bp_addr, bp_addr + 1);
 
   if (nargs < TYPE_NFIELDS (ftype))
     error ("too few arguments in function call");
@@ -833,7 +831,6 @@ You must use a pointer to function type 
       /* Sanity.  The exact same SP value is returned by
 	 PUSH_DUMMY_CALL, saved as the dummy-frame TOS, and used by
 	 unwind_dummy_id to form the frame ID's stack address.  */
-      gdb_assert (DEPRECATED_USE_GENERIC_DUMMY_FRAMES);
       generic_save_dummy_frame_tos (sp);
     }
   else if (DEPRECATED_SAVE_DUMMY_FRAME_TOS_P ())
@@ -861,7 +858,6 @@ You must use a pointer to function type 
 	/* Sanity.  The exact same SP value is returned by
 	 PUSH_DUMMY_CALL, saved as the dummy-frame TOS, and used by
 	 unwind_dummy_id to form the frame ID's stack address.  */
-	gdb_assert (DEPRECATED_USE_GENERIC_DUMMY_FRAMES);
 	frame = frame_id_build (sp, sal.pc);
       }
     else


More information about the Gdb-patches mailing list