From e39dfb366e648a6e1ccc6a2ed274df180d6d6ed3 Mon Sep 17 00:00:00 2001 From: vprus Date: Sun, 1 Apr 2007 15:44:54 +0000 Subject: [PATCH] * varobj.c (varobj_create): Keep varobj value NULL when evaluating the type. --- gdb/ChangeLog | 5 +++++ gdb/varobj.c | 14 +++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index eac38cdaa1..20f2a2d50f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2007-04-01 Vladimir Prus + + * varobj.c (varobj_create): Keep varobj value + NULL when evaluating the type. + 2007-03-31 Pedro Alves * NEWS: Mention new Windows CE support. diff --git a/gdb/varobj.c b/gdb/varobj.c index 7b2bfb838d..1d8c8e8af5 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 */ -- 2.11.0