aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-tdep.c
diff options
context:
space:
mode:
authorLuis Machado <luis.machado@arm.com>2023-09-11 10:39:48 +0100
committerLuis Machado <luis.machado@arm.com>2023-10-04 16:23:40 +0100
commit147fa85a600960a1e403bbed4cb76c9d7d8ab6c5 (patch)
tree7d8c60b8351115de6110be78a20c98e9f88d799c /gdb/linux-tdep.c
parente58e9cc14e4533b2e463f13db518c4c735d02fcf (diff)
downloadbinutils-147fa85a600960a1e403bbed4cb76c9d7d8ab6c5.zip
binutils-147fa85a600960a1e403bbed4cb76c9d7d8ab6c5.tar.gz
binutils-147fa85a600960a1e403bbed4cb76c9d7d8ab6c5.tar.bz2
Get rid of linux-core-thread-data
This struct type seems to have been used in the past as a callback parameter. Now it seems that case is no longer true, so we can simplify things by passing the individual parameters linux_core_thread_data encapsulates directly to the functions. This is just a cleanup before the next change. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/linux-tdep.c')
-rw-r--r--gdb/linux-tdep.c49
1 files changed, 15 insertions, 34 deletions
diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c
index 98658fa..33f84c8 100644
--- a/gdb/linux-tdep.c
+++ b/gdb/linux-tdep.c
@@ -1820,47 +1820,29 @@ linux_get_siginfo_data (thread_info *thread, struct gdbarch *gdbarch)
return buf;
}
-struct linux_corefile_thread_data
-{
- linux_corefile_thread_data (struct gdbarch *gdbarch, bfd *obfd,
- gdb::unique_xmalloc_ptr<char> &note_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> &note_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> &note_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,
+ &note_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 ()));
}
}
@@ -2095,17 +2077,16 @@ linux_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_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)