* frame.c (frame_pop): Check to see whether there's a frame to
authorNathan Froyd <froydnj@codesourcery.com>
Tue, 13 Mar 2007 14:05:25 +0000 (14:05 +0000)
committerNathan Froyd <froydnj@codesourcery.com>
Tue, 13 Mar 2007 14:05:25 +0000 (14:05 +0000)
which we can pop first.

gdb/ChangeLog
gdb/frame.c

index 2a3985cc253dddfacfa06cf26f6784b1acf841a0..3766bc1643e560a59eed2b609074861800500540 100644 (file)
@@ -1,3 +1,8 @@
+2007-03-13  Nathan Froyd  <froydnj@codesourcery.com>
+
+       * frame.c (frame_pop): Check to see whether there's a frame to
+       which we can pop first.
+
 2007-03-13  Nathan Froyd  <froydnj@codesourcery.com>
 
        * MAINTAINERS (Write After Approval): Add myself.
index a40bbb219c31f2b6dfd73dad0e908dac7256e32e..8a14b29ede374f87b1da87d6f9d68683983478cd 100644 (file)
@@ -514,13 +514,22 @@ frame_save_as_regcache (struct frame_info *this_frame)
 void
 frame_pop (struct frame_info *this_frame)
 {
+  struct frame_info *prev_frame;
+  struct regcache *scratch;
+  struct cleanup *cleanups;
+
+  /* Ensure that we have a frame to pop to.  */
+  prev_frame = get_prev_frame_1 (this_frame);
+
+  if (!prev_frame)
+    error (_("Cannot pop the initial frame."));
+
   /* Make a copy of all the register values unwound from this frame.
      Save them in a scratch buffer so that there isn't a race between
      trying to extract the old values from the current_regcache while
      at the same time writing new values into that same cache.  */
-  struct regcache *scratch
-    = frame_save_as_regcache (get_prev_frame_1 (this_frame));
-  struct cleanup *cleanups = make_cleanup_regcache_xfree (scratch);
+  scratch = frame_save_as_regcache (prev_frame);
+  cleanups = make_cleanup_regcache_xfree (scratch);
 
   /* FIXME: cagney/2003-03-16: It should be possible to tell the
      target's register cache that it is about to be hit with a burst
This page took 0.041086 seconds and 4 git commands to generate.