diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2009-08-27 06:33:25 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2009-08-27 06:33:25 +0000 |
commit | 4e22772d17868466c3d941f888d255c667abc039 (patch) | |
tree | 3e73c7bff7e149d482f5dcdc66345b4eb3e7ae80 /gdb/varobj.c | |
parent | 573e8a1cd233066d864f0c0597df9e9cb689fae4 (diff) | |
download | gdb-4e22772d17868466c3d941f888d255c667abc039.zip gdb-4e22772d17868466c3d941f888d255c667abc039.tar.gz gdb-4e22772d17868466c3d941f888d255c667abc039.tar.bz2 |
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.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gdb/varobj.c b/gdb/varobj.c index fbe8ff8..603071f 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); |