aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Seitz <keiths@cygnus>1999-02-03 21:39:02 +0000
committerKeith Seitz <keiths@cygnus>1999-02-03 21:39:02 +0000
commitc951836e489669c9a554de0b27f738743dcf869e (patch)
tree1a1d081dccd86f0a49b3c0f2b2bb5a2b93683391
parentc7fde2d9017c90e76023fa492c9d824fd44eb10a (diff)
downloadgdb-c951836e489669c9a554de0b27f738743dcf869e.zip
gdb-c951836e489669c9a554de0b27f738743dcf869e.tar.gz
gdb-c951836e489669c9a554de0b27f738743dcf869e.tar.bz2
* gdbtk-variable.c (variable_create): Add parentheses to the name
so that casts do not confuse the expression parser.
-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)
{