From 631b0ed0204da026f48ba477bdb482c425d0d695 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Fri, 6 Oct 2006 02:01:34 +0000 Subject: [PATCH] * blockframe.c (block_innermost_frame): Rewrite frame search logic. --- gdb/ChangeLog | 4 ++++ gdb/blockframe.c | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 403bbcbd0ae..f5697bce3cf 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2006-10-05 Joel Brobecker + + * blockframe.c (block_innermost_frame): Rewrite frame search logic. + 2006-10-05 Daniel Jacobowitz * Makefile.in (gdb_expat_h): New. diff --git a/gdb/blockframe.c b/gdb/blockframe.c index ba298c3f61f..8dfa0069a10 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; } -- 2.30.2