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/rfc] Add predicates to FRAME_CHAIN() and FRAME_SAVED_PC()


Hello,

More unwind branch fallout. An architecture implementing the new frame unwind mechanism doesn't need to provide these functions.

This patch changes them to functions with predicates.

I'll commit once I've got a few more test results back.

Andrew
2003-01-28  Andrew Cagney  <ac131313@redhat.com>

	* frame.c (frame_saved_regs_id_unwind): Assert FRAME_CHAIN_P.
	(legacy_get_prev_frame): Assert FRAME_CHAIN_P.
	(get_prev_frame): When FRAME_CHAIN_P, call legacy_get_prev_frame.
	(frame_saved_regs_pc_unwind): Assert FRAME_SAVED_PC_P.
	* gdbarch.sh (FRAME_CHAIN): Change to a function with predicate.
	(FRAME_SAVED_PC): Change to a function with predicate.
	* gdbarch.h, gdbarch.c: Re-generate.

Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.63
diff -u -r1.63 frame.c
--- frame.c	27 Jan 2003 21:41:40 -0000	1.63
+++ frame.c	28 Jan 2003 21:55:57 -0000
@@ -665,6 +665,7 @@
 static CORE_ADDR
 frame_saved_regs_pc_unwind (struct frame_info *frame, void **cache)
 {
+  gdb_assert (FRAME_SAVED_PC_P ());
   return FRAME_SAVED_PC (frame);
 }
 	
@@ -713,6 +714,7 @@
          this to after the ffi test; I'd rather have backtraces from
          start go curfluy than have an abort called from main not show
          main.  */
+      gdb_assert (FRAME_CHAIN_P ());
       base = FRAME_CHAIN (next_frame);
 
       if (!frame_chain_valid (base, next_frame))
@@ -995,6 +997,7 @@
          this to after the ffi test; I'd rather have backtraces from
          start go curfluy than have an abort called from main not show
          main.  */
+      gdb_assert (FRAME_CHAIN_P ());
       address = FRAME_CHAIN (next_frame);
 
       if (!frame_chain_valid (address, next_frame))
@@ -1233,7 +1236,8 @@
      frames use the new unwind code.  */
   if ((DEPRECATED_INIT_FRAME_PC_P ()
        || DEPRECATED_INIT_FRAME_PC_FIRST_P ()
-       || INIT_EXTRA_FRAME_INFO_P ())
+       || INIT_EXTRA_FRAME_INFO_P ()
+       || FRAME_CHAIN_P ())
       && next_frame->level >= 0)
     return legacy_get_prev_frame (next_frame);
 
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.192
diff -u -r1.192 gdbarch.sh
--- gdbarch.sh	21 Jan 2003 19:43:47 -0000	1.192
+++ gdbarch.sh	28 Jan 2003 21:55:59 -0000
@@ -568,9 +568,9 @@
 #
 v:2:FRAME_ARGS_SKIP:CORE_ADDR:frame_args_skip::::0:-1
 f:2:FRAMELESS_FUNCTION_INVOCATION:int:frameless_function_invocation:struct frame_info *fi:fi:::generic_frameless_function_invocation_not::0
-f:2:FRAME_CHAIN:CORE_ADDR:frame_chain:struct frame_info *frame:frame::0:0
+F:2:FRAME_CHAIN:CORE_ADDR:frame_chain:struct frame_info *frame:frame::0:0
 F:2:FRAME_CHAIN_VALID:int:frame_chain_valid:CORE_ADDR chain, struct frame_info *thisframe:chain, thisframe::0:0
-f:2:FRAME_SAVED_PC:CORE_ADDR:frame_saved_pc:struct frame_info *fi:fi::0:0
+F:2:FRAME_SAVED_PC:CORE_ADDR:frame_saved_pc:struct frame_info *fi:fi::0:0
 f:2:FRAME_ARGS_ADDRESS:CORE_ADDR:frame_args_address:struct frame_info *fi:fi::0:get_frame_base::0
 f:2:FRAME_LOCALS_ADDRESS:CORE_ADDR:frame_locals_address:struct frame_info *fi:fi::0:get_frame_base::0
 f:2:SAVED_PC_AFTER_CALL:CORE_ADDR:saved_pc_after_call:struct frame_info *frame:frame::0:0

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