aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/procfs.c18
2 files changed, 13 insertions, 11 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index edb60f7..42995df 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2018-06-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * procfs.c (_initialize_procfs): Use add_inf_child_target.
+ (procfs_target::make_corefile_notes): Adjust to new
+ target_read_alloc return type.
+
2018-06-12 Andrew Burgess <andrew.burgess@embecosm.com>
Stephen Roberts <stephen.roberts@arm.com>
diff --git a/gdb/procfs.c b/gdb/procfs.c
index 082f5d4..8b09eca 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -3731,7 +3731,7 @@ _initialize_procfs (void)
add_com ("proc-untrace-exit", no_class, proc_untrace_sysexit_cmd,
_("Cancel a trace of exits from the syscall."));
- add_target (&the_procfs_target);
+ add_inf_child_target (&the_procfs_target);
}
/* =================== END, GDB "MODULE" =================== */
@@ -3851,8 +3851,6 @@ procfs_target::make_corefile_notes (bfd *obfd, int *note_size)
char *note_data = NULL;
char *inf_args;
struct procfs_corefile_thread_data thread_args;
- gdb_byte *auxv;
- int auxv_len;
enum gdb_signal stop_signal;
if (get_exec_file (0))
@@ -3894,14 +3892,12 @@ procfs_target::make_corefile_notes (bfd *obfd, int *note_size)
&thread_args);
note_data = thread_args.note_data;
- auxv_len = target_read_alloc (current_top_target (), TARGET_OBJECT_AUXV,
- NULL, &auxv);
- if (auxv_len > 0)
- {
- note_data = elfcore_write_note (obfd, note_data, note_size,
- "CORE", NT_AUXV, auxv, auxv_len);
- xfree (auxv);
- }
+ gdb::optional<gdb::byte_vector> auxv =
+ target_read_alloc (current_top_target (), TARGET_OBJECT_AUXV, NULL);
+ if (auxv && !auxv->empty ())
+ note_data = elfcore_write_note (obfd, note_data, note_size,
+ "CORE", NT_AUXV, auxv->data (),
+ auxv->size ());
return note_data;
}