From 27b1f19f8f5cc46faba4bb2142547df074a82a29 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 29 Sep 2023 14:24:35 -0400 Subject: gdb: add inferior::{arch, set_arch} Make the inferior's gdbarch field private, and add getters and setters. This helped me by allowing putting breakpoints on set_arch to know when the inferior's arch was set. A subsequent patch in this series also adds more things in set_arch. Change-Id: I0005bd1ef4cd6b612af501201cec44e457998eec Reviewed-By: John Baldwin Approved-By: Andrew Burgess --- gdb/infrun.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gdb/infrun.c') diff --git a/gdb/infrun.c b/gdb/infrun.c index 4730d29..784f0b9 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -505,7 +505,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \ child_inf->attach_flag = parent_inf->attach_flag; copy_terminal_info (child_inf, parent_inf); - child_inf->gdbarch = parent_inf->gdbarch; + child_inf->set_arch (parent_inf->arch ()); child_inf->tdesc_info = parent_inf->tdesc_info; child_inf->symfile_flags = SYMFILE_NO_READ; @@ -580,7 +580,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \ child_inf->attach_flag = parent_inf->attach_flag; copy_terminal_info (child_inf, parent_inf); - child_inf->gdbarch = parent_inf->gdbarch; + child_inf->set_arch (parent_inf->arch ()); child_inf->tdesc_info = parent_inf->tdesc_info; if (has_vforked) @@ -5821,7 +5821,7 @@ handle_inferior_event (struct execution_control_state *ecs) } else { - struct gdbarch *gdbarch = current_inferior ()->gdbarch; + struct gdbarch *gdbarch = current_inferior ()->arch (); if (gdbarch_gdb_signal_to_target_p (gdbarch)) { @@ -9847,7 +9847,7 @@ namespace selftests static void infrun_thread_ptid_changed () { - gdbarch *arch = current_inferior ()->gdbarch; + gdbarch *arch = current_inferior ()->arch (); /* The thread which inferior_ptid represents changes ptid. */ { -- cgit v1.1