* blockframe.c (block_innermost_frame): Rewrite frame search logic.
authorJoel Brobecker <brobecker@gnat.com>
Fri, 6 Oct 2006 02:01:34 +0000 (02:01 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Fri, 6 Oct 2006 02:01:34 +0000 (02:01 +0000)
gdb/ChangeLog
gdb/blockframe.c

index 403bbcbd0aec732e6cee4d906d89e671cf834996..f5697bce3cf01b235cc8b6ed576cef815943416a 100644 (file)
@@ -1,3 +1,7 @@
+2006-10-05  Joel Brobecker  <brobecker@adacore.com>
+
+        * blockframe.c (block_innermost_frame): Rewrite frame search logic.
+
 2006-10-05  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * Makefile.in (gdb_expat_h): New.
index ba298c3f61fd0c984eefb00f08a795cbb8de6390..8dfa0069a10f800ae4bffe4fbcc4f1b7ba7a0f62 100644 (file)
@@ -358,14 +358,15 @@ block_innermost_frame (struct block *block)
   start = BLOCK_START (block);
   end = BLOCK_END (block);
 
-  frame = NULL;
-  while (1)
+  frame = get_current_frame ();
+  while (frame != NULL)
     {
-      frame = get_prev_frame (frame);
-      if (frame == NULL)
-       return NULL;
       calling_pc = get_frame_address_in_block (frame);
       if (calling_pc >= start && calling_pc < end)
        return frame;
+
+      frame = get_prev_frame (frame);
     }
+
+  return NULL;
 }