gdb: remove target_gdbarch
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 29 Sep 2023 18:24:38 +0000 (14:24 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 10 Oct 2023 14:44:35 +0000 (10:44 -0400)
commit99d9c3b92ca96a7425cbb6b1bf453ede9477a2ee
tree7f642c989f7c7b49bd40ab5873fc12be632e6ea9
parent72c4529c85907a5e1e04960ff1362a5a185553a0
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>
93 files changed:
gdb/aarch64-linux-nat.c
gdb/ada-lang.c
gdb/ada-tasks.c
gdb/aix-thread.c
gdb/arc-tdep.c
gdb/arch-utils.c
gdb/arm-tdep.c
gdb/auxv.c
gdb/break-catch-syscall.c
gdb/breakpoint.c
gdb/bsd-uthread.c
gdb/btrace.c
gdb/cli/cli-dump.c
gdb/compile/compile-c-symbols.c
gdb/compile/compile-cplus-symbols.c
gdb/compile/compile-object-load.c
gdb/corefile.c
gdb/corelow.c
gdb/cp-namespace.c
gdb/cp-support.c
gdb/d-namespace.c
gdb/darwin-nat-info.c
gdb/dcache.c
gdb/disasm.c
gdb/elfread.c
gdb/fbsd-nat.c
gdb/filesystem.c
gdb/frame-unwind.c
gdb/gcore.c
gdb/gdbarch.h
gdb/gnu-nat.c
gdb/i386-darwin-nat.c
gdb/i386-tdep.c
gdb/ia64-vms-tdep.c
gdb/infcmd.c
gdb/infrun.c
gdb/jit.c
gdb/linux-nat.c
gdb/memattr.c
gdb/mep-tdep.c
gdb/mi/mi-interp.c
gdb/mi/mi-main.c
gdb/microblaze-tdep.c
gdb/mips-linux-nat.c
gdb/mips-linux-tdep.c
gdb/mips-tdep.c
gdb/moxie-tdep.c
gdb/msp430-tdep.c
gdb/netbsd-nat.c
gdb/nto-procfs.c
gdb/nto-tdep.c
gdb/ppc-linux-nat.c
gdb/printcmd.c
gdb/process-stratum-target.h
gdb/procfs.c
gdb/progspace.c
gdb/python/py-finishbreakpoint.c
gdb/python/py-inferior.c
gdb/python/py-objfile.c
gdb/python/py-progspace.c
gdb/python/py-record-btrace.c
gdb/python/python.c
gdb/ravenscar-thread.c
gdb/record-btrace.c
gdb/record-full.c
gdb/regcache-dump.c
gdb/remote-sim.c
gdb/remote.c
gdb/rl78-tdep.c
gdb/rs6000-aix-nat.c
gdb/rust-parse.c
gdb/rx-tdep.c
gdb/s390-linux-nat.c
gdb/sol-thread.c
gdb/solib-darwin.c
gdb/solib-dsbt.c
gdb/solib-frv.c
gdb/solib-svr4.c
gdb/solib.c
gdb/sparc64-tdep.c
gdb/symfile-mem.c
gdb/symfile.c
gdb/symtab.c
gdb/target-descriptions.c
gdb/target.c
gdb/target.h
gdb/tracefile-tfile.c
gdb/tracefile.c
gdb/tracepoint.c
gdb/value.c
gdb/windows-nat.c
gdb/windows-tdep.c
gdb/z80-tdep.c