aboutsummaryrefslogtreecommitdiff
path: root/gdb/infcmd.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2023-09-29 14:24:38 -0400
committerSimon Marchi <simon.marchi@efficios.com>2023-10-10 10:44:35 -0400
commit99d9c3b92ca96a7425cbb6b1bf453ede9477a2ee (patch)
tree7f642c989f7c7b49bd40ab5873fc12be632e6ea9 /gdb/infcmd.c
parent72c4529c85907a5e1e04960ff1362a5a185553a0 (diff)
downloadgdb-99d9c3b92ca96a7425cbb6b1bf453ede9477a2ee.zip
gdb-99d9c3b92ca96a7425cbb6b1bf453ede9477a2ee.tar.gz
gdb-99d9c3b92ca96a7425cbb6b1bf453ede9477a2ee.tar.bz2
gdb: remove target_gdbarch
This function is just a wrapper around the current inferior's gdbarch. I find that having that wrapper just obscures where the arch is coming from, and that it's often used as "I don't know which arch to use so I'll use this magical target_gdbarch function that gets me an arch" when the arch should in fact come from something in the context (a thread, objfile, symbol, etc). I think that removing it and inlining `current_inferior ()->arch ()` everywhere will make it a bit clearer where that arch comes from and will trigger people into reflecting whether this is the right place to get the arch or not. Change-Id: I79f14b4e4934c88f91ca3a3155f5fc3ea2fadf6b Reviewed-By: John Baldwin <jhb@FreeBSD.org> Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r--gdb/infcmd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index fd85d27..cf8cd52 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -287,7 +287,7 @@ post_create_inferior (int from_tty)
/* If the solist is global across processes, there's no need to
refetch it here. */
- if (!gdbarch_has_global_solist (target_gdbarch ()))
+ if (!gdbarch_has_global_solist (current_inferior ()->arch ()))
solib_add (nullptr, 0, auto_solib_add);
}
}
@@ -2015,7 +2015,7 @@ info_program_command (const char *args, int from_tty)
target_files_info ();
gdb_printf (_("Program stopped at %s.\n"),
- paddress (target_gdbarch (), tp->stop_pc ()));
+ paddress (current_inferior ()->arch (), tp->stop_pc ()));
if (tp->control.stop_step)
gdb_printf (_("It stopped after being stepped.\n"));
else if (stat != 0)
@@ -2661,7 +2661,7 @@ attach_command (const char *args, int from_tty)
scoped_disable_commit_resumed disable_commit_resumed ("attaching");
- if (gdbarch_has_global_solist (target_gdbarch ()))
+ if (gdbarch_has_global_solist (current_inferior ()->arch ()))
/* Don't complain if all processes share the same symbol
space. */
;
@@ -2873,7 +2873,7 @@ detach_command (const char *args, int from_tty)
/* If the solist is global across inferiors, don't clear it when we
detach from a single inferior. */
- if (!gdbarch_has_global_solist (target_gdbarch ()))
+ if (!gdbarch_has_global_solist (current_inferior ()->arch ()))
no_shared_libraries (nullptr, from_tty);
if (deprecated_detach_hook)