From: Keith Seitz Date: Wed, 3 Feb 1999 21:39:02 +0000 (+0000) Subject: * gdbtk-variable.c (variable_create): Add parentheses to the name X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c951836e489669c9a554de0b27f738743dcf869e;p=binutils-gdb.git * gdbtk-variable.c (variable_create): Add parentheses to the name so that casts do not confuse the expression parser. --- diff --git a/gdb/gdbtk-variable.c b/gdb/gdbtk-variable.c index 5a3220d63f3..c7fc73acbe0 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) {