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] Don't require FRAME_INIT_SAVED_REGS


Hello,

This changes FRAME_INIT_SAVED_REGS to a function with predicate (previously it was a required architecture method).

Since architectures are no longer need to implement saved-regs based frames, requiring this method doesn't make sense.

committed,
Andrew
2003-01-13  Andrew Cagney  <ac131313@redhat.com>

	* gdbarch.sh (FRAME_INIT_SAVED_REGS): Change to function with
	predicate.
	* gdbarch.h, gdbarch.c: Regenerate.
	* stack.c (frame_info): Only initialize the saved registers when
	FRAME_INIT_SAVED_REGS_P.
	* frame.c (frame_saved_regs_register_unwind): Assert
	FRAME_INIT_SAVED_REGS_P.
	(deprecated_generic_get_saved_register): Ditto.

Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.56
diff -u -r1.56 frame.c
--- frame.c	9 Jan 2003 18:53:20 -0000	1.56
+++ frame.c	13 Jan 2003 21:01:15 -0000
@@ -570,6 +570,10 @@
   gdb_assert (!(DEPRECATED_USE_GENERIC_DUMMY_FRAMES
 		&& (get_frame_type (frame) == DUMMY_FRAME)));
 
+  /* Only (older) architectures that implement the
+     FRAME_INIT_SAVED_REGS method should be using this function.  */
+  gdb_assert (FRAME_INIT_SAVED_REGS_P ());
+
   /* Load the saved_regs register cache.  */
   if (frame->saved_regs == NULL)
     FRAME_INIT_SAVED_REGS (frame);
@@ -737,6 +741,8 @@
 {
   if (!target_has_registers)
     error ("No registers.");
+
+  gdb_assert (FRAME_INIT_SAVED_REGS_P ());
 
   /* Normal systems don't optimize out things with register numbers.  */
   if (optimized != NULL)
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.189
diff -u -r1.189 gdbarch.sh
--- gdbarch.sh	6 Jan 2003 18:49:09 -0000	1.189
+++ gdbarch.sh	13 Jan 2003 21:01:23 -0000
@@ -551,7 +551,7 @@
 F:2:DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:deprecated_extract_struct_value_address:char *regbuf:regbuf:::0
 f:2:USE_STRUCT_CONVENTION:int:use_struct_convention:int gcc_p, struct type *value_type:gcc_p, value_type:::generic_use_struct_convention::0
 #
-f:2:FRAME_INIT_SAVED_REGS:void:frame_init_saved_regs:struct frame_info *frame:frame::0:0
+F:2:FRAME_INIT_SAVED_REGS:void:frame_init_saved_regs:struct frame_info *frame:frame:::0
 F:2:INIT_EXTRA_FRAME_INFO:void:init_extra_frame_info:int fromleaf, struct frame_info *frame:fromleaf, frame:::0
 #
 f:2:SKIP_PROLOGUE:CORE_ADDR:skip_prologue:CORE_ADDR ip:ip::0:0
Index: stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.59
diff -u -r1.59 stack.c
--- stack.c	17 Dec 2002 17:27:45 -0000	1.59
+++ stack.c	13 Jan 2003 21:01:24 -0000
@@ -900,7 +900,8 @@
       }
   }
 
-  if (get_frame_saved_regs (fi) == NULL)
+  if (FRAME_INIT_SAVED_REGS_P ()
+      && get_frame_saved_regs (fi) == NULL)
     FRAME_INIT_SAVED_REGS (fi);
   /* Print as much information as possible on the location of all the
      registers.  */

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