aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/gdbtk-variable.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gdb/gdbtk-variable.c b/gdb/gdbtk-variable.c
index 5a3220d..c7fc73a 100644
--- a/gdb/gdbtk-variable.c
+++ b/gdb/gdbtk-variable.c
@@ -499,7 +499,14 @@ variable_create (interp, objc, objv)
}
/* Create the variable */
- var = create_variable (name, name, pc);
+ {
+ /* Add parentheses to the name so that casts do
+ not confuse it. */
+ char *newname = (char *) xmalloc (strlen (name) + 2);
+ sprintf (newname, "(%s)", name);
+ var = create_variable (name, newname, pc);
+ FREEIF (newname);
+ }
if (var != NULL)
{