[PATCH v5 12/15] gdb, hppa: remove unused hppa_lookup_stub_minimal_symbol

Markus Metzger via Gdb-patches
2022-06-02T14:35:33Z

I stumbled over this while reviewing all objfiles traversals with regards
to impact of linker namespaces.

Recursive grep only finds two occurrences of hppa_lookup_stub_minimal_symbol:
- the declaration in hppa-tdep.h.
- the definition in hppa-tdep.c.

There appear to be no calls to this function. Remove it.
---
gdb/hppa-tdep.c | 31 -------------------------------
gdb/hppa-tdep.h | 4 ----
2 files changed, 35 deletions(-)

diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index f9ececbb04f..9352b62caf4 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -2511,37 +2511,6 @@ hppa_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
return pc & ~0x3;
}

-/* Return the minimal symbol whose name is NAME and stub type is STUB_TYPE.
- Return NULL if no such symbol was found. */
-
-struct bound_minimal_symbol
-hppa_lookup_stub_minimal_symbol (const char *name,
- enum unwind_stub_types stub_type)
-{
- struct bound_minimal_symbol result;
-
- for (objfile *objfile : current_program_space->objfiles ())
- {
- for (minimal_symbol *msym : objfile->msymbols ())
- {
- if (strcmp (msym->linkage_name (), name) == 0)
- {
- struct unwind_table_entry *u;
-
- u = find_unwind_entry (msym->value_longest ());
- if (u != NULL && u->stub_unwind.stub_type == stub_type)
- {
- result.objfile = objfile;
- result.minsym = msym;
- return result;
- }
- }
- }
- }
-
- return result;
-}
-
static void
unwind_command (const char *exp, int from_tty)
{
diff --git a/gdb/hppa-tdep.h b/gdb/hppa-tdep.h
index f1e24a272c4..821d1bb58c6 100644
--- a/gdb/hppa-tdep.h
+++ b/gdb/hppa-tdep.h
@@ -210,10 +210,6 @@ extern void hppa_write_pc (struct regcache *regcache, CORE_ADDR pc);
extern CORE_ADDR hppa_unwind_pc (struct gdbarch *gdbarch,
struct frame_info *next_frame);

-extern struct bound_minimal_symbol
- hppa_lookup_stub_minimal_symbol (const char *name,
- enum unwind_stub_types stub_type);
-
extern int hppa_in_solib_call_trampoline (struct gdbarch *gdbarch,
CORE_ADDR pc);
extern CORE_ADDR hppa_skip_trampoline_code (struct frame_info *, CORE_ADDR pc);
--
2.35.3