aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorNick Roberts <nickrob@snap.net.nz>2007-01-01 12:01:04 +0000
committerNick Roberts <nickrob@snap.net.nz>2007-01-01 12:01:04 +0000
commitd235392457f8ee97150d389ff5c53dcbe4616319 (patch)
tree8a511b0f8c01757d999f0c6371c1016301d9e6b1 /gdb
parentab9245edd225cb9da01a8566ca75121c7c4061b5 (diff)
downloadgdb-d235392457f8ee97150d389ff5c53dcbe4616319.zip
gdb-d235392457f8ee97150d389ff5c53dcbe4616319.tar.gz
gdb-d235392457f8ee97150d389ff5c53dcbe4616319.tar.bz2
Include block.h.
(c_value_of_root): Check scope within nested statements.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/varobj.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gdb/varobj.c b/gdb/varobj.c
index 39760ad..92d43cb 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -26,6 +26,7 @@
#include "language.h"
#include "wrapper.h"
#include "gdbcmd.h"
+#include "block.h"
#include "gdb_assert.h"
#include "gdb_string.h"
@@ -1958,8 +1959,14 @@ c_value_of_root (struct varobj **var_handle)
fi = frame_find_by_id (var->root->frame);
within_scope = fi != NULL;
/* FIXME: select_frame could fail */
- if (within_scope)
- select_frame (fi);
+ if (fi)
+ {
+ CORE_ADDR pc = get_frame_pc (fi);
+ if (pc < BLOCK_START (var->root->valid_block) ||
+ pc >= BLOCK_END (var->root->valid_block))
+ within_scope = 0;
+ select_frame (fi);
+ }
}
if (within_scope)