From baf20f7627811d7bd96806ee5ff756899159fd70 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 10 Nov 2020 15:46:17 -0700 Subject: [PATCH] Make internalvar_name return a const char * This changes internalvar_name to return a const char *. gdb/ChangeLog 2020-11-10 Tom Tromey * value.h (internalvar_name): Update. * value.c (internalvar_name): Make return type const. --- gdb/ChangeLog | 5 +++++ gdb/value.c | 2 +- gdb/value.h | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d275ee7b3bc..84fa1870604 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2020-11-10 Tom Tromey + + * value.h (internalvar_name): Update. + * value.c (internalvar_name): Make return type const. + 2020-11-10 Tom Tromey * ax-gdb.c (gen_struct_elt_for_reference, gen_namespace_elt) diff --git a/gdb/value.c b/gdb/value.c index 7db3d3ecff2..c9907fa9333 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -2379,7 +2379,7 @@ clear_internalvar (struct internalvar *var) var->kind = INTERNALVAR_VOID; } -char * +const char * internalvar_name (const struct internalvar *var) { return var->name; diff --git a/gdb/value.h b/gdb/value.h index 644501ff9e8..bc57f4f9012 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -1122,7 +1122,7 @@ extern void print_variable_and_value (const char *name, extern void typedef_print (struct type *type, struct symbol *news, struct ui_file *stream); -extern char *internalvar_name (const struct internalvar *var); +extern const char *internalvar_name (const struct internalvar *var); extern void preserve_values (struct objfile *); -- 2.30.2