From: Nick Roberts Date: Mon, 1 Jan 2007 12:01:04 +0000 (+0000) Subject: Include block.h. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d235392457f8ee97150d389ff5c53dcbe4616319;p=binutils-gdb.git Include block.h. (c_value_of_root): Check scope within nested statements. --- diff --git a/gdb/varobj.c b/gdb/varobj.c index 39760ad9462..92d43cba94a 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)