summaryrefslogtreecommitdiff
path: root/gdb/varobj.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2009-08-27 06:33:25 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2009-08-27 06:33:25 +0000
commitd2a3fbd7a64f89c9f3f47b5dcba036a48119976b (patch)
tree9f5f6aac0dcfd5d8f43ec1da4f596a0732f3615c /gdb/varobj.c
parent4cc8a5133e6b5c72da5870cb36ff022c35541dc8 (diff)
downloadgdb-d2a3fbd7a64f89c9f3f47b5dcba036a48119976b.tar.gz
gdb/
* varobj.c (varobj_create): Error if the specified frame was not found and it is needed. gdb/testsuite/ * gdb.mi/mi2-var-cmd.exp (create variable with invalid FRAME-ADDR): New.
Diffstat (limited to 'gdb/varobj.c')
-rw-r--r--gdb/varobj.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gdb/varobj.c b/gdb/varobj.c
index fbe8ff8e76c..603071f8976 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -565,8 +565,15 @@ varobj_create (char *objname,
we must select the appropriate frame before parsing
the expression, otherwise the value will not be current.
Since select_frame is so benign, just call it for all cases. */
- if (innermost_block && fi != NULL)
+ if (innermost_block)
{
+ /* User could specify explicit FRAME-ADDR which was not found but
+ EXPRESSION is frame specific and we would not be able to evaluate
+ it correctly next time. With VALID_BLOCK set we must also set
+ FRAME and THREAD_ID. */
+ if (fi == NULL)
+ error (_("Failed to find the specified frame"));
+
var->root->frame = get_frame_id (fi);
var->root->thread_id = pid_to_thread_id (inferior_ptid);
old_fi = get_selected_frame (NULL);