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/frame] Allow the legacy frame


Hello,

With the attached assertions removed, a target with _zero_ frame code is able to do simple things such as examine registers, set breakpoints, single step, .... Again making it easier to bring up a new target (or migrate an old one).

committed,
Andrew
2004-02-08  Andrew Cagney  <cagney@redhat.com>

	* frame.c (legacy_saved_regs_this_id): Return a null frame ID.
	(get_frame_id): Allow the UNKNOWN_FRAME.
	(frame_register_unwind, get_frame_type): Ditto.

Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.157
diff -u -r1.157 frame.c
--- frame.c	8 Feb 2004 18:53:15 -0000	1.157
+++ frame.c	8 Feb 2004 19:31:51 -0000
@@ -234,7 +234,6 @@
 	     directly.  Unfortunately, legacy code, called by
 	     legacy_get_prev_frame, explicitly set the frames type
 	     using the method deprecated_set_frame_type().  */
-	  gdb_assert (fi->unwind->type != UNKNOWN_FRAME);
 	  fi->type = fi->unwind->type;
 	}
       /* Find THIS frame's ID.  */
@@ -538,7 +537,6 @@
 	 directly.  Unfortunately, legacy code, called by
 	 legacy_get_prev_frame, explicitly set the frames type using
 	 the method deprecated_set_frame_type().  */
-      gdb_assert (frame->unwind->type != UNKNOWN_FRAME);
       frame->type = frame->unwind->type;
     }
 
@@ -1029,9 +1027,12 @@
 			   void **this_prologue_cache,
 			   struct frame_id *id)
 {
-  /* legacy_get_prev_frame() always sets ->this_id.p, hence this is
-     never needed.  */
-  internal_error (__FILE__, __LINE__, "legacy_saved_regs_this_id() called");
+  /* A developer is trying to bring up a new architecture, help them
+     by providing a default unwinder that refuses to unwind anything
+     (the ID is always NULL).  In the case of legacy code,
+     legacy_get_prev_frame() will have previously set ->this_id.p, so
+     this code won't be called.  */
+  (*id) = null_frame_id;
 }
 	
 const struct frame_unwind legacy_saved_regs_unwinder = {
@@ -2133,7 +2134,6 @@
 	 directly.  Unfortunately, legacy code, called by
 	 legacy_get_prev_frame, explicitly set the frames type using
 	 the method deprecated_set_frame_type().  */
-      gdb_assert (frame->unwind->type != UNKNOWN_FRAME);
       frame->type = frame->unwind->type;
     }
   if (frame->type == UNKNOWN_FRAME)

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