aboutsummaryrefslogtreecommitdiff
path: root/gdb/target-debug.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2020-10-22 12:58:11 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2020-10-22 12:58:21 -0400
commit24f5300a537e0a8b31ec0391e45babf8a160ce56 (patch)
tree97af2a3c43eae11d3dcb217e67bf669969d3a6f8 /gdb/target-debug.h
parent5fb4027fae1839cabbea75112c31bd89d46d2af0 (diff)
downloadgdb-24f5300a537e0a8b31ec0391e45babf8a160ce56.zip
gdb-24f5300a537e0a8b31ec0391e45babf8a160ce56.tar.gz
gdb-24f5300a537e0a8b31ec0391e45babf8a160ce56.tar.bz2
gdb: make target_ops::make_corefile_notes return a unique ptr
Since we converted gdbarch_make_corefile_notes to returning a gdb::unique_xmalloc_ptr, I figured it would make sense to converted target_ops::make_corefile_notes as well. The only implementation of that is in procfs.c, and it should ideally be re-written as a gdbarch method (see comment in write_gcore_file_1), but in the mean time I guess it doesn't hurt to throw some unique pointer at it. I tested that it builds on Solaris 11 (gcc compile farm machine gcc211), but I am not able to test it, because I can't get GDB to start a process (I'll look at that separately). gdb/ChangeLog: * target.h (struct target_ops) <make_corefile_notes>: Change return type to unique pointer. * target.c (dummy_make_corefile_notes): Likewise. * exec.c (struct exec_target) <make_corefile_notes>: Likewise. (exec_target::make_corefile_notes): Likewise. * procfs.c (class procfs_target) <make_corefile_notes>: Likewise. (procfs_do_thread_registers): Adjust to unique pointer. (struct procfs_corefile_thread_data): Add constructor. <note_data>: Change type to unique pointer. (procfs_corefile_thread_callback): Adjust to unique pointer. (procfs_target::make_corefile_notes): Change return type to unique pointer. * target-delegates.c: Re-generate. * gcore.c (write_gcore_file_1): Adjust. * target-debug.h (target_debug_print_gdb_unique_xmalloc_ptr_char): New. Change-Id: I768fb17ac0f7adc67d2fe95e952c784fe0ac37ab
Diffstat (limited to 'gdb/target-debug.h')
-rw-r--r--gdb/target-debug.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/gdb/target-debug.h b/gdb/target-debug.h
index 65a14c4..12818da 100644
--- a/gdb/target-debug.h
+++ b/gdb/target-debug.h
@@ -188,6 +188,8 @@
target_debug_do_print ((X).c_str ())
#define target_debug_print_gdb_byte_vector(X) \
target_debug_do_print (host_address_to_string (X.data ()))
+#define target_debug_print_gdb_unique_xmalloc_ptr_char(X) \
+ target_debug_do_print (X.get ())
static void
target_debug_print_struct_target_waitstatus_p (struct target_waitstatus *status)