From c951836e489669c9a554de0b27f738743dcf869e Mon Sep 17 00:00:00 2001 From: Keith Seitz Date: Wed, 3 Feb 1999 21:39:02 +0000 Subject: [PATCH] * gdbtk-variable.c (variable_create): Add parentheses to the name so that casts do not confuse the expression parser. --- gdb/gdbtk-variable.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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) { -- 2.30.2