return buf;
}
-struct linux_corefile_thread_data
-{
- linux_corefile_thread_data (struct gdbarch *gdbarch, bfd *obfd,
- gdb::unique_xmalloc_ptr<char> ¬e_data,
- int *note_size, gdb_signal stop_signal)
- : gdbarch (gdbarch), obfd (obfd), note_data (note_data),
- note_size (note_size), stop_signal (stop_signal)
- {}
-
- struct gdbarch *gdbarch;
- bfd *obfd;
- gdb::unique_xmalloc_ptr<char> ¬e_data;
- int *note_size;
- enum gdb_signal stop_signal;
-};
-
/* Records the thread's register state for the corefile note
section. */
static void
linux_corefile_thread (struct thread_info *info,
- struct linux_corefile_thread_data *args)
+ struct gdbarch *gdbarch, bfd *obfd,
+ gdb::unique_xmalloc_ptr<char> ¬e_data,
+ int *note_size, gdb_signal stop_signal)
{
- gcore_elf_build_thread_register_notes (args->gdbarch, info,
- args->stop_signal,
- args->obfd, &args->note_data,
- args->note_size);
+ gcore_elf_build_thread_register_notes (gdbarch, info, stop_signal, obfd,
+ ¬e_data, note_size);
/* Don't return anything if we got no register information above,
such a core file is useless. */
- if (args->note_data != NULL)
+ if (note_data != nullptr)
{
gdb::byte_vector siginfo_data
- = linux_get_siginfo_data (info, args->gdbarch);
+ = linux_get_siginfo_data (info, gdbarch);
if (!siginfo_data.empty ())
- args->note_data.reset (elfcore_write_note (args->obfd,
- args->note_data.release (),
- args->note_size,
- "CORE", NT_SIGINFO,
- siginfo_data.data (),
- siginfo_data.size ()));
+ note_data.reset (elfcore_write_note (obfd, note_data.release (),
+ note_size, "CORE", NT_SIGINFO,
+ siginfo_data.data (),
+ siginfo_data.size ()));
}
}
else
stop_signal = GDB_SIGNAL_0;
- linux_corefile_thread_data thread_args (gdbarch, obfd, note_data, note_size,
- stop_signal);
-
if (signalled_thr != nullptr)
- linux_corefile_thread (signalled_thr, &thread_args);
+ linux_corefile_thread (signalled_thr, gdbarch, obfd, note_data, note_size,
+ stop_signal);
for (thread_info *thr : current_inferior ()->non_exited_threads ())
{
if (thr == signalled_thr)
continue;
- linux_corefile_thread (thr, &thread_args);
+ linux_corefile_thread (thr, gdbarch, obfd, note_data, note_size,
+ stop_signal);
}
if (!note_data)