aboutsummaryrefslogtreecommitdiff
path: root/gdb/blockframe.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2006-10-06 02:01:34 +0000
committerJoel Brobecker <brobecker@gnat.com>2006-10-06 02:01:34 +0000
commit631b0ed0204da026f48ba477bdb482c425d0d695 (patch)
tree8e986f434d4f327444564868b558b398fd44cbf7 /gdb/blockframe.c
parent9ad41fe1d04ec50880f5484c9b9109782c7831f9 (diff)
downloadgdb-631b0ed0204da026f48ba477bdb482c425d0d695.zip
gdb-631b0ed0204da026f48ba477bdb482c425d0d695.tar.gz
gdb-631b0ed0204da026f48ba477bdb482c425d0d695.tar.bz2
* blockframe.c (block_innermost_frame): Rewrite frame search logic.
Diffstat (limited to 'gdb/blockframe.c')
-rw-r--r--gdb/blockframe.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index ba298c3..8dfa006 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -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;
}