[1/5] gdb: add inferior parameter to target_current_description
Commit Message
From: Simon Marchi <simon.marchi@polymtl.ca>
Make target_current_description not dependent on the current inferior on
entry. Update all callers to pass the current inferior, so no change in
behavior is expected.
Change-Id: Ic3c501bc83eb6950db077001a96a5c70dc8ae942
---
gdb/arch-utils.c | 4 ++--
gdb/target-descriptions.c | 4 ++--
gdb/target-descriptions.h | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
@@ -586,7 +586,7 @@ gdbarch_update_p (struct gdbarch_info info)
/* Check for the current target description. */
if (info.target_desc == NULL)
- info.target_desc = target_current_description ();
+ info.target_desc = target_current_description (current_inferior ());
new_gdbarch = gdbarch_find_by_info (info);
@@ -644,7 +644,7 @@ set_gdbarch_from_file (bfd *abfd)
struct gdbarch *gdbarch;
info.abfd = abfd;
- info.target_desc = target_current_description ();
+ info.target_desc = target_current_description (current_inferior ());
gdbarch = gdbarch_find_by_info (info);
if (gdbarch == NULL)
@@ -607,9 +607,9 @@ target_clear_description (void)
an existing gdbarch. */
const struct target_desc *
-target_current_description (void)
+target_current_description (inferior *inf)
{
- target_desc_info *tdesc_info = get_tdesc_info (current_inferior ());
+ target_desc_info *tdesc_info = get_tdesc_info (inf);
if (tdesc_info->fetched)
return tdesc_info->tdesc;
@@ -46,7 +46,7 @@ void target_clear_description (void);
be used by gdbarch initialization code; most access should be
through an existing gdbarch. */
-const struct target_desc *target_current_description (void);
+const struct target_desc *target_current_description (inferior *inf);
/* Copy inferior target description data. Used for example when
handling (v)forks, where child's description is the same as the