From 94b24c74e8658826ae8a688c0eb59685a7db03b8 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 4 Dec 2020 16:43:54 -0500 Subject: gdb: pass inferior to get_linux_inferior_data Pass to get_linux_inferior_data the inferior for which we want to obtain the linux-specific data, rather than assuming the current inferior. This helps slightly reduce the diff in the upcoming main patch. Update the sole caller to pass the current inferior. gdb/ChangeLog: * linux-tdep.c (get_linux_inferior_data): Add inferior parameter. (linux_vsyscall_range): Pass current inferior. Change-Id: Ie4b61190e4a2e89b5b55a140cfecd4de66d92393 --- gdb/ChangeLog | 6 ++++++ gdb/linux-tdep.c | 10 ++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0fe4b27..f1a2922 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2020-12-04 Simon Marchi + * linux-tdep.c (get_linux_inferior_data): Add inferior + parameter. + (linux_vsyscall_range): Pass current inferior. + +2020-12-04 Simon Marchi + * infrun.c (displaced_step_prepare_throw): Change return type to displaced_step_prepare_status. (displaced_step_prepare): Likewise. diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index a651d1b..655a2c3 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -217,13 +217,11 @@ invalidate_linux_cache_inf (struct inferior *inf) valid INFO pointer. */ static struct linux_info * -get_linux_inferior_data (void) +get_linux_inferior_data (inferior *inf) { - struct linux_info *info; - struct inferior *inf = current_inferior (); + linux_info *info = linux_inferior_data.get (inf); - info = linux_inferior_data.get (inf); - if (info == NULL) + if (info == nullptr) info = linux_inferior_data.emplace (inf); return info; @@ -2407,7 +2405,7 @@ linux_vsyscall_range_raw (struct gdbarch *gdbarch, struct mem_range *range) static int linux_vsyscall_range (struct gdbarch *gdbarch, struct mem_range *range) { - struct linux_info *info = get_linux_inferior_data (); + struct linux_info *info = get_linux_inferior_data (current_inferior ()); if (info->vsyscall_range_p == 0) { -- cgit v1.1