aboutsummaryrefslogtreecommitdiff
path: root/gdb/varobj.c
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2008-02-04 06:14:20 +0000
committerVladimir Prus <vladimir@codesourcery.com>2008-02-04 06:14:20 +0000
commitae7d22a6f2f59251b85ef5655b800f2dfe2dfbee (patch)
treeb1e3d8265daabef973907fb9bd9eac2eeabe1082 /gdb/varobj.c
parent7cc77b5a09935e3ca9448e9c18dc9cb71e75b654 (diff)
downloadgdb-ae7d22a6f2f59251b85ef5655b800f2dfe2dfbee.zip
gdb-ae7d22a6f2f59251b85ef5655b800f2dfe2dfbee.tar.gz
gdb-ae7d22a6f2f59251b85ef5655b800f2dfe2dfbee.tar.bz2
Update stored rendition of varobj value when format changes.
* varobj.c (varobj_set_display_format): Recomputed print_value. (c_value_of_variable): Return print_value.
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 468beea..258e0bf 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -673,6 +673,13 @@ varobj_set_display_format (struct varobj *var,
var->format = variable_default_display (var);
}
+ if (varobj_value_is_changeable_p (var)
+ && var->value && !value_lazy (var->value))
+ {
+ free (var->print_value);
+ var->print_value = value_get_print_value (var->value, var->format);
+ }
+
return var->format;
}
@@ -2245,7 +2252,7 @@ c_value_of_variable (struct varobj *var)
gdb_assert (varobj_value_is_changeable_p (var));
gdb_assert (!value_lazy (var->value));
- return value_get_print_value (var->value, var->format);
+ return strdup (var->print_value);
}
}
}