diff options
author | Vladimir Prus <vladimir@codesourcery.com> | 2007-04-01 15:44:54 +0000 |
---|---|---|
committer | Vladimir Prus <vladimir@codesourcery.com> | 2007-04-01 15:44:54 +0000 |
commit | e55dccf02d210cedb1d3fbf8a490bfc1b009d32f (patch) | |
tree | f553ee635c24cd00793188c004f8e87696851de8 /gdb/varobj.c | |
parent | a73bafbcaa287d25ca811a4bcc01e9bde25b82e9 (diff) | |
download | gdb-e55dccf02d210cedb1d3fbf8a490bfc1b009d32f.zip gdb-e55dccf02d210cedb1d3fbf8a490bfc1b009d32f.tar.gz gdb-e55dccf02d210cedb1d3fbf8a490bfc1b009d32f.tar.bz2 |
* varobj.c (varobj_create): Keep varobj value
NULL when evaluating the type.
Diffstat (limited to 'gdb/varobj.c')
-rw-r--r-- | gdb/varobj.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gdb/varobj.c b/gdb/varobj.c index 7b2bfb8..1d8c8e8 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -433,7 +433,7 @@ varobj_create (char *objname, { char *p; enum varobj_languages lang; - struct value *value; + struct value *value = NULL; /* Parse and evaluate the expression, filling in as much of the variable's data as possible */ @@ -495,11 +495,15 @@ varobj_create (char *objname, If evaluate_expression succeeds we got the value we wanted. But if it fails, we still go on with a call to evaluate_type() */ if (!gdb_evaluate_expression (var->root->exp, &value)) - /* Error getting the value. Try to at least get the - right type. */ - value = evaluate_type (var->root->exp); + { + /* Error getting the value. Try to at least get the + right type. */ + struct value *type_only_value = evaluate_type (var->root->exp); + var->type = value_type (type_only_value); + } + else + var->type = value_type (value); - var->type = value_type (value); install_new_value (var, value, 1 /* Initial assignment */); /* Set language info */ |