From 99d9c3b92ca96a7425cbb6b1bf453ede9477a2ee Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 29 Sep 2023 14:24:38 -0400 Subject: 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 Approved-By: Andrew Burgess --- gdb/gdbarch.h | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'gdb/gdbarch.h') diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 5285f29..82d42c9 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -72,21 +72,6 @@ struct gdbarch_tdep_base using gdbarch_tdep_up = std::unique_ptr; -/* The architecture associated with the inferior through the - connection to the target. - - The architecture vector provides some information that is really a - property of the inferior, accessed through a particular target: - ptrace operations; the layout of certain RSP packets; the solib_ops - vector; etc. To differentiate architecture accesses to - per-inferior/target properties from - per-thread/per-frame/per-objfile properties, accesses to - per-inferior/target properties should be made through this - gdbarch. */ - -/* This is a convenience wrapper for 'current_inferior ()->gdbarch'. */ -extern struct gdbarch *target_gdbarch (void); - /* Callback type for the 'iterate_over_objfiles_in_search_order' gdbarch method. */ -- cgit v1.1