diff options
author | Tom Tromey <tromey@adacore.com> | 2024-03-21 11:15:56 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2024-03-22 13:17:43 -0600 |
commit | c05dd51122c2d654031b04e02ad0ea5b53ffe5e2 (patch) | |
tree | df883998b862b998f58d2b1edefa8bc96a84c725 /gdb/arch-utils.c | |
parent | af25053d5f9e1867bd0df1d5f168c803e1d7d015 (diff) | |
download | gdb-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.c | 6 |
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 |