From 23fdd69e42180578b3e15ba8f053fadde965bfe8 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Sun, 3 Sep 2017 10:23:31 +0200 Subject: Make target_waitstatus_to_string return an std::string A quite straightforward change. It does "fix" leaks in record-btrace.c, although since this is only used in debug printing code, it has no real world impact. gdb/ChangeLog: * target/waitstatus.h (target_waitstatus_to_string): Change return type to std::string. * target/waitstatus.c (target_waitstatus_to_string): Return std::string. * target.h (target_waitstatus_to_string): Remove declaration. * infrun.c (resume, clear_proceed_status_thread, print_target_wait_results, do_target_wait, save_waitstatus, stop_all_threads): Adjust. * record-btrace.c (record_btrace_wait): Adjust. * target-debug.h (target_debug_print_struct_target_waitstatus_p): Adjust. gdb/gdbserver/ChangeLog: * linux-low.c (linux_wait_1): Adjust. * server.c (queue_stop_reply_callback): Adjust. --- gdb/target/waitstatus.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'gdb/target/waitstatus.h') diff --git a/gdb/target/waitstatus.h b/gdb/target/waitstatus.h index 52be390..8eee198 100644 --- a/gdb/target/waitstatus.h +++ b/gdb/target/waitstatus.h @@ -145,8 +145,7 @@ enum target_stop_reason /* Prototypes */ -/* Return a pretty printed form of target_waitstatus. - Space for the result is malloc'd, caller must free. */ -extern char *target_waitstatus_to_string (const struct target_waitstatus *); +/* Return a pretty printed form of target_waitstatus. */ +std::string target_waitstatus_to_string (const struct target_waitstatus *); #endif /* WAITSTATUS_H */ -- cgit v1.1