diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2018-08-07 21:37:40 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2018-08-07 21:38:27 -0400 |
commit | 09ce46f230fee766c386384cd1f5672d12fde276 (patch) | |
tree | 70c4f15a8d7f68622137032f6250cc971119b1dd /gdb/linux-nat.c | |
parent | b825f3a90e33ab6f333d12d676d51419f8fed77b (diff) | |
download | gdb-09ce46f230fee766c386384cd1f5672d12fde276.zip gdb-09ce46f230fee766c386384cd1f5672d12fde276.tar.gz gdb-09ce46f230fee766c386384cd1f5672d12fde276.tar.bz2 |
Make target_options_to_string return an std::string
Return an std::string instead of a char *, saving some manual freeing.
I only manually tested with "set debug target 1" and "set debug lin-lwp
1", since this only deals with debug output.
gdb/ChangeLog:
* target.h (target_options_to_string): Return an std::string.
* target.c (str_comma_list_concat_elem): Return void, use
std::string.
(do_option): Likewise.
(target_options_to_string): Return an std::string.
* linux-nat.c (linux_nat_target::wait): Adjust.
* target-debug.h (target_debug_print_options): Adjust.
Diffstat (limited to 'gdb/linux-nat.c')
-rw-r--r-- | gdb/linux-nat.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index d2c88ad..64015e7 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -3555,14 +3555,11 @@ linux_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus, if (debug_linux_nat) { - char *options_string; - - options_string = target_options_to_string (target_options); + std::string options_string = target_options_to_string (target_options); fprintf_unfiltered (gdb_stdlog, "linux_nat_wait: [%s], [%s]\n", target_pid_to_str (ptid), - options_string); - xfree (options_string); + options_string.c_str ()); } /* Flush the async file first. */ |