aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2024-04-17 16:55:28 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2024-04-18 10:31:54 -0400
commit523e454fab831e07c83a648c5d07370375a1c376 (patch)
treeb8d5751d5d9215243ae787c6da707f246f0b65bb /gdb
parent31d5afc19d98869aa13c3197f55b8a208fd19da2 (diff)
downloadgdb-523e454fab831e07c83a648c5d07370375a1c376.zip
gdb-523e454fab831e07c83a648c5d07370375a1c376.tar.gz
gdb-523e454fab831e07c83a648c5d07370375a1c376.tar.bz2
gdbsupport: constify some return values in print-utils.{h,cc}
There is no reason the callers of these functions need to change the returned string, so change the `char *` return types to `const char *`. Update a few callers to also use `const char *`. Change-Id: I94adff574d5e1b326e8cc688cf1817a15b408b96 Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb')
-rw-r--r--gdb/dwarf2/types.h2
-rw-r--r--gdb/symtab.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/gdb/dwarf2/types.h b/gdb/dwarf2/types.h
index 9db5c63..f0b9feb 100644
--- a/gdb/dwarf2/types.h
+++ b/gdb/dwarf2/types.h
@@ -31,7 +31,7 @@ DEFINE_OFFSET_TYPE (cu_offset, unsigned int);
section. */
DEFINE_OFFSET_TYPE (sect_offset, uint64_t);
-static inline char *
+static inline const char *
sect_offset_str (sect_offset offset)
{
return hex_string (to_underlying (offset));
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 86603df..d931b3a 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -5177,7 +5177,7 @@ static void
print_msymbol_info (struct bound_minimal_symbol msymbol)
{
struct gdbarch *gdbarch = msymbol.objfile->arch ();
- char *tmp;
+ const char *tmp;
if (gdbarch_addr_bit (gdbarch) <= 32)
tmp = hex_string_custom (msymbol.value_address ()