2007-04-05 H.J. Lu <hongjiu.lu@intel.com>
[deliverable/binutils-gdb.git] / gdb / blockframe.c
index ba298c3f61fd0c984eefb00f08a795cbb8de6390..781a51402a6e1b38d8fd9c2cd35cd1032aa866d6 100644 (file)
@@ -1,8 +1,8 @@
 /* Get info from stack frames; convert between frames, blocks,
    functions and pc values.
 
-   Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
-   1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+   Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -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;
 }
This page took 0.027466 seconds and 4 git commands to generate.