aboutsummaryrefslogtreecommitdiff
path: root/gdb/arch-utils.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2024-03-21 11:15:56 -0600
committerTom Tromey <tromey@adacore.com>2024-03-22 13:17:43 -0600
commitc05dd51122c2d654031b04e02ad0ea5b53ffe5e2 (patch)
treedf883998b862b998f58d2b1edefa8bc96a84c725 /gdb/arch-utils.c
parentaf25053d5f9e1867bd0df1d5f168c803e1d7d015 (diff)
downloadgdb-c05dd51122c2d654031b04e02ad0ea5b53ffe5e2.zip
gdb-c05dd51122c2d654031b04e02ad0ea5b53ffe5e2.tar.gz
gdb-c05dd51122c2d654031b04e02ad0ea5b53ffe5e2.tar.bz2
Use std::string for disassembler options
I noticed that the disassembler_options code uses manual memory management. It seemed simpler to replace this with std::string. Approved-By: John Baldwin <jhb@FreeBSD.org>
Diffstat (limited to 'gdb/arch-utils.c')
-rw-r--r--gdb/arch-utils.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index ae3354f..d404d1f 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -1156,11 +1156,11 @@ pstring (const char *string)
}
static const char *
-pstring_ptr (char **string)
+pstring_ptr (std::string *string)
{
- if (string == NULL || *string == NULL)
+ if (string == nullptr)
return "(null)";
- return *string;
+ return string->c_str ();
}
/* Helper function to print a list of strings, represented as "const