diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2024-07-16 23:51:59 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2024-08-12 10:31:09 -0400 |
commit | 03b40f6f55bed82bd16b2a1fd94fb8c8dbf797bf (patch) | |
tree | 6cbaaed5ce62e15621e3c7f21f872459f9be0223 /gdb | |
parent | 10ac7e80c01125d1b2754763066dae35b13e6cb0 (diff) | |
download | gdb-03b40f6f55bed82bd16b2a1fd94fb8c8dbf797bf.zip gdb-03b40f6f55bed82bd16b2a1fd94fb8c8dbf797bf.tar.gz gdb-03b40f6f55bed82bd16b2a1fd94fb8c8dbf797bf.tar.bz2 |
gdb: drop struct keyword when using bound_minimal_symbol
This is a simple find / replace from "struct bound_minimal_symbol" to
"bound_minimal_symbol", to make things shorter and more consisten
througout. In some cases, move variable declarations where first used.
Change-Id: Ica4af11c4ac528aa842bfa49a7afe8fe77a66849
Reviewed-by: Keith Seitz <keiths@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb')
95 files changed, 300 insertions, 401 deletions
diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y index dfcbb2b..cdfaa3a 100644 --- a/gdb/ada-exp.y +++ b/gdb/ada-exp.y @@ -1831,7 +1831,7 @@ write_var_or_type (struct parser_state *par_state, if (block != nullptr) objfile = block->objfile (); - struct bound_minimal_symbol msym + bound_minimal_symbol msym = ada_lookup_simple_minsym (decoded_name.c_str (), objfile); if (msym.minsym != NULL) { diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 1cf6ff5..e0f895c 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -798,7 +798,6 @@ ada_get_decoded_type (struct type *type) const char * ada_main_name () { - struct bound_minimal_symbol msym; static gdb::unique_xmalloc_ptr<char> main_program_name; /* For Ada, the name of the main procedure is stored in a specific @@ -806,7 +805,8 @@ ada_main_name () extract its address, and then read that string. If we didn't find that string, then most probably the main procedure is not written in Ada. */ - msym = lookup_minimal_symbol (ADA_MAIN_PROGRAM_SYMBOL_NAME, NULL, NULL); + bound_minimal_symbol msym + = lookup_minimal_symbol (ADA_MAIN_PROGRAM_SYMBOL_NAME, NULL, NULL); if (msym.minsym != NULL) { @@ -4921,10 +4921,10 @@ add_defn_to_vec (std::vector<struct block_symbol> &result, specially: "standard__" is first stripped off, and only static and global symbols are searched. */ -struct bound_minimal_symbol +bound_minimal_symbol ada_lookup_simple_minsym (const char *name, struct objfile *objfile) { - struct bound_minimal_symbol result; + bound_minimal_symbol result; symbol_name_match_type match_type = name_match_type_from_name (name); lookup_name_info lookup_name (name, match_type); @@ -11695,7 +11695,7 @@ ada_has_this_exception_support (const struct exception_support_info *einfo) the name of the exception being raised (this name is printed in the catchpoint message, and is also used when trying to catch a specific exception). We do not handle this case for now. */ - struct bound_minimal_symbol msym + bound_minimal_symbol msym = lookup_minimal_symbol (einfo->catch_exception_sym, NULL, NULL); if (msym.minsym && msym.minsym->type () != mst_solib_trampoline) @@ -11715,7 +11715,7 @@ ada_has_this_exception_support (const struct exception_support_info *einfo) sym = standard_lookup (einfo->catch_handlers_sym, NULL, SEARCH_VFT); if (sym == NULL) { - struct bound_minimal_symbol msym + bound_minimal_symbol msym = lookup_minimal_symbol (einfo->catch_handlers_sym, NULL, NULL); if (msym.minsym && msym.minsym->type () != mst_solib_trampoline) diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h index d14bfd4..77193ef 100644 --- a/gdb/ada-lang.h +++ b/gdb/ada-lang.h @@ -239,8 +239,7 @@ extern struct block_symbol ada_lookup_symbol (const char *, extern block_symbol ada_lookup_encoded_symbol (const char *name, const struct block *block, domain_search_flags domain); -extern struct bound_minimal_symbol ada_lookup_simple_minsym (const char *, - objfile *); +extern bound_minimal_symbol ada_lookup_simple_minsym (const char *, objfile *); extern int ada_scan_number (const char *, int, LONGEST *, int *); diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c index 119b223..745e2af 100644 --- a/gdb/ada-tasks.c +++ b/gdb/ada-tasks.c @@ -712,9 +712,7 @@ read_atcb (CORE_ADDR task_id, struct ada_task_info *task_info) sizeof (task_info->name) - 1); else { - struct bound_minimal_symbol msym; - - msym = lookup_minimal_symbol_by_pc (task_id); + bound_minimal_symbol msym = lookup_minimal_symbol_by_pc (task_id); if (msym.minsym) { const char *full_name = msym.minsym->linkage_name (); @@ -914,7 +912,6 @@ read_known_tasks_list (struct ada_tasks_inferior_data *data) static void ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data) { - struct bound_minimal_symbol msym; struct symbol *sym; /* Return now if already set. */ @@ -923,7 +920,8 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data) /* Try array. */ - msym = lookup_minimal_symbol (KNOWN_TASKS_NAME, NULL, NULL); + bound_minimal_symbol msym + = lookup_minimal_symbol (KNOWN_TASKS_NAME, NULL, NULL); if (msym.minsym != NULL) { data->known_tasks_kind = ADA_TASKS_ARRAY; diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c index f2c5605..4c3df9c 100644 --- a/gdb/aix-thread.c +++ b/gdb/aix-thread.c @@ -376,7 +376,6 @@ pid_to_prc (ptid_t *ptidp) static int pdc_symbol_addrs (pthdb_user_t user_current_pid, pthdb_symbol_t *symbols, int count) { - struct bound_minimal_symbol ms; int i; char *name; @@ -396,7 +395,7 @@ pdc_symbol_addrs (pthdb_user_t user_current_pid, pthdb_symbol_t *symbols, int co symbols[i].addr = 0; else { - ms = lookup_minimal_symbol (name, NULL, NULL); + bound_minimal_symbol ms = lookup_minimal_symbol (name, NULL, NULL); if (ms.minsym == NULL) { if (debug_aix_thread) @@ -956,7 +955,6 @@ pd_enable (inferior *inf) { int status; char *stub_name; - struct bound_minimal_symbol ms; struct aix_thread_variables *data; if (inf == NULL) @@ -980,7 +978,7 @@ pd_enable (inferior *inf) return; /* Set a breakpoint on the returned stub function. */ - ms = lookup_minimal_symbol (stub_name, NULL, NULL); + bound_minimal_symbol ms = lookup_minimal_symbol (stub_name, NULL, NULL); if (ms.minsym == NULL) return; data->pd_brk_addr = ms.value_address (); diff --git a/gdb/amd64-windows-tdep.c b/gdb/amd64-windows-tdep.c index 9636201..5adc7d5 100644 --- a/gdb/amd64-windows-tdep.c +++ b/gdb/amd64-windows-tdep.c @@ -435,11 +435,10 @@ amd64_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) if (target_read_memory (pc + 1, buf, sizeof buf) == 0) { - struct bound_minimal_symbol s; CORE_ADDR call_dest; call_dest = pc + 5 + extract_signed_integer (buf, 4, byte_order); - s = lookup_minimal_symbol_by_pc (call_dest); + bound_minimal_symbol s = lookup_minimal_symbol_by_pc (call_dest); if (s.minsym != NULL && s.minsym->linkage_name () != NULL && strcmp (s.minsym->linkage_name (), "__main") == 0) diff --git a/gdb/arc-linux-tdep.c b/gdb/arc-linux-tdep.c index 30bd40c..bbb8c07 100644 --- a/gdb/arc-linux-tdep.c +++ b/gdb/arc-linux-tdep.c @@ -506,7 +506,7 @@ arc_linux_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) So we look for the symbol `_dl_linux_resolver', and if we are there, gdb sets a breakpoint at the return address, and continues. */ - struct bound_minimal_symbol resolver + bound_minimal_symbol resolver = lookup_minimal_symbol ("_dl_linux_resolver", NULL, NULL); if (arc_debug) diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index f36ce63..6278113 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -712,7 +712,6 @@ arm_find_mapping_symbol (CORE_ADDR memaddr, CORE_ADDR *start) int arm_pc_is_thumb (struct gdbarch *gdbarch, CORE_ADDR memaddr) { - struct bound_minimal_symbol sym; char type; arm_displaced_step_copy_insn_closure *dsc = nullptr; arm_gdbarch_tdep *tdep = gdbarch_tdep<arm_gdbarch_tdep> (gdbarch); @@ -752,7 +751,7 @@ arm_pc_is_thumb (struct gdbarch *gdbarch, CORE_ADDR memaddr) return type == 't'; /* Thumb functions have a "special" bit set in minimal symbols. */ - sym = lookup_minimal_symbol_by_pc (memaddr); + bound_minimal_symbol sym = lookup_minimal_symbol_by_pc (memaddr); if (sym.minsym) return (MSYMBOL_IS_SPECIAL (sym.minsym)); @@ -913,9 +912,8 @@ static int skip_prologue_function (struct gdbarch *gdbarch, CORE_ADDR pc, int is_thumb) { enum bfd_endian byte_order_for_code = gdbarch_byte_order_for_code (gdbarch); - struct bound_minimal_symbol msym; - msym = lookup_minimal_symbol_by_pc (pc); + bound_minimal_symbol msym = lookup_minimal_symbol_by_pc (pc); if (msym.minsym != NULL && msym.value_address () == pc && msym.minsym->linkage_name () != NULL) @@ -1684,7 +1682,6 @@ arm_skip_stack_protector(CORE_ADDR pc, struct gdbarch *gdbarch) { enum bfd_endian byte_order_for_code = gdbarch_byte_order_for_code (gdbarch); unsigned int basereg; - struct bound_minimal_symbol stack_chk_guard; int offset; int is_thumb = arm_pc_is_thumb (gdbarch, pc); CORE_ADDR addr; @@ -1695,7 +1692,7 @@ arm_skip_stack_protector(CORE_ADDR pc, struct gdbarch *gdbarch) if (!addr) return pc; - stack_chk_guard = lookup_minimal_symbol_by_pc (addr); + bound_minimal_symbol stack_chk_guard = lookup_minimal_symbol_by_pc (addr); /* ADDR must correspond to a symbol whose name is __stack_chk_guard. Otherwise, this sequence cannot be for stack protector. */ if (stack_chk_guard.minsym == NULL @@ -9391,9 +9388,8 @@ arm_skip_cmse_entry (CORE_ADDR pc, const char *name, struct objfile *objfile) char *target_name = (char *) alloca (target_len); xsnprintf (target_name, target_len, "%s%s", "__acle_se_", name); - struct bound_minimal_symbol minsym - = lookup_minimal_symbol (target_name, NULL, objfile); - + bound_minimal_symbol minsym + = lookup_minimal_symbol (target_name, NULL, objfile); if (minsym.minsym != nullptr) return minsym.value_address (); @@ -9467,7 +9463,6 @@ arm_skip_stub (const frame_info_ptr &frame, CORE_ADDR pc) { char *target_name; int target_len = namelen - 2; - struct bound_minimal_symbol minsym; struct objfile *objfile; struct obj_section *sec; @@ -9482,7 +9477,8 @@ arm_skip_stub (const frame_info_ptr &frame, CORE_ADDR pc) sec = find_pc_section (pc); objfile = (sec == NULL) ? NULL : sec->objfile; - minsym = lookup_minimal_symbol (target_name, NULL, objfile); + bound_minimal_symbol minsym + = lookup_minimal_symbol (target_name, NULL, objfile); if (minsym.minsym != NULL) return minsym.value_address (); else diff --git a/gdb/arm-wince-tdep.c b/gdb/arm-wince-tdep.c index eab496c..403795f 100644 --- a/gdb/arm-wince-tdep.c +++ b/gdb/arm-wince-tdep.c @@ -40,7 +40,6 @@ arm_pe_skip_trampoline_code (const frame_info_ptr &frame, CORE_ADDR pc) struct gdbarch *gdbarch = get_frame_arch (frame); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); ULONGEST indirect; - struct bound_minimal_symbol indsym; const char *symname; CORE_ADDR next_pc; @@ -61,7 +60,7 @@ arm_pe_skip_trampoline_code (const frame_info_ptr &frame, CORE_ADDR pc) if (indirect == 0) return 0; - indsym = lookup_minimal_symbol_by_pc (indirect); + bound_minimal_symbol indsym = lookup_minimal_symbol_by_pc (indirect); if (indsym.minsym == NULL) return 0; @@ -100,7 +99,7 @@ arm_wince_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) long offset = sign_extend (this_instr & 0x000fffff, 23) << 2; CORE_ADDR call_dest = (pc + 8 + offset) & 0xffffffffU; - struct bound_minimal_symbol s = lookup_minimal_symbol_by_pc (call_dest); + bound_minimal_symbol s = lookup_minimal_symbol_by_pc (call_dest); if (s.minsym != NULL && s.minsym->linkage_name () != NULL @@ -81,7 +81,6 @@ ld_so_xfer_auxv (gdb_byte *readbuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len) { - struct bound_minimal_symbol msym; CORE_ADDR data_address, pointer_address; gdbarch *arch = current_inferior ()->arch (); type *ptr_type = builtin_type (arch)->builtin_data_ptr; @@ -91,7 +90,7 @@ ld_so_xfer_auxv (gdb_byte *readbuf, LONGEST retval; size_t block; - msym = lookup_minimal_symbol ("_dl_auxv", NULL, NULL); + bound_minimal_symbol msym = lookup_minimal_symbol ("_dl_auxv", NULL, NULL); if (msym.minsym == NULL) return TARGET_XFER_E_IO; diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index 1e39f85..690ecae 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -530,7 +530,6 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end, int i; unsigned short insn; int scan_stage = 0; - struct bound_minimal_symbol msymbol; unsigned char prologue[AVR_MAX_PROLOGUE_SIZE]; int vpc = 0; int len; @@ -623,7 +622,8 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end, body_addr |= ((insn & 0xf) | ((insn & 0x0f00) >> 4)) << 8; pc_offset += 2; - msymbol = lookup_minimal_symbol ("__prologue_saves__", NULL, NULL); + bound_minimal_symbol msymbol + = lookup_minimal_symbol ("__prologue_saves__", NULL, NULL); if (!msymbol.minsym) break; diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c index ab5e800..899abb9 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -598,9 +598,8 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var) case LOC_UNRESOLVED: { - struct bound_minimal_symbol msym + bound_minimal_symbol msym = lookup_minimal_symbol (var->linkage_name (), NULL, NULL); - if (!msym.minsym) error (_("Couldn't resolve symbol `%s'."), var->print_name ()); diff --git a/gdb/block.c b/gdb/block.c index 511689c..8e37a63 100644 --- a/gdb/block.c +++ b/gdb/block.c @@ -227,7 +227,7 @@ call_site_for_pc (struct gdbarch *gdbarch, CORE_ADDR pc) if (cs == nullptr) { - struct bound_minimal_symbol msym = lookup_minimal_symbol_by_pc (pc); + bound_minimal_symbol msym = lookup_minimal_symbol_by_pc (pc); /* DW_TAG_gnu_call_site will be missing just if GCC could not determine the call target. */ diff --git a/gdb/blockframe.c b/gdb/blockframe.c index 55e82fb..7275eb1 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -85,7 +85,6 @@ CORE_ADDR get_pc_function_start (CORE_ADDR pc) { const struct block *bl; - struct bound_minimal_symbol msymbol; bl = block_for_pc (pc); if (bl) @@ -99,7 +98,7 @@ get_pc_function_start (CORE_ADDR pc) } } - msymbol = lookup_minimal_symbol_by_pc (pc); + bound_minimal_symbol msymbol = lookup_minimal_symbol_by_pc (pc); if (msymbol.minsym) { CORE_ADDR fstart = msymbol.value_address (); @@ -216,9 +215,9 @@ find_pc_partial_function_sym (CORE_ADDR pc, { struct obj_section *section; struct symbol *f; - struct bound_minimal_symbol msymbol; struct compunit_symtab *compunit_symtab = NULL; CORE_ADDR mapped_pc; + bound_minimal_symbol msymbol; /* To ensure that the symbol returned belongs to the correct section (and that the last [random] symbol from the previous section diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 670a3f7..a8f67e7 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -3466,7 +3466,7 @@ create_internal_breakpoint (struct gdbarch *gdbarch, static struct breakpoint * create_internal_breakpoint (struct gdbarch *gdbarch, - struct bound_minimal_symbol &msym, enum bptype type) + bound_minimal_symbol &msym, enum bptype type) { CORE_ADDR address; @@ -3498,10 +3498,10 @@ static const char *const longjmp_names[] = struct breakpoint_objfile_data { /* Minimal symbol for "_ovly_debug_event" (if any). */ - struct bound_minimal_symbol overlay_msym; + bound_minimal_symbol overlay_msym; /* Minimal symbol(s) for "longjmp", "siglongjmp", etc. (if any). */ - struct bound_minimal_symbol longjmp_msym[NUM_LONGJMP_NAMES]; + bound_minimal_symbol longjmp_msym[NUM_LONGJMP_NAMES]; /* True if we have looked for longjmp probes. */ int longjmp_searched = 0; @@ -3511,10 +3511,10 @@ struct breakpoint_objfile_data std::vector<probe *> longjmp_probes; /* Minimal symbol for "std::terminate()" (if any). */ - struct bound_minimal_symbol terminate_msym; + bound_minimal_symbol terminate_msym; /* Minimal symbol for "_Unwind_DebugHook" (if any). */ - struct bound_minimal_symbol exception_msym; + bound_minimal_symbol exception_msym; /* True if we have looked for exception probes. */ int exception_searched = 0; @@ -3570,9 +3570,8 @@ create_overlay_event_breakpoint (void) if (bp_objfile_data->overlay_msym.minsym == NULL) { - struct bound_minimal_symbol m; - - m = lookup_minimal_symbol_text (func_name, objfile); + bound_minimal_symbol m + = lookup_minimal_symbol_text (func_name, objfile); if (m.minsym == NULL) { /* Avoid future lookups in this objfile. */ @@ -3675,9 +3674,8 @@ create_longjmp_master_breakpoint_names (objfile *objfile) func_name = longjmp_names[i]; if (bp_objfile_data->longjmp_msym[i].minsym == NULL) { - struct bound_minimal_symbol m; - - m = lookup_minimal_symbol_text (func_name, objfile); + bound_minimal_symbol m + = lookup_minimal_symbol_text (func_name, objfile); if (m.minsym == NULL) { /* Prevent future lookups in this objfile. */ @@ -3753,9 +3751,8 @@ create_std_terminate_master_breakpoint (void) if (bp_objfile_data->terminate_msym.minsym == NULL) { - struct bound_minimal_symbol m; - - m = lookup_minimal_symbol (func_name, NULL, objfile); + bound_minimal_symbol m + = lookup_minimal_symbol (func_name, NULL, objfile); if (m.minsym == NULL || (m.minsym->type () != mst_text && m.minsym->type () != mst_file_text)) { @@ -3846,9 +3843,8 @@ create_exception_master_breakpoint_hook (objfile *objfile) if (bp_objfile_data->exception_msym.minsym == NULL) { - struct bound_minimal_symbol debug_hook; - - debug_hook = lookup_minimal_symbol_text (func_name, objfile); + bound_minimal_symbol debug_hook + = lookup_minimal_symbol_text (func_name, objfile); if (debug_hook.minsym == NULL) { bp_objfile_data->exception_msym.minsym = &msym_not_found; diff --git a/gdb/bsd-uthread.c b/gdb/bsd-uthread.c index a686f17..ecb12ad 100644 --- a/gdb/bsd-uthread.c +++ b/gdb/bsd-uthread.c @@ -157,9 +157,7 @@ static int bsd_uthread_active; static CORE_ADDR bsd_uthread_lookup_address (const char *name, struct objfile *objfile) { - struct bound_minimal_symbol sym; - - sym = lookup_minimal_symbol (name, NULL, objfile); + bound_minimal_symbol sym = lookup_minimal_symbol (name, NULL, objfile); if (sym.minsym) return sym.value_address (); diff --git a/gdb/btrace.c b/gdb/btrace.c index 66f20ee..5544c62 100644 --- a/gdb/btrace.c +++ b/gdb/btrace.c @@ -547,7 +547,6 @@ ftrace_new_gap (struct btrace_thread_info *btinfo, int errcode, static struct btrace_function * ftrace_update_function (struct btrace_thread_info *btinfo, CORE_ADDR pc) { - struct bound_minimal_symbol bmfun; struct minimal_symbol *mfun; struct symbol *fun; struct btrace_function *bfun; @@ -556,7 +555,7 @@ ftrace_update_function (struct btrace_thread_info *btinfo, CORE_ADDR pc) to avoid surprises when we sometimes get a full symbol and sometimes only a minimal symbol. */ fun = find_pc_function (pc); - bmfun = lookup_minimal_symbol_by_pc (pc); + bound_minimal_symbol bmfun = lookup_minimal_symbol_by_pc (pc); mfun = bmfun.minsym; if (fun == NULL && mfun == NULL) diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index ca24b15..bad9490 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -176,8 +176,7 @@ print_unpacked_pointer (struct type *type, struct type *elttype, { /* Print vtbl's nicely. */ CORE_ADDR vt_address = unpack_pointer (type, valaddr + embedded_offset); - struct bound_minimal_symbol msymbol = - lookup_minimal_symbol_by_pc (vt_address); + bound_minimal_symbol msymbol = lookup_minimal_symbol_by_pc (vt_address); /* If 'symbol_print' is set, we did the work above. */ if (!options->symbol_print diff --git a/gdb/coff-pe-read.c b/gdb/coff-pe-read.c index 0da4f12..9d08721 100644 --- a/gdb/coff-pe-read.c +++ b/gdb/coff-pe-read.c @@ -174,7 +174,6 @@ add_pe_forwarded_sym (minimal_symbol_reader &reader, const char *forward_func_name, int ordinal, const char *dll_name, struct objfile *objfile) { - struct bound_minimal_symbol msymbol; enum minimal_symbol_type msymtype; int forward_dll_name_len = strlen (forward_dll_name); short section; @@ -183,8 +182,8 @@ add_pe_forwarded_sym (minimal_symbol_reader &reader, forward_dll_name, forward_func_name); - msymbol = lookup_bound_minimal_symbol (forward_qualified_name.c_str ()); - + bound_minimal_symbol msymbol + = lookup_bound_minimal_symbol (forward_qualified_name.c_str ()); if (!msymbol.minsym) { int i; diff --git a/gdb/coffread.c b/gdb/coffread.c index daae3ff..d4bc7d6 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -574,12 +574,12 @@ coff_read_minsyms (file_ptr symtab_offset, unsigned int nsyms, { int lead = bfd_get_symbol_leading_char (objfile->obfd.get ()); - struct bound_minimal_symbol found; if (lead != '\0' && *name1 == lead) name1 += 1; - found = lookup_minimal_symbol (name1, NULL, objfile); + bound_minimal_symbol found + = lookup_minimal_symbol (name1, NULL, objfile); /* If found, there are symbols named "_imp_foo" and "foo" respectively in OBJFILE. Set the type of symbol "foo" diff --git a/gdb/compile/compile-c-symbols.c b/gdb/compile/compile-c-symbols.c index 20e8550..5e602b9 100644 --- a/gdb/compile/compile-c-symbols.c +++ b/gdb/compile/compile-c-symbols.c @@ -259,8 +259,7 @@ convert_symbol_sym (compile_c_instance *context, const char *identifier, to use and BMSYM is the minimal symbol to convert. */ static void -convert_symbol_bmsym (compile_c_instance *context, - struct bound_minimal_symbol bmsym) +convert_symbol_bmsym (compile_c_instance *context, bound_minimal_symbol bmsym) { struct minimal_symbol *msym = bmsym.minsym; struct objfile *objfile = bmsym.objfile; @@ -356,9 +355,8 @@ gcc_convert_symbol (void *datum, } else if (request == GCC_C_ORACLE_SYMBOL) { - struct bound_minimal_symbol bmsym; - - bmsym = lookup_minimal_symbol (identifier, NULL, NULL); + bound_minimal_symbol bmsym + = lookup_minimal_symbol (identifier, NULL, NULL); if (bmsym.minsym != NULL) { convert_symbol_bmsym (context, bmsym); @@ -413,9 +411,7 @@ gcc_symbol_address (void *datum, struct gcc_c_context *gcc_context, } else { - struct bound_minimal_symbol msym; - - msym = lookup_bound_minimal_symbol (identifier); + bound_minimal_symbol msym = lookup_bound_minimal_symbol (identifier); if (msym.minsym != NULL) { if (compile_debug) diff --git a/gdb/compile/compile-cplus-symbols.c b/gdb/compile/compile-cplus-symbols.c index 9b95cdd..45b965a 100644 --- a/gdb/compile/compile-cplus-symbols.c +++ b/gdb/compile/compile-cplus-symbols.c @@ -275,7 +275,7 @@ convert_symbol_sym (compile_cplus_instance *instance, static void convert_symbol_bmsym (compile_cplus_instance *instance, - struct bound_minimal_symbol bmsym) + bound_minimal_symbol bmsym) { struct minimal_symbol *msym = bmsym.minsym; struct objfile *objfile = bmsym.objfile; @@ -453,9 +453,7 @@ gcc_cplus_symbol_address (void *datum, struct gcc_cp_context *gcc_context, } else { - struct bound_minimal_symbol msym; - - msym = lookup_bound_minimal_symbol (identifier); + bound_minimal_symbol msym = lookup_bound_minimal_symbol (identifier); if (msym.minsym != nullptr) { if (compile_debug) diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object-load.c index 08e30be..6485632 100644 --- a/gdb/compile/compile-object-load.c +++ b/gdb/compile/compile-object-load.c @@ -604,7 +604,6 @@ compile_object_load (const compile_file_names &file_names, CORE_ADDR regs_addr, out_value_addr = 0; struct symbol *func_sym; struct type *func_type; - struct bound_minimal_symbol bmsym; long storage_needed; asymbol **symbol_table, **symp; long number_of_symbols, missing_symbols; @@ -765,7 +764,8 @@ compile_object_load (const compile_file_names &file_names, continue; } - bmsym = lookup_minimal_symbol (sym->name, NULL, NULL); + bound_minimal_symbol bmsym + = lookup_minimal_symbol (sym->name, NULL, NULL); switch (bmsym.minsym == NULL ? mst_unknown : bmsym.minsym->type ()) { diff --git a/gdb/csky-tdep.c b/gdb/csky-tdep.c index 1b6c08e..d69b8e5 100644 --- a/gdb/csky-tdep.c +++ b/gdb/csky-tdep.c @@ -2097,7 +2097,7 @@ csky_frame_unwind_cache (const frame_info_ptr &this_frame) func_size = bl->end () - bl->start (); else { - struct bound_minimal_symbol msymbol + bound_minimal_symbol msymbol = lookup_minimal_symbol_by_pc (prologue_start); if (msymbol.minsym != NULL) func_size = msymbol.minsym->size (); diff --git a/gdb/ctfread.c b/gdb/ctfread.c index d8606d3..42009dc 100644 --- a/gdb/ctfread.c +++ b/gdb/ctfread.c @@ -323,9 +323,7 @@ get_bitsize (ctf_dict_t *fp, ctf_id_t tid, uint32_t kind) static void set_symbol_address (struct objfile *of, struct symbol *sym, const char *name) { - struct bound_minimal_symbol msym; - - msym = lookup_minimal_symbol (name, nullptr, of); + bound_minimal_symbol msym = lookup_minimal_symbol (name, nullptr, of); if (msym.minsym != NULL) { sym->set_value_address (msym.value_address ()); diff --git a/gdb/d-exp.y b/gdb/d-exp.y index 6feacd8..f4de994 100644 --- a/gdb/d-exp.y +++ b/gdb/d-exp.y @@ -435,7 +435,7 @@ PrimaryExpression: '(' Expression ')' { /* Do nothing. */ } | IdentifierExp - { struct bound_minimal_symbol msymbol; + { std::string copy = copy_name ($1); struct field_of_this_result is_a_field_of_this; struct block_symbol sym; @@ -463,7 +463,8 @@ PrimaryExpression: else { /* Lookup foreign name in global static symbols. */ - msymbol = lookup_bound_minimal_symbol (copy.c_str ()); + bound_minimal_symbol msymbol + = lookup_bound_minimal_symbol (copy.c_str ()); if (msymbol.minsym != NULL) pstate->push_new<var_msym_value_operation> (msymbol); else if (!have_full_symbols (current_program_space) diff --git a/gdb/d-lang.c b/gdb/d-lang.c index d4f9956..0a9e9b0 100644 --- a/gdb/d-lang.c +++ b/gdb/d-lang.c @@ -38,9 +38,7 @@ static const char D_MAIN[] = "D main"; const char * d_main_name (void) { - struct bound_minimal_symbol msym; - - msym = lookup_minimal_symbol (D_MAIN, NULL, NULL); + bound_minimal_symbol msym = lookup_minimal_symbol (D_MAIN, NULL, NULL); if (msym.minsym != NULL) return D_MAIN; diff --git a/gdb/dbxread.c b/gdb/dbxread.c index 830dd1c..47e56d4 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -891,11 +891,10 @@ set_namestring (struct objfile *objfile, const struct internal_nlist *nlist) return namestring; } -static struct bound_minimal_symbol +static bound_minimal_symbol find_stab_function (const char *namestring, const char *filename, struct objfile *objfile) { - struct bound_minimal_symbol msym; int n; const char *colon = strchr (namestring, ':'); @@ -908,7 +907,7 @@ find_stab_function (const char *namestring, const char *filename, strncpy (p, namestring, n); p[n] = 0; - msym = lookup_minimal_symbol (p, filename, objfile); + bound_minimal_symbol msym = lookup_minimal_symbol (p, filename, objfile); if (msym.minsym == NULL) { /* Sun Fortran appends an underscore to the minimal symbol name, @@ -1678,10 +1677,9 @@ read_dbx_symtab (minimal_symbol_reader &reader, if (nlist.n_value == 0 && gdbarch_sofun_address_maybe_missing (gdbarch)) { - struct bound_minimal_symbol minsym + bound_minimal_symbol minsym = find_stab_function (namestring, - pst ? pst->filename : NULL, - objfile); + pst ? pst->filename : NULL, objfile); if (minsym.minsym != NULL) nlist.n_value = CORE_ADDR (minsym.minsym->unrelocated_address ()); @@ -1737,10 +1735,9 @@ read_dbx_symtab (minimal_symbol_reader &reader, if (nlist.n_value == 0 && gdbarch_sofun_address_maybe_missing (gdbarch)) { - struct bound_minimal_symbol minsym + bound_minimal_symbol minsym = find_stab_function (namestring, - pst ? pst->filename : NULL, - objfile); + pst ? pst->filename : NULL, objfile); if (minsym.minsym != NULL) nlist.n_value = CORE_ADDR (minsym.minsym->unrelocated_address ()); @@ -2036,7 +2033,6 @@ dbx_end_psymtab (struct objfile *objfile, psymtab_storage *partial_symtabs, && gdbarch_sofun_address_maybe_missing (gdbarch)) { int n; - struct bound_minimal_symbol minsym; const char *colon = strchr (last_function_name, ':'); if (colon == NULL) @@ -2047,7 +2043,8 @@ dbx_end_psymtab (struct objfile *objfile, psymtab_storage *partial_symtabs, strncpy (p, last_function_name, n); p[n] = 0; - minsym = lookup_minimal_symbol (p, pst->filename, objfile); + bound_minimal_symbol minsym + = lookup_minimal_symbol (p, pst->filename, objfile); if (minsym.minsym == NULL) { /* Sun Fortran appends an underscore to the minimal symbol name, @@ -2840,7 +2837,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name, && valu == section_offsets[SECT_OFF_TEXT (objfile)] && gdbarch_sofun_address_maybe_missing (gdbarch)) { - struct bound_minimal_symbol minsym + bound_minimal_symbol minsym = find_stab_function (name, get_last_source_file (), objfile); if (minsym.minsym != NULL) diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h index efd03e6..fa8b2fc 100644 --- a/gdb/dwarf2/cooked-index.h +++ b/gdb/dwarf2/cooked-index.h @@ -788,7 +788,7 @@ struct cooked_index_functions : public dwarf2_base_index_functions domain_search_flags domain) override; struct compunit_symtab *find_pc_sect_compunit_symtab - (struct objfile *objfile, struct bound_minimal_symbol msymbol, + (struct objfile *objfile, bound_minimal_symbol msymbol, CORE_ADDR pc, struct obj_section *section, int warn_if_readin) override { wait (objfile, true); diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c index 637c81f..57a4706 100644 --- a/gdb/dwarf2/loc.c +++ b/gdb/dwarf2/loc.c @@ -667,9 +667,8 @@ call_site_target::iterate_over_addresses (gdbarch *call_site_gdbarch, dwarf_block = m_loc.dwarf_block; if (dwarf_block == NULL) { - struct bound_minimal_symbol msym; - - msym = lookup_minimal_symbol_by_pc (call_site->pc () - 1); + bound_minimal_symbol msym + = lookup_minimal_symbol_by_pc (call_site->pc () - 1); throw_error (NO_ENTRY_VALUE_ERROR, _("DW_AT_call_target is not specified at %s in %s"), paddress (call_site_gdbarch, call_site->pc ()), @@ -679,9 +678,8 @@ call_site_target::iterate_over_addresses (gdbarch *call_site_gdbarch, } if (caller_frame == NULL) { - struct bound_minimal_symbol msym; - - msym = lookup_minimal_symbol_by_pc (call_site->pc () - 1); + bound_minimal_symbol msym + = lookup_minimal_symbol_by_pc (call_site->pc () - 1); throw_error (NO_ENTRY_VALUE_ERROR, _("DW_AT_call_target DWARF block resolving " "requires known frame which is currently not " @@ -708,12 +706,12 @@ call_site_target::iterate_over_addresses (gdbarch *call_site_gdbarch, case call_site_target::PHYSNAME: { const char *physname; - struct bound_minimal_symbol msym; physname = m_loc.physname; /* Handle both the mangled and demangled PHYSNAME. */ - msym = lookup_minimal_symbol (physname, NULL, NULL); + bound_minimal_symbol msym + = lookup_minimal_symbol (physname, NULL, NULL); if (msym.minsym == NULL) { msym = lookup_minimal_symbol_by_pc (call_site->pc () - 1); @@ -820,9 +818,8 @@ func_verify_no_selftailcall (struct gdbarch *gdbarch, CORE_ADDR verify_addr) { if (target_addr == verify_addr) { - struct bound_minimal_symbol msym; - - msym = lookup_minimal_symbol_by_pc (verify_addr); + bound_minimal_symbol msym + = lookup_minimal_symbol_by_pc (verify_addr); throw_error (NO_ENTRY_VALUE_ERROR, _("DW_OP_entry_value resolving has found " "function \"%s\" at %s can call itself via tail " @@ -846,7 +843,7 @@ static void tailcall_dump (struct gdbarch *gdbarch, const struct call_site *call_site) { CORE_ADDR addr = call_site->pc (); - struct bound_minimal_symbol msym = lookup_minimal_symbol_by_pc (addr - 1); + bound_minimal_symbol msym = lookup_minimal_symbol_by_pc (addr - 1); gdb_printf (gdb_stdlog, " %s(%s)", paddress (gdbarch, addr), (msym.minsym == NULL ? "???" @@ -1064,10 +1061,10 @@ call_site_find_chain_1 (struct gdbarch *gdbarch, CORE_ADDR caller_pc, if (retval == NULL) { - struct bound_minimal_symbol msym_caller, msym_callee; - - msym_caller = lookup_minimal_symbol_by_pc (caller_pc); - msym_callee = lookup_minimal_symbol_by_pc (callee_pc); + bound_minimal_symbol msym_caller + = lookup_minimal_symbol_by_pc (caller_pc); + bound_minimal_symbol msym_callee + = lookup_minimal_symbol_by_pc (callee_pc); throw_error (NO_ENTRY_VALUE_ERROR, _("There are no unambiguously determinable intermediate " "callers or callees between caller function \"%s\" at %s " @@ -1165,8 +1162,7 @@ dwarf_expr_reg_to_entry_parameter (const frame_info_ptr &initial_frame, caller_frame = get_prev_frame (frame); if (gdbarch != frame_unwind_arch (frame)) { - struct bound_minimal_symbol msym - = lookup_minimal_symbol_by_pc (func_addr); + bound_minimal_symbol msym = lookup_minimal_symbol_by_pc (func_addr); struct gdbarch *caller_gdbarch = frame_unwind_arch (frame); throw_error (NO_ENTRY_VALUE_ERROR, @@ -1181,8 +1177,7 @@ dwarf_expr_reg_to_entry_parameter (const frame_info_ptr &initial_frame, if (caller_frame == NULL) { - struct bound_minimal_symbol msym - = lookup_minimal_symbol_by_pc (func_addr); + bound_minimal_symbol msym = lookup_minimal_symbol_by_pc (func_addr); throw_error (NO_ENTRY_VALUE_ERROR, _("DW_OP_entry_value resolving " "requires caller of %s (%s)"), diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 71237d0..a0013f7 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -2997,7 +2997,7 @@ recursively_find_pc_sect_compunit_symtab (struct compunit_symtab *cust, struct compunit_symtab * dwarf2_base_index_functions::find_pc_sect_compunit_symtab (struct objfile *objfile, - struct bound_minimal_symbol msymbol, + bound_minimal_symbol msymbol, CORE_ADDR pc, struct obj_section *section, int warn_if_readin) diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h index e55d053..40e1f55 100644 --- a/gdb/dwarf2/read.h +++ b/gdb/dwarf2/read.h @@ -844,7 +844,7 @@ struct dwarf2_base_index_functions : public quick_symbol_functions void expand_all_symtabs (struct objfile *objfile) override; struct compunit_symtab *find_pc_sect_compunit_symtab - (struct objfile *objfile, struct bound_minimal_symbol msymbol, + (struct objfile *objfile, bound_minimal_symbol msymbol, CORE_ADDR pc, struct obj_section *section, int warn_if_readin) override; diff --git a/gdb/elfread.c b/gdb/elfread.c index 7a6a8ca..c82e150 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -694,13 +694,12 @@ elf_gnu_ifunc_cache_eq (const void *a_voidp, const void *b_voidp) static int elf_gnu_ifunc_record_cache (const char *name, CORE_ADDR addr) { - struct bound_minimal_symbol msym; struct objfile *objfile; htab_t htab; struct elf_gnu_ifunc_cache entry_local, *entry_p; void **slot; - msym = lookup_minimal_symbol_by_pc (addr); + bound_minimal_symbol msym = lookup_minimal_symbol_by_pc (addr); if (msym.minsym == NULL) return 0; if (msym.value_address () != addr) diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c index 08a01c1..6b0d502 100644 --- a/gdb/fbsd-tdep.c +++ b/gdb/fbsd-tdep.c @@ -2059,7 +2059,7 @@ fbsd_get_thread_local_address (struct gdbarch *gdbarch, CORE_ADDR dtv_addr, CORE_ADDR fbsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) { - struct bound_minimal_symbol msym = lookup_bound_minimal_symbol ("_rtld_bind"); + bound_minimal_symbol msym = lookup_bound_minimal_symbol ("_rtld_bind"); if (msym.minsym != nullptr && msym.value_address () == pc) return frame_unwind_caller_pc (get_current_frame ()); diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c index 1b5e15f..b1f79f3 100644 --- a/gdb/frv-tdep.c +++ b/gdb/frv-tdep.c @@ -1062,14 +1062,13 @@ frv_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) { LONGEST displ; CORE_ADDR call_dest; - struct bound_minimal_symbol s; displ = ((op & 0xfe000000) >> 7) | (op & 0x0003ffff); if ((displ & 0x00800000) != 0) displ |= ~((LONGEST) 0x00ffffff); call_dest = pc + 4 * displ; - s = lookup_minimal_symbol_by_pc (call_dest); + bound_minimal_symbol s = lookup_minimal_symbol_by_pc (call_dest); if (s.minsym != NULL && s.minsym->linkage_name () != NULL @@ -1374,14 +1373,14 @@ frv_frame_this_id (const frame_info_ptr &this_frame, = frv_frame_unwind_cache (this_frame, this_prologue_cache); CORE_ADDR base; CORE_ADDR func; - struct bound_minimal_symbol msym_stack; struct frame_id id; /* The FUNC is easy. */ func = get_frame_func (this_frame); /* Check if the stack is empty. */ - msym_stack = lookup_minimal_symbol ("_stack", NULL, NULL); + bound_minimal_symbol msym_stack + = lookup_minimal_symbol ("_stack", NULL, NULL); if (msym_stack.minsym && info->base == msym_stack.value_address ()) return; diff --git a/gdb/ft32-tdep.c b/gdb/ft32-tdep.c index 647c584..e34a619 100644 --- a/gdb/ft32-tdep.c +++ b/gdb/ft32-tdep.c @@ -174,8 +174,8 @@ ft32_analyze_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr, ULONGEST inst; int isize = 0; int regnum, pushreg; - struct bound_minimal_symbol msymbol; const int first_saved_reg = 13; /* The first saved register. */ + /* PROLOGS are addresses of the subroutine prologs, PROLOGS[n] is the address of __prolog_$rN. __prolog_$rN pushes registers from 13 through n inclusive. @@ -195,7 +195,8 @@ ft32_analyze_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr, snprintf (prolog_symbol, sizeof (prolog_symbol), "__prolog_$r%02d", regnum); - msymbol = lookup_minimal_symbol (prolog_symbol, NULL, NULL); + bound_minimal_symbol msymbol + = lookup_minimal_symbol (prolog_symbol, NULL, NULL); if (msymbol.minsym) prologs[regnum] = msymbol.value_address (); else diff --git a/gdb/glibc-tdep.c b/gdb/glibc-tdep.c index 48e080a..0ade1df 100644 --- a/gdb/glibc-tdep.c +++ b/gdb/glibc-tdep.c @@ -52,13 +52,13 @@ glibc_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) of GNU/Linux will provide a portable, efficient interface for debugging programs that use shared libraries. */ - struct bound_minimal_symbol resolver + bound_minimal_symbol resolver = lookup_bound_minimal_symbol ("_dl_runtime_resolve"); if (resolver.minsym) { /* The dynamic linker began using this name in early 2005. */ - struct bound_minimal_symbol fixup + bound_minimal_symbol fixup = lookup_minimal_symbol ("_dl_fixup", NULL, resolver.objfile); /* This is the name used in older versions. */ diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c index 7b511ea..0a9c09e 100644 --- a/gdb/gnu-v2-abi.c +++ b/gdb/gnu-v2-abi.c @@ -186,7 +186,6 @@ gnuv2_value_rtti_type (struct value *v, int *full, LONGEST *top, int *using_enc) struct type *known_type; struct type *rtti_type; CORE_ADDR vtbl; - struct bound_minimal_symbol minsym; char *p; const char *linkage_name; struct type *btype; @@ -239,7 +238,7 @@ gnuv2_value_rtti_type (struct value *v, int *full, LONGEST *top, int *using_enc) vtbl = value_as_address (value_field (v, known_type_vptr_fieldno)); /* Try to find a symbol that is the vtable. */ - minsym=lookup_minimal_symbol_by_pc(vtbl); + bound_minimal_symbol minsym = lookup_minimal_symbol_by_pc (vtbl); if (minsym.minsym==NULL || (linkage_name=minsym.minsym->linkage_name ())==NULL || !is_vtable_name (linkage_name)) diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c index 1311a99..92735b9 100644 --- a/gdb/gnu-v3-abi.c +++ b/gdb/gnu-v3-abi.c @@ -1178,14 +1178,13 @@ static std::string gnuv3_get_typename_from_type_info (struct value *type_info_ptr) { struct gdbarch *gdbarch = type_info_ptr->type ()->arch (); - struct bound_minimal_symbol typeinfo_sym; CORE_ADDR addr; const char *symname; const char *class_name; const char *atsign; addr = value_as_address (type_info_ptr); - typeinfo_sym = lookup_minimal_symbol_by_pc (addr); + bound_minimal_symbol typeinfo_sym = lookup_minimal_symbol_by_pc (addr); if (typeinfo_sym.minsym == NULL) error (_("could not find minimal symbol for typeinfo address %s"), paddress (gdbarch, addr)); @@ -1229,7 +1228,6 @@ gnuv3_skip_trampoline (const frame_info_ptr &frame, CORE_ADDR stop_pc) { CORE_ADDR real_stop_pc, method_stop_pc, func_addr; struct gdbarch *gdbarch = get_frame_arch (frame); - struct bound_minimal_symbol thunk_sym, fn_sym; struct obj_section *section; const char *thunk_name, *fn_name; @@ -1238,7 +1236,7 @@ gnuv3_skip_trampoline (const frame_info_ptr &frame, CORE_ADDR stop_pc) real_stop_pc = stop_pc; /* Find the linker symbol for this potential thunk. */ - thunk_sym = lookup_minimal_symbol_by_pc (real_stop_pc); + bound_minimal_symbol thunk_sym = lookup_minimal_symbol_by_pc (real_stop_pc); section = find_pc_section (real_stop_pc); if (thunk_sym.minsym == NULL || section == NULL) return 0; @@ -1251,7 +1249,8 @@ gnuv3_skip_trampoline (const frame_info_ptr &frame, CORE_ADDR stop_pc) return 0; fn_name = strstr (thunk_name, " thunk to ") + strlen (" thunk to "); - fn_sym = lookup_minimal_symbol (fn_name, NULL, section->objfile); + bound_minimal_symbol fn_sym + = lookup_minimal_symbol (fn_name, NULL, section->objfile); if (fn_sym.minsym == NULL) return 0; diff --git a/gdb/go-exp.y b/gdb/go-exp.y index 115c71b..345b231 100644 --- a/gdb/go-exp.y +++ b/gdb/go-exp.y @@ -569,10 +569,9 @@ variable: name_not_typename } else { - struct bound_minimal_symbol msymbol; std::string arg = copy_name ($1.stoken); - msymbol = + bound_minimal_symbol msymbol = lookup_bound_minimal_symbol (arg.c_str ()); if (msymbol.minsym != NULL) pstate->push_new<var_msym_value_operation> diff --git a/gdb/go-lang.c b/gdb/go-lang.c index 8b4250b..bbf4479 100644 --- a/gdb/go-lang.c +++ b/gdb/go-lang.c @@ -54,9 +54,7 @@ static const char GO_MAIN_MAIN[] = "main.main"; const char * go_main_name (void) { - struct bound_minimal_symbol msym; - - msym = lookup_minimal_symbol (GO_MAIN_MAIN, NULL, NULL); + bound_minimal_symbol msym = lookup_minimal_symbol (GO_MAIN_MAIN, NULL, NULL); if (msym.minsym != NULL) return GO_MAIN_MAIN; diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index c15a9fc..43cf46b 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -194,9 +194,7 @@ hppa_extract_17 (unsigned word) CORE_ADDR hppa_symbol_address(const char *sym) { - struct bound_minimal_symbol minsym; - - minsym = lookup_minimal_symbol (sym, NULL, NULL); + bound_minimal_symbol minsym = lookup_minimal_symbol (sym, NULL, NULL); if (minsym.minsym) return minsym.value_address (); else diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index f1f909e..625ffe5 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -1946,12 +1946,11 @@ i386_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) { /* Make sure address is computed correctly as a 32bit integer even if CORE_ADDR is 64 bit wide. */ - struct bound_minimal_symbol s; CORE_ADDR call_dest; call_dest = pc + 5 + extract_signed_integer (buf, 4, byte_order); call_dest = call_dest & 0xffffffffU; - s = lookup_minimal_symbol_by_pc (call_dest); + bound_minimal_symbol s = lookup_minimal_symbol_by_pc (call_dest); if (s.minsym != NULL && s.minsym->linkage_name () != NULL && strcmp (s.minsym->linkage_name (), "__main") == 0) diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index 6376cf8..2739304 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -3615,9 +3615,7 @@ ia64_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, /* There are also descriptors embedded in vtables. */ if (s) { - struct bound_minimal_symbol minsym; - - minsym = lookup_minimal_symbol_by_pc (addr); + bound_minimal_symbol minsym = lookup_minimal_symbol_by_pc (addr); if (minsym.minsym && is_vtable_name (minsym.minsym->linkage_name ())) diff --git a/gdb/infcall.c b/gdb/infcall.c index 559fcb7..02e3b38 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -488,7 +488,7 @@ get_function_name (CORE_ADDR funaddr, char *buf, int buf_size) { /* Try the minimal symbols. */ - struct bound_minimal_symbol msymbol = lookup_minimal_symbol_by_pc (funaddr); + bound_minimal_symbol msymbol = lookup_minimal_symbol_by_pc (funaddr); if (msymbol.minsym) return msymbol.minsym->print_name (); diff --git a/gdb/infcmd.c b/gdb/infcmd.c index a030788..347684a 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -1360,7 +1360,7 @@ until_next_command (int from_tty) if (!func) { - struct bound_minimal_symbol msymbol = lookup_minimal_symbol_by_pc (pc); + bound_minimal_symbol msymbol = lookup_minimal_symbol_by_pc (pc); if (msymbol.minsym == nullptr) error (_("Execution is not within a known function.")); diff --git a/gdb/linespec.c b/gdb/linespec.c index 9b0652c..ee418e3 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -4165,7 +4165,7 @@ minsym_found (struct linespec_state *self, struct objfile *objfile, static void add_minsym (struct minimal_symbol *minsym, struct objfile *objfile, struct symtab *symtab, int list_mode, - std::vector<struct bound_minimal_symbol> *msyms) + std::vector<bound_minimal_symbol> *msyms) { if (symtab != NULL) { @@ -4202,7 +4202,7 @@ search_minsyms_for_name (struct collect_info *info, struct program_space *search_pspace, struct symtab *symtab) { - std::vector<struct bound_minimal_symbol> minsyms; + std::vector<bound_minimal_symbol> minsyms; if (symtab == NULL) { diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c index 319a13f..e34c5e0 100644 --- a/gdb/linux-fork.c +++ b/gdb/linux-fork.c @@ -638,9 +638,7 @@ info_checkpoints_command (const char *arg, int from_tty) gdb_printf (_(", line %d"), sal.line); if (!sal.symtab && !sal.line) { - struct bound_minimal_symbol msym; - - msym = lookup_minimal_symbol_by_pc (pc); + bound_minimal_symbol msym = lookup_minimal_symbol_by_pc (pc); if (msym.minsym) gdb_printf (", <%s>", msym.minsym->linkage_name ()); } diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index 018bd68..0a63957 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -467,11 +467,11 @@ verbose_dlsym (void *handle, const char *name) static int inferior_has_bug (const char *ver_symbol, int ver_major_min, int ver_minor_min) { - struct bound_minimal_symbol version_msym; CORE_ADDR version_addr; int got, retval = 0; - version_msym = lookup_minimal_symbol (ver_symbol, NULL, NULL); + bound_minimal_symbol version_msym + = lookup_minimal_symbol (ver_symbol, NULL, NULL); if (version_msym.minsym == NULL) return 0; diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c index d9890d0..db859bc 100644 --- a/gdb/m32c-tdep.c +++ b/gdb/m32c-tdep.c @@ -2212,7 +2212,7 @@ m32c_return_value (struct gdbarch *gdbarch, /* Everything else is passed in mem0, using as many bytes as needed. This is not what the Renesas tools do, but it's what GCC does at the moment. */ - struct bound_minimal_symbol mem0 + bound_minimal_symbol mem0 = lookup_minimal_symbol ("mem0", NULL, NULL); if (! mem0.minsym) @@ -2244,7 +2244,7 @@ m32c_return_value (struct gdbarch *gdbarch, /* Everything else is passed in mem0, using as many bytes as needed. This is not what the Renesas tools do, but it's what GCC does at the moment. */ - struct bound_minimal_symbol mem0 + bound_minimal_symbol mem0 = lookup_minimal_symbol ("mem0", NULL, NULL); if (! mem0.minsym) @@ -2421,11 +2421,9 @@ m32c_m16c_address_to_pointer (struct gdbarch *gdbarch, { const char *func_name; char *tramp_name; - struct bound_minimal_symbol tramp_msym; /* Try to find a linker symbol at this address. */ - struct bound_minimal_symbol func_msym - = lookup_minimal_symbol_by_pc (addr); + bound_minimal_symbol func_msym = lookup_minimal_symbol_by_pc (addr); if (! func_msym.minsym) error (_("Cannot convert code address %s to function pointer:\n" @@ -2438,7 +2436,8 @@ m32c_m16c_address_to_pointer (struct gdbarch *gdbarch, strcat (tramp_name, ".plt"); /* Try to find a linker symbol for the trampoline. */ - tramp_msym = lookup_minimal_symbol (tramp_name, NULL, NULL); + bound_minimal_symbol tramp_msym + = lookup_minimal_symbol (tramp_name, NULL, NULL); /* We've either got another copy of the name now, or don't need the name any more. */ @@ -2502,7 +2501,7 @@ m32c_m16c_pointer_to_address (struct gdbarch *gdbarch, { /* See if there is a minimal symbol at that address whose name is "NAME.plt". */ - struct bound_minimal_symbol ptr_msym = lookup_minimal_symbol_by_pc (ptr); + bound_minimal_symbol ptr_msym = lookup_minimal_symbol_by_pc (ptr); if (ptr_msym.minsym) { @@ -2512,7 +2511,6 @@ m32c_m16c_pointer_to_address (struct gdbarch *gdbarch, if (len > 4 && strcmp (ptr_msym_name + len - 4, ".plt") == 0) { - struct bound_minimal_symbol func_msym; /* We have a .plt symbol; try to find the symbol for the corresponding function. @@ -2522,7 +2520,7 @@ m32c_m16c_pointer_to_address (struct gdbarch *gdbarch, char *func_name = (char *) xmalloc (len - 4 + 1); memcpy (func_name, ptr_msym_name, len - 4); func_name[len - 4] = '\0'; - func_msym + bound_minimal_symbol func_msym = lookup_minimal_symbol (func_name, NULL, NULL); /* If we do have such a symbol, return its value as the diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c index f2f8602..b41d8a5 100644 --- a/gdb/m32r-tdep.c +++ b/gdb/m32r-tdep.c @@ -800,14 +800,14 @@ m32r_frame_this_id (const frame_info_ptr &this_frame, = m32r_frame_unwind_cache (this_frame, this_prologue_cache); CORE_ADDR base; CORE_ADDR func; - struct bound_minimal_symbol msym_stack; struct frame_id id; /* The FUNC is easy. */ func = get_frame_func (this_frame); /* Check if the stack is empty. */ - msym_stack = lookup_minimal_symbol ("_stack", NULL, NULL); + bound_minimal_symbol msym_stack + = lookup_minimal_symbol ("_stack", NULL, NULL); if (msym_stack.minsym && info->base == msym_stack.value_address ()) return; diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index e58e44b..4093d2b 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -210,9 +210,7 @@ static int soft_reg_initialized = 0; static void m68hc11_get_register_info (struct m68hc11_soft_reg *reg, const char *name) { - struct bound_minimal_symbol msymbol; - - msymbol = lookup_minimal_symbol (name, NULL, NULL); + bound_minimal_symbol msymbol = lookup_minimal_symbol (name, NULL, NULL); if (msymbol.minsym) { reg->addr = msymbol.value_address (); @@ -591,12 +589,10 @@ m68hc11_analyze_instruction (struct gdbarch *gdbarch, static enum insn_return_kind m68hc11_get_return_insn (CORE_ADDR pc) { - struct bound_minimal_symbol sym; - /* A flag indicating that this is a STO_M68HC12_FAR or STO_M68HC12_INTERRUPT function is stored by elfread.c in the high bit of the info field. Use this to decide which instruction the function uses to return. */ - sym = lookup_minimal_symbol_by_pc (pc); + bound_minimal_symbol sym = lookup_minimal_symbol_by_pc (pc); if (sym.minsym == 0) return RETURN_RTS; diff --git a/gdb/machoread.c b/gdb/machoread.c index be68e45..2f2874a 100644 --- a/gdb/machoread.c +++ b/gdb/machoread.c @@ -390,13 +390,13 @@ static CORE_ADDR macho_resolve_oso_sym_with_minsym (struct objfile *main_objfile, asymbol *sym) { /* For common symbol and global symbols, use the min symtab. */ - struct bound_minimal_symbol msym; const char *name = sym->name; if (*name != '\0' && *name == bfd_get_symbol_leading_char (main_objfile->obfd.get ())) ++name; - msym = lookup_minimal_symbol (name, NULL, main_objfile); + + bound_minimal_symbol msym = lookup_minimal_symbol (name, NULL, main_objfile); if (msym.minsym == NULL) { warning (_("can't find symbol '%s' in minsymtab"), name); diff --git a/gdb/maint.c b/gdb/maint.c index d091634..237c9d8 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -546,7 +546,6 @@ maintenance_translate_address (const char *arg, int from_tty) CORE_ADDR address; struct obj_section *sect; const char *p; - struct bound_minimal_symbol sym; if (arg == NULL || *arg == 0) error (_("requires argument (address or section + address)")); @@ -577,6 +576,7 @@ maintenance_translate_address (const char *arg, int from_tty) address = parse_and_eval_address (p); + bound_minimal_symbol sym; if (sect) sym = lookup_minimal_symbol_by_pc_section (address, sect); else diff --git a/gdb/mi/mi-symbol-cmds.c b/gdb/mi/mi-symbol-cmds.c index 15c032b..e90055f 100644 --- a/gdb/mi/mi-symbol-cmds.c +++ b/gdb/mi/mi-symbol-cmds.c @@ -95,8 +95,7 @@ output_debug_symbol (ui_out *uiout, domain_search_flags kind, and then outputs the fields for this msymbol. */ static void -output_nondebug_symbol (ui_out *uiout, - const struct bound_minimal_symbol &msymbol) +output_nondebug_symbol (ui_out *uiout, const bound_minimal_symbol &msymbol) { struct gdbarch *gdbarch = msymbol.objfile->arch (); ui_out_emit_tuple tuple_emitter (uiout, NULL); diff --git a/gdb/minsyms.c b/gdb/minsyms.c index 38176c4..49381dd 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -358,7 +358,7 @@ lookup_minimal_symbol_demangled (const lookup_name_info &lookup_name, Obviously, there must be distinct mangled names for each of these, but the demangled names are all the same: S::S or S::~S. */ -struct bound_minimal_symbol +bound_minimal_symbol lookup_minimal_symbol (const char *name, const char *sfile, struct objfile *objf) { @@ -476,7 +476,7 @@ lookup_minimal_symbol (const char *name, const char *sfile, /* See minsyms.h. */ -struct bound_minimal_symbol +bound_minimal_symbol lookup_bound_minimal_symbol (const char *name) { return lookup_minimal_symbol (name, NULL, NULL); @@ -488,9 +488,7 @@ int find_minimal_symbol_address (const char *name, CORE_ADDR *addr, struct objfile *objfile) { - struct bound_minimal_symbol sym - = lookup_minimal_symbol (name, NULL, objfile); - + bound_minimal_symbol sym = lookup_minimal_symbol (name, NULL, objfile); if (sym.minsym != NULL) *addr = sym.value_address (); @@ -591,7 +589,7 @@ lookup_minimal_symbol_linkage (const char *name, struct objfile *objf) /* See minsyms.h. */ -struct bound_minimal_symbol +bound_minimal_symbol lookup_minimal_symbol_linkage (const char *name, bool only_main) { for (objfile *objfile : current_program_space->objfiles ()) @@ -613,12 +611,12 @@ lookup_minimal_symbol_linkage (const char *name, bool only_main) /* See minsyms.h. */ -struct bound_minimal_symbol +bound_minimal_symbol lookup_minimal_symbol_text (const char *name, struct objfile *objf) { struct minimal_symbol *msymbol; - struct bound_minimal_symbol found_symbol; - struct bound_minimal_symbol found_file_symbol; + bound_minimal_symbol found_symbol; + bound_minimal_symbol found_file_symbol; unsigned int hash = msymbol_hash (name) % MINIMAL_SYMBOL_HASH_SIZE; @@ -765,7 +763,6 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio struct minimal_symbol *msymbol; struct minimal_symbol *best_symbol = NULL; struct objfile *best_objfile = NULL; - struct bound_minimal_symbol result; if (previous != nullptr) { @@ -997,6 +994,7 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio } } + bound_minimal_symbol result; result.minsym = best_symbol; result.objfile = best_objfile; return result; @@ -1004,7 +1002,7 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio /* See minsyms.h. */ -struct bound_minimal_symbol +bound_minimal_symbol lookup_minimal_symbol_by_pc (CORE_ADDR pc) { return lookup_minimal_symbol_by_pc_section (pc, NULL); @@ -1598,7 +1596,7 @@ find_solib_trampoline_target (const frame_info_ptr &frame, CORE_ADDR pc) /* See minsyms.h. */ CORE_ADDR -minimal_symbol_upper_bound (struct bound_minimal_symbol minsym) +minimal_symbol_upper_bound (bound_minimal_symbol minsym) { short section; struct obj_section *obj_section; diff --git a/gdb/minsyms.h b/gdb/minsyms.h index d44f281..ab80c29 100644 --- a/gdb/minsyms.h +++ b/gdb/minsyms.h @@ -205,14 +205,13 @@ unsigned int msymbol_hash_iw (const char *); symbols are still preferred). Returns a bound minimal symbol that matches, or an empty bound minimal symbol if no match is found. */ -struct bound_minimal_symbol lookup_minimal_symbol (const char *, - const char *, - struct objfile *); +bound_minimal_symbol lookup_minimal_symbol (const char *, const char *, + struct objfile *); /* Like lookup_minimal_symbol, but searches all files and objfiles. */ -struct bound_minimal_symbol lookup_bound_minimal_symbol (const char *); +bound_minimal_symbol lookup_bound_minimal_symbol (const char *); /* Look through all the current minimal symbol tables and find the first minimal symbol that matches NAME and has text type. If OBJF @@ -222,8 +221,8 @@ struct bound_minimal_symbol lookup_bound_minimal_symbol (const char *); This function only searches the mangled (linkage) names. */ -struct bound_minimal_symbol lookup_minimal_symbol_text (const char *, - struct objfile *); +bound_minimal_symbol lookup_minimal_symbol_text (const char *, + struct objfile *); /* Look through the minimal symbols in OBJF (and its separate debug objfiles) for a global (not file-local) minsym whose linkage name @@ -232,16 +231,16 @@ struct bound_minimal_symbol lookup_minimal_symbol_text (const char *, objfile is not accepted. Returns a bound minimal symbol that matches, or an "empty" bound minimal symbol otherwise. */ -extern struct bound_minimal_symbol lookup_minimal_symbol_linkage - (const char *name, struct objfile *objf) +extern bound_minimal_symbol lookup_minimal_symbol_linkage (const char *name, + struct objfile *objf) ATTRIBUTE_NONNULL (1) ATTRIBUTE_NONNULL (2); /* A variant of lookup_minimal_symbol_linkage that iterates over all objfiles. If ONLY_MAIN is true, then only an objfile with OBJF_MAINLINE will be considered. */ -extern struct bound_minimal_symbol lookup_minimal_symbol_linkage - (const char *name, bool only_main) +extern bound_minimal_symbol lookup_minimal_symbol_linkage (const char *name, + bool only_main) ATTRIBUTE_NONNULL (1); /* Look through all the current minimal symbol tables and find the @@ -287,7 +286,7 @@ enum class lookup_msym_prefer then the contents will be set to reference the closest symbol before PC_IN. */ -struct bound_minimal_symbol lookup_minimal_symbol_by_pc_section +bound_minimal_symbol lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *section, lookup_msym_prefer prefer = lookup_msym_prefer::TEXT, @@ -299,7 +298,7 @@ struct bound_minimal_symbol lookup_minimal_symbol_by_pc_section This is a wrapper that calls lookup_minimal_symbol_by_pc_section with a NULL section argument. */ -struct bound_minimal_symbol lookup_minimal_symbol_by_pc (CORE_ADDR); +bound_minimal_symbol lookup_minimal_symbol_by_pc (CORE_ADDR); /* Iterate over all the minimal symbols in the objfile OBJF which match NAME. Both the ordinary and demangled names of each symbol @@ -318,7 +317,7 @@ void iterate_over_minimal_symbols symbol in the same section, or the end of the section, as the end of the function. */ -CORE_ADDR minimal_symbol_upper_bound (struct bound_minimal_symbol minsym); +CORE_ADDR minimal_symbol_upper_bound (bound_minimal_symbol minsym); /* Return the type of MSYMBOL, a minimal symbol of OBJFILE. If ADDRESS_P is not NULL, set it to the MSYMBOL's resolved diff --git a/gdb/mips-fbsd-tdep.c b/gdb/mips-fbsd-tdep.c index 7452057..717c9c5 100644 --- a/gdb/mips-fbsd-tdep.c +++ b/gdb/mips-fbsd-tdep.c @@ -468,8 +468,7 @@ static const struct tramp_frame mips64_fbsd_sigframe = static CORE_ADDR mips_fbsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) { - struct bound_minimal_symbol msym - = lookup_bound_minimal_symbol ("_mips_rtld_bind"); + bound_minimal_symbol msym = lookup_bound_minimal_symbol ("_mips_rtld_bind"); if (msym.minsym != nullptr && msym.value_address () == pc) return frame_unwind_caller_pc (get_current_frame ()); diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c index fecefd7..18ef979 100644 --- a/gdb/mips-linux-tdep.c +++ b/gdb/mips-linux-tdep.c @@ -699,9 +699,8 @@ mips_linux_in_dynsym_resolve_code (CORE_ADDR pc) static CORE_ADDR mips_linux_skip_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) { - struct bound_minimal_symbol resolver; - - resolver = lookup_minimal_symbol ("__dl_runtime_resolve", NULL, NULL); + bound_minimal_symbol resolver + = lookup_minimal_symbol ("__dl_runtime_resolve", NULL, NULL); if (resolver.minsym && resolver.value_address () == pc) return frame_unwind_caller_pc (get_current_frame ()); diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index ae58d7c..e935e26 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -490,10 +490,10 @@ mips_make_symbol_special (struct symbol *sym, struct objfile *objfile) /* We are in symbol reading so it is OK to cast away constness. */ struct block *block = (struct block *) sym->value_block (); CORE_ADDR compact_block_start; - struct bound_minimal_symbol msym; compact_block_start = block->start () | 1; - msym = lookup_minimal_symbol_by_pc (compact_block_start); + bound_minimal_symbol msym + = lookup_minimal_symbol_by_pc (compact_block_start); if (msym.minsym && !msymbol_is_mips (msym.minsym)) { block->set_start (compact_block_start); @@ -1212,13 +1212,12 @@ show_mask_address (struct ui_file *file, int from_tty, int mips_pc_is_mips (CORE_ADDR memaddr) { - struct bound_minimal_symbol sym; - /* Flags indicating that this is a MIPS16 or microMIPS function is stored by elfread.c in the high bit of the info field. Use this to decide if the function is standard MIPS. Otherwise if bit 0 of the address is clear, then this is a standard MIPS function. */ - sym = lookup_minimal_symbol_by_pc (make_compact_addr (memaddr)); + bound_minimal_symbol sym + = lookup_minimal_symbol_by_pc (make_compact_addr (memaddr)); if (sym.minsym) return msymbol_is_mips (sym.minsym); else @@ -1230,13 +1229,12 @@ mips_pc_is_mips (CORE_ADDR memaddr) int mips_pc_is_mips16 (struct gdbarch *gdbarch, CORE_ADDR memaddr) { - struct bound_minimal_symbol sym; - /* A flag indicating that this is a MIPS16 function is stored by elfread.c in the high bit of the info field. Use this to decide if the function is MIPS16. Otherwise if bit 0 of the address is set, then ELF file flags will tell if this is a MIPS16 function. */ - sym = lookup_minimal_symbol_by_pc (make_compact_addr (memaddr)); + bound_minimal_symbol sym + = lookup_minimal_symbol_by_pc (make_compact_addr (memaddr)); if (sym.minsym) return msymbol_is_mips16 (sym.minsym); else @@ -1248,14 +1246,13 @@ mips_pc_is_mips16 (struct gdbarch *gdbarch, CORE_ADDR memaddr) int mips_pc_is_micromips (struct gdbarch *gdbarch, CORE_ADDR memaddr) { - struct bound_minimal_symbol sym; - /* A flag indicating that this is a microMIPS function is stored by elfread.c in the high bit of the info field. Use this to decide if the function is microMIPS. Otherwise if bit 0 of the address is set, then ELF file flags will tell if this is a microMIPS function. */ - sym = lookup_minimal_symbol_by_pc (make_compact_addr (memaddr)); + bound_minimal_symbol sym + = lookup_minimal_symbol_by_pc (make_compact_addr (memaddr)); if (sym.minsym) return msymbol_is_micromips (sym.minsym); else @@ -1268,14 +1265,13 @@ mips_pc_is_micromips (struct gdbarch *gdbarch, CORE_ADDR memaddr) static enum mips_isa mips_pc_isa (struct gdbarch *gdbarch, CORE_ADDR memaddr) { - struct bound_minimal_symbol sym; - /* A flag indicating that this is a MIPS16 or a microMIPS function is stored by elfread.c in the high bit of the info field. Use this to decide if the function is MIPS16 or microMIPS or normal MIPS. Otherwise if bit 0 of the address is set, then ELF file flags will tell if this is a MIPS16 or a microMIPS function. */ - sym = lookup_minimal_symbol_by_pc (make_compact_addr (memaddr)); + bound_minimal_symbol sym + = lookup_minimal_symbol_by_pc (make_compact_addr (memaddr)); if (sym.minsym) { if (msymbol_is_micromips (sym.minsym)) @@ -3841,7 +3837,6 @@ mips_stub_frame_sniffer (const struct frame_unwind *self, { gdb_byte dummy[4]; CORE_ADDR pc = get_frame_address_in_block (this_frame); - struct bound_minimal_symbol msym; /* Use the stub unwinder for unreadable code. */ if (target_read_memory (get_frame_pc (this_frame), dummy, 4) != 0) @@ -3852,7 +3847,7 @@ mips_stub_frame_sniffer (const struct frame_unwind *self, /* Calling a PIC function from a non-PIC function passes through a stub. The stub for foo is named ".pic.foo". */ - msym = lookup_minimal_symbol_by_pc (pc); + bound_minimal_symbol msym = lookup_minimal_symbol_by_pc (pc); if (msym.minsym != NULL && msym.minsym->linkage_name () != NULL && startswith (msym.minsym->linkage_name (), ".pic.")) @@ -7824,7 +7819,6 @@ mips_skip_pic_trampoline_code (const frame_info_ptr &frame, CORE_ADDR pc) { struct gdbarch *gdbarch = get_frame_arch (frame); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - struct bound_minimal_symbol msym; int i; gdb_byte stub_code[16]; int32_t stub_words[4]; @@ -7832,7 +7826,7 @@ mips_skip_pic_trampoline_code (const frame_info_ptr &frame, CORE_ADDR pc) /* The stub for foo is named ".pic.foo", and is either two instructions inserted before foo or a three instruction sequence which jumps to foo. */ - msym = lookup_minimal_symbol_by_pc (pc); + bound_minimal_symbol msym = lookup_minimal_symbol_by_pc (pc); if (msym.minsym == NULL || msym.value_address () != pc || msym.minsym->linkage_name () == NULL diff --git a/gdb/msp430-tdep.c b/gdb/msp430-tdep.c index 017ebb4..41a8f99 100644 --- a/gdb/msp430-tdep.c +++ b/gdb/msp430-tdep.c @@ -807,11 +807,10 @@ msp430_in_return_stub (struct gdbarch *gdbarch, CORE_ADDR pc, static CORE_ADDR msp430_skip_trampoline_code (const frame_info_ptr &frame, CORE_ADDR pc) { - struct bound_minimal_symbol bms; const char *stub_name; struct gdbarch *gdbarch = get_frame_arch (frame); - bms = lookup_minimal_symbol_by_pc (pc); + bound_minimal_symbol bms = lookup_minimal_symbol_by_pc (pc); if (!bms.minsym) return pc; diff --git a/gdb/netbsd-tdep.c b/gdb/netbsd-tdep.c index 953b329..18155a2 100644 --- a/gdb/netbsd-tdep.c +++ b/gdb/netbsd-tdep.c @@ -348,9 +348,8 @@ nbsd_gdb_signal_to_target (struct gdbarch *gdbarch, static CORE_ADDR nbsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) { - struct bound_minimal_symbol msym; - - msym = lookup_minimal_symbol ("_rtld_bind_start", NULL, NULL); + bound_minimal_symbol msym + = lookup_minimal_symbol ("_rtld_bind_start", NULL, NULL); if (msym.minsym && msym.value_address () == pc) return frame_unwind_caller_pc (get_current_frame ()); else diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index 3655445..fc1d81c 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -1137,8 +1137,7 @@ find_imps (const char *method, std::vector<const char *> *symbol_names) symbol_names->push_back (sym->natural_name ()); else { - struct bound_minimal_symbol msym - = lookup_minimal_symbol (selector, 0, 0); + bound_minimal_symbol msym = lookup_minimal_symbol (selector, 0, 0); if (msym.minsym != NULL) symbol_names->push_back (msym.minsym->natural_name ()); @@ -1240,10 +1239,9 @@ find_objc_msgsend (void) for (i = 0; i < nmethcalls; i++) { - struct bound_minimal_symbol func; - /* Try both with and without underscore. */ - func = lookup_bound_minimal_symbol (methcalls[i].name); + bound_minimal_symbol func + = lookup_bound_minimal_symbol (methcalls[i].name); if ((func.minsym == NULL) && (methcalls[i].name[0] == '_')) { func = lookup_bound_minimal_symbol (methcalls[i].name + 1); diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 50bd6f8..8b1e89c 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -600,11 +600,10 @@ public: domain_search_flags domain); /* See quick_symbol_functions. */ - struct compunit_symtab *find_pc_sect_compunit_symtab - (struct bound_minimal_symbol msymbol, - CORE_ADDR pc, - struct obj_section *section, - int warn_if_readin); + struct compunit_symtab * + find_pc_sect_compunit_symtab (bound_minimal_symbol msymbol, CORE_ADDR pc, + struct obj_section *section, + int warn_if_readin); /* See quick_symbol_functions. */ void map_symbol_filenames (gdb::function_view<symbol_filename_ftype> fun, diff --git a/gdb/obsd-tdep.c b/gdb/obsd-tdep.c index 5142984..fab05b7 100644 --- a/gdb/obsd-tdep.c +++ b/gdb/obsd-tdep.c @@ -27,9 +27,7 @@ CORE_ADDR obsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) { - struct bound_minimal_symbol msym; - - msym = lookup_minimal_symbol("_dl_bind", NULL, NULL); + bound_minimal_symbol msym = lookup_minimal_symbol ("_dl_bind", NULL, NULL); if (msym.minsym && msym.value_address () == pc) return frame_unwind_caller_pc (get_current_frame ()); else diff --git a/gdb/p-exp.y b/gdb/p-exp.y index 0a0fa95..77f853b 100644 --- a/gdb/p-exp.y +++ b/gdb/p-exp.y @@ -717,11 +717,10 @@ variable: name_not_typename } else { - struct bound_minimal_symbol msymbol; std::string arg = copy_name ($1.stoken); - msymbol = - lookup_bound_minimal_symbol (arg.c_str ()); + bound_minimal_symbol msymbol + = lookup_bound_minimal_symbol (arg.c_str ()); if (msymbol.minsym != NULL) pstate->push_new<var_msym_value_operation> (msymbol); diff --git a/gdb/p-lang.c b/gdb/p-lang.c index d3d491c..9a8a35d 100644 --- a/gdb/p-lang.c +++ b/gdb/p-lang.c @@ -59,9 +59,8 @@ static const char GPC_MAIN_PROGRAM_NAME_2[] = "pascal_main_program"; const char * pascal_main_name (void) { - struct bound_minimal_symbol msym; - - msym = lookup_minimal_symbol (GPC_P_INITIALIZE, NULL, NULL); + bound_minimal_symbol msym + = lookup_minimal_symbol (GPC_P_INITIALIZE, NULL, NULL); /* If '_p_initialize' was not found, the main program is likely not written in Pascal. */ diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c index bdb9524..aa7f1a9 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -225,8 +225,8 @@ pascal_language::value_print_inner (struct value *val, { /* Print vtbl's nicely. */ CORE_ADDR vt_address = unpack_pointer (type, valaddr); - struct bound_minimal_symbol msymbol = - lookup_minimal_symbol_by_pc (vt_address); + bound_minimal_symbol msymbol + = lookup_minimal_symbol_by_pc (vt_address); /* If 'symbol_print' is set, we did the work above. */ if (!options->symbol_print diff --git a/gdb/parse.c b/gdb/parse.c index 2541a2e..1b602a7 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -145,7 +145,7 @@ parser_state::push_symbol (const char *name, block_symbol sym) } else { - struct bound_minimal_symbol msymbol = lookup_bound_minimal_symbol (name); + bound_minimal_symbol msymbol = lookup_bound_minimal_symbol (name); if (msymbol.minsym != NULL) push_new<expr::var_msym_value_operation> (msymbol); else if (!have_full_symbols (current_program_space) @@ -162,7 +162,6 @@ void parser_state::push_dollar (struct stoken str) { struct block_symbol sym; - struct bound_minimal_symbol msym; struct internalvar *isym = NULL; std::string copy; @@ -232,7 +231,7 @@ parser_state::push_dollar (struct stoken str) push_new<expr::var_value_operation> (sym); return; } - msym = lookup_bound_minimal_symbol (copy.c_str ()); + bound_minimal_symbol msym = lookup_bound_minimal_symbol (copy.c_str ()); if (msym.minsym) { push_new<expr::var_msym_value_operation> (msym); diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c index e100045..3116fc1 100644 --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c @@ -313,15 +313,13 @@ static const struct ppc_insn_pattern powerpc32_plt_stub_so_2[] = static int powerpc_linux_in_dynsym_resolve_code (CORE_ADDR pc) { - struct bound_minimal_symbol sym; - /* Check whether PC is in the dynamic linker. This also checks whether it is in the .plt section, used by non-PIC executables. */ if (svr4_in_dynsym_resolve_code (pc)) return 1; /* Check if we are in the resolver. */ - sym = lookup_minimal_symbol_by_pc (pc); + bound_minimal_symbol sym = lookup_minimal_symbol_by_pc (pc); if (sym.minsym != NULL && (strcmp (sym.minsym->linkage_name (), "__glink") == 0 || strcmp (sym.minsym->linkage_name (), "__glink_PLTresolve") == 0)) @@ -1670,10 +1668,9 @@ ppc_elfv2_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym) static CORE_ADDR ppc_elfv2_skip_entrypoint (struct gdbarch *gdbarch, CORE_ADDR pc) { - struct bound_minimal_symbol fun; int local_entry_offset = 0; - fun = lookup_minimal_symbol_by_pc (pc); + bound_minimal_symbol fun = lookup_minimal_symbol_by_pc (pc); if (fun.minsym == NULL) return pc; diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c index 47e6292..041f83d 100644 --- a/gdb/ppc-sysv-tdep.c +++ b/gdb/ppc-sysv-tdep.c @@ -1044,12 +1044,10 @@ static int convert_code_addr_to_desc_addr (CORE_ADDR code_addr, CORE_ADDR *desc_addr) { struct obj_section *dot_fn_section; - struct bound_minimal_symbol dot_fn; - struct bound_minimal_symbol fn; /* Find the minimal symbol that corresponds to CODE_ADDR (should have a name of the form ".FN"). */ - dot_fn = lookup_minimal_symbol_by_pc (code_addr); + bound_minimal_symbol dot_fn = lookup_minimal_symbol_by_pc (code_addr); if (dot_fn.minsym == NULL || dot_fn.minsym->linkage_name ()[0] != '.') return 0; /* Get the section that contains CODE_ADDR. Need this for the @@ -1061,8 +1059,9 @@ convert_code_addr_to_desc_addr (CORE_ADDR code_addr, CORE_ADDR *desc_addr) address. Only look for the minimal symbol in ".FN"'s object file - avoids problems when two object files (i.e., shared libraries) contain a minimal symbol with the same name. */ - fn = lookup_minimal_symbol (dot_fn.minsym->linkage_name () + 1, NULL, - dot_fn_section->objfile); + bound_minimal_symbol fn + = lookup_minimal_symbol (dot_fn.minsym->linkage_name () + 1, NULL, + dot_fn_section->objfile); if (fn.minsym == NULL) return 0; /* Found a descriptor. */ diff --git a/gdb/printcmd.c b/gdb/printcmd.c index e37e30e..8e02583 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -606,7 +606,6 @@ build_address_symbolic (struct gdbarch *gdbarch, int *line, /* OUT */ int *unmapped) /* OUT */ { - struct bound_minimal_symbol msymbol; struct symbol *symbol; CORE_ADDR name_location = 0; struct obj_section *section = NULL; @@ -638,7 +637,8 @@ build_address_symbolic (struct gdbarch *gdbarch, save some memory, but for many debug format--ELF/DWARF or anything/stabs--it would be inconvenient to eliminate those minimal symbols anyway). */ - msymbol = lookup_minimal_symbol_by_pc_section (addr, section); + bound_minimal_symbol msymbol + = lookup_minimal_symbol_by_pc_section (addr, section); symbol = find_pc_sect_function (addr, section); if (symbol) @@ -1575,7 +1575,6 @@ info_address_command (const char *exp, int from_tty) struct gdbarch *gdbarch; int regno; struct symbol *sym; - struct bound_minimal_symbol msymbol; long val; struct obj_section *section; CORE_ADDR load_addr, context_pc = 0; @@ -1601,7 +1600,7 @@ info_address_command (const char *exp, int from_tty) return; } - msymbol = lookup_bound_minimal_symbol (exp); + bound_minimal_symbol msymbol = lookup_bound_minimal_symbol (exp); if (msymbol.minsym != NULL) { @@ -1753,9 +1752,8 @@ info_address_command (const char *exp, int from_tty) case LOC_UNRESOLVED: { - struct bound_minimal_symbol msym; - - msym = lookup_bound_minimal_symbol (sym->linkage_name ()); + bound_minimal_symbol msym + = lookup_bound_minimal_symbol (sym->linkage_name ()); if (msym.minsym == NULL) gdb_printf ("unresolved"); else diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 7d6648c..0df3dc8 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -87,7 +87,7 @@ static struct partial_symtab * find_pc_sect_psymtab_closer (struct objfile *objfile, CORE_ADDR pc, struct obj_section *section, struct partial_symtab *pst, - struct bound_minimal_symbol msymbol) + bound_minimal_symbol msymbol) { struct partial_symtab *tpst; struct partial_symtab *best_pst = pst; @@ -161,7 +161,7 @@ struct partial_symtab * psymbol_functions::find_pc_sect_psymtab (struct objfile *objfile, CORE_ADDR pc, struct obj_section *section, - struct bound_minimal_symbol msymbol) + bound_minimal_symbol msymbol) { for (partial_symtab *pst : partial_symbols (objfile)) if (pc >= pst->text_low (objfile) && pc < pst->text_high (objfile)) @@ -181,12 +181,11 @@ psymbol_functions::find_pc_sect_psymtab (struct objfile *objfile, the definition of quick_symbol_functions in symfile.h. */ struct compunit_symtab * -psymbol_functions::find_pc_sect_compunit_symtab - (struct objfile *objfile, - struct bound_minimal_symbol msymbol, - CORE_ADDR pc, - struct obj_section *section, - int warn_if_readin) +psymbol_functions::find_pc_sect_compunit_symtab (struct objfile *objfile, + bound_minimal_symbol msymbol, + CORE_ADDR pc, + struct obj_section *section, + int warn_if_readin) { struct partial_symtab *ps = find_pc_sect_psymtab (objfile, pc, section, @@ -1281,7 +1280,7 @@ maintenance_print_psymbols (const char *args, int from_tty) if (address_arg != NULL) { - struct bound_minimal_symbol msymbol; + bound_minimal_symbol msymbol; /* We don't assume each pc has a unique objfile (this is for debugging). */ diff --git a/gdb/psymtab.h b/gdb/psymtab.h index f41f241..508e778 100644 --- a/gdb/psymtab.h +++ b/gdb/psymtab.h @@ -636,8 +636,8 @@ struct psymbol_functions : public quick_symbol_functions domain_search_flags kind) override; struct compunit_symtab *find_pc_sect_compunit_symtab - (struct objfile *objfile, struct bound_minimal_symbol msymbol, - CORE_ADDR pc, struct obj_section *section, int warn_if_readin) override; + (struct objfile *objfile, bound_minimal_symbol msymbol, CORE_ADDR pc, + struct obj_section *section, int warn_if_readin) override; struct compunit_symtab *find_compunit_symtab_by_address (struct objfile *objfile, CORE_ADDR address) override @@ -672,11 +672,10 @@ struct psymbol_functions : public quick_symbol_functions exactly matches PC, or, if we cannot find an exact match, the psymtab that contains a symbol whose address is closest to PC. */ - struct partial_symtab *find_pc_sect_psymtab - (struct objfile *objfile, - CORE_ADDR pc, - struct obj_section *section, - struct bound_minimal_symbol msymbol); + struct partial_symtab *find_pc_sect_psymtab (struct objfile *objfile, + CORE_ADDR pc, + struct obj_section *section, + bound_minimal_symbol msymbol); private: diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c index 89695ff..9f9032f 100644 --- a/gdb/python/py-framefilter.c +++ b/gdb/python/py-framefilter.c @@ -923,12 +923,12 @@ py_print_frame (PyObject *filter, frame_filter_flags flags, else if (PyLong_Check (py_func.get ())) { CORE_ADDR addr; - struct bound_minimal_symbol msymbol; if (get_addr_from_python (py_func.get (), &addr) < 0) return EXT_LANG_BT_ERROR; - msymbol = lookup_minimal_symbol_by_pc (addr); + bound_minimal_symbol msymbol + = lookup_minimal_symbol_by_pc (addr); if (msymbol.minsym != NULL) function = msymbol.minsym->print_name (); } diff --git a/gdb/quick-symbol.h b/gdb/quick-symbol.h index 676c3ed..d6de734 100644 --- a/gdb/quick-symbol.h +++ b/gdb/quick-symbol.h @@ -163,8 +163,8 @@ struct quick_symbol_functions compunit that contains a symbol whose address is closest to PC. */ virtual struct compunit_symtab *find_pc_sect_compunit_symtab - (struct objfile *objfile, struct bound_minimal_symbol msymbol, - CORE_ADDR pc, struct obj_section *section, int warn_if_readin) = 0; + (struct objfile *objfile, bound_minimal_symbol msymbol, CORE_ADDR pc, + struct obj_section *section, int warn_if_readin) = 0; /* Return the comp unit from OBJFILE that contains a symbol at ADDRESS. Return NULL if there is no such comp unit. Unlike diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c index 1957f3c..9100a2c 100644 --- a/gdb/ravenscar-thread.c +++ b/gdb/ravenscar-thread.c @@ -326,12 +326,11 @@ ravenscar_thread_target::add_active_thread () and return its associated minimal symbol. Return NULL if not found. */ -static struct bound_minimal_symbol +static bound_minimal_symbol get_running_thread_msymbol () { - struct bound_minimal_symbol msym; - - msym = lookup_minimal_symbol (running_thread_name, NULL, NULL); + bound_minimal_symbol msym + = lookup_minimal_symbol (running_thread_name, NULL, NULL); if (!msym.minsym) /* Older versions of the GNAT runtime were using a different (less ideal) name for the symbol where the active thread ID @@ -348,14 +347,13 @@ get_running_thread_msymbol () static bool has_ravenscar_runtime () { - struct bound_minimal_symbol msym_ravenscar_runtime_initializer + bound_minimal_symbol msym_ravenscar_runtime_initializer = lookup_minimal_symbol (ravenscar_runtime_initializer, NULL, NULL); - struct bound_minimal_symbol msym_known_tasks + bound_minimal_symbol msym_known_tasks = lookup_minimal_symbol (known_tasks_name, NULL, NULL); - struct bound_minimal_symbol msym_first_task + bound_minimal_symbol msym_first_task = lookup_minimal_symbol (first_task_name, NULL, NULL); - struct bound_minimal_symbol msym_running_thread - = get_running_thread_msymbol (); + bound_minimal_symbol msym_running_thread = get_running_thread_msymbol (); return (msym_ravenscar_runtime_initializer.minsym && (msym_known_tasks.minsym || msym_first_task.minsym) @@ -377,7 +375,7 @@ ravenscar_thread_target::runtime_initialized () static CORE_ADDR get_running_thread_id (int cpu) { - struct bound_minimal_symbol object_msym = get_running_thread_msymbol (); + bound_minimal_symbol object_msym = get_running_thread_msymbol (); int object_size; int buf_size; gdb_byte *buf; diff --git a/gdb/remote.c b/gdb/remote.c index 4948a54..eab527d 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -5504,13 +5504,12 @@ remote_target::remote_check_symbols () while (startswith (reply.data (), "qSymbol:")) { - struct bound_minimal_symbol sym; - tmp = &reply[8]; end = hex2bin (tmp, reinterpret_cast <gdb_byte *> (msg.data ()), strlen (tmp) / 2); msg[end] = '\0'; - sym = lookup_minimal_symbol (msg.data (), NULL, NULL); + bound_minimal_symbol sym + = lookup_minimal_symbol (msg.data (), NULL, NULL); if (sym.minsym == NULL) xsnprintf (msg.data (), get_remote_packet_size (), "qSymbol::%s", &reply[8]); diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 2edb823..a5b1249 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -2250,7 +2250,7 @@ rs6000_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) { CORE_ADDR displ = op & BL_DISPLACEMENT_MASK; CORE_ADDR call_dest = pc + 4 + displ; - struct bound_minimal_symbol s = lookup_minimal_symbol_by_pc (call_dest); + bound_minimal_symbol s = lookup_minimal_symbol_by_pc (call_dest); /* We check for ___eabi (three leading underscores) in addition to __eabi in case the GCC option "-fleading-underscore" was @@ -2324,7 +2324,6 @@ rs6000_skip_trampoline_code (const frame_info_ptr &frame, CORE_ADDR pc) unsigned int ii, op; int rel; CORE_ADDR solib_target_pc; - struct bound_minimal_symbol msymbol; static unsigned trampoline_code[] = { @@ -2339,7 +2338,7 @@ rs6000_skip_trampoline_code (const frame_info_ptr &frame, CORE_ADDR pc) }; /* Check for bigtoc fixup code. */ - msymbol = lookup_minimal_symbol_by_pc (pc); + bound_minimal_symbol msymbol = lookup_minimal_symbol_by_pc (pc); if (msymbol.minsym && rs6000_in_solib_return_trampoline (gdbarch, pc, msymbol.minsym->linkage_name ())) diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index 77740fe..e09973e 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -759,9 +759,7 @@ ps_err_e ps_pglobal_lookup (struct ps_prochandle *ph, const char *ld_object_name, const char *ld_symbol_name, psaddr_t *ld_symbol_addr) { - struct bound_minimal_symbol ms; - - ms = lookup_minimal_symbol (ld_symbol_name, NULL, NULL); + bound_minimal_symbol ms = lookup_minimal_symbol (ld_symbol_name, NULL, NULL); if (!ms.minsym) return PS_NOSYM; @@ -1068,7 +1066,7 @@ info_cb (const td_thrhandle_t *th, void *s) /* Print thr_create start function. */ if (ti.ti_startfunc != 0) { - const struct bound_minimal_symbol msym + const bound_minimal_symbol msym = lookup_minimal_symbol_by_pc (ti.ti_startfunc); gdb_printf (" startfunc=%s", @@ -1081,7 +1079,7 @@ info_cb (const td_thrhandle_t *th, void *s) /* If thread is asleep, print function that went to sleep. */ if (ti.ti_state == TD_THR_SLEEP) { - const struct bound_minimal_symbol msym + const bound_minimal_symbol msym = lookup_minimal_symbol_by_pc (ti.ti_pc); gdb_printf (" sleepfunc=%s", diff --git a/gdb/sol2-tdep.c b/gdb/sol2-tdep.c index 468b132..b3eb828 100644 --- a/gdb/sol2-tdep.c +++ b/gdb/sol2-tdep.c @@ -63,9 +63,7 @@ sol2_sigtramp_p (const frame_info_ptr &this_frame) static CORE_ADDR sol2_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) { - struct bound_minimal_symbol msym; - - msym = lookup_minimal_symbol("elf_bndr", NULL, NULL); + bound_minimal_symbol msym = lookup_minimal_symbol ("elf_bndr", NULL, NULL); if (msym.minsym && msym.value_address () == pc) return frame_unwind_caller_pc (get_current_frame ()); diff --git a/gdb/solib-dsbt.c b/gdb/solib-dsbt.c index 908c78a..9840255 100644 --- a/gdb/solib-dsbt.c +++ b/gdb/solib-dsbt.c @@ -434,7 +434,6 @@ static CORE_ADDR lm_base (void) { bfd_endian byte_order = gdbarch_byte_order (current_inferior ()->arch ()); - struct bound_minimal_symbol got_sym; CORE_ADDR addr; gdb_byte buf[TIC6X_PTR_SIZE]; dsbt_info *info = get_dsbt_info (current_program_space); @@ -451,8 +450,9 @@ lm_base (void) if (info->lm_base_cache) return info->lm_base_cache; - got_sym = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_", NULL, - current_program_space->symfile_object_file); + bound_minimal_symbol got_sym + = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_", NULL, + current_program_space->symfile_object_file); if (got_sym.minsym != 0) { diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c index f84ff89..062a29f 100644 --- a/gdb/solib-frv.c +++ b/gdb/solib-frv.c @@ -264,7 +264,6 @@ static CORE_ADDR lm_base (void) { bfd_endian byte_order = gdbarch_byte_order (current_inferior ()->arch ()); - struct bound_minimal_symbol got_sym; CORE_ADDR addr; gdb_byte buf[FRV_PTR_SIZE]; @@ -280,8 +279,9 @@ lm_base (void) if (lm_base_cache) return lm_base_cache; - got_sym = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_", NULL, - current_program_space->symfile_object_file); + bound_minimal_symbol got_sym + = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_", NULL, + current_program_space->symfile_object_file); if (got_sym.minsym == 0) { solib_debug_printf ("_GLOBAL_OFFSET_TABLE_ not found."); @@ -840,10 +840,9 @@ frv_relocate_section_addresses (solib &so, target_section *sec) static CORE_ADDR main_got (void) { - struct bound_minimal_symbol got_sym; - objfile *objf = current_program_space->symfile_object_file; - got_sym = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_", NULL, objf); + bound_minimal_symbol got_sym + = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_", NULL, objf); if (got_sym.minsym == 0) return 0; diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 8c3ff39..4633757 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -695,7 +695,6 @@ scan_dyntag_auxv (const int desired_dyntag, CORE_ADDR *ptr, static CORE_ADDR elf_locate_base (void) { - struct bound_minimal_symbol msymbol; CORE_ADDR dyn_ptr, dyn_ptr_addr; if (!svr4_have_link_map_offsets ()) @@ -751,8 +750,9 @@ elf_locate_base (void) /* This may be a static executable. Look for the symbol conventionally named _r_debug, as a last resort. */ - msymbol = lookup_minimal_symbol ("_r_debug", NULL, - current_program_space->symfile_object_file); + bound_minimal_symbol msymbol + = lookup_minimal_symbol ("_r_debug", NULL, + current_program_space->symfile_object_file); if (msymbol.minsym != NULL) return msymbol.value_address (); @@ -2227,7 +2227,6 @@ svr4_create_solib_event_breakpoints (svr4_info *info, struct gdbarch *gdbarch, static int enable_break (struct svr4_info *info, int from_tty) { - struct bound_minimal_symbol msymbol; const char * const *bkpt_namep; asection *interp_sect; CORE_ADDR sym_addr; @@ -2482,7 +2481,8 @@ enable_break (struct svr4_info *info, int from_tty) objfile *objf = current_program_space->symfile_object_file; for (bkpt_namep = solib_break_names; *bkpt_namep != NULL; bkpt_namep++) { - msymbol = lookup_minimal_symbol (*bkpt_namep, NULL, objf); + bound_minimal_symbol msymbol + = lookup_minimal_symbol (*bkpt_namep, NULL, objf); if ((msymbol.minsym != NULL) && (msymbol.value_address () != 0)) { @@ -2501,7 +2501,8 @@ enable_break (struct svr4_info *info, int from_tty) { for (bkpt_namep = bkpt_names; *bkpt_namep != NULL; bkpt_namep++) { - msymbol = lookup_minimal_symbol (*bkpt_namep, NULL, objf); + bound_minimal_symbol msymbol + = lookup_minimal_symbol (*bkpt_namep, NULL, objf); if ((msymbol.minsym != NULL) && (msymbol.value_address () != 0)) { diff --git a/gdb/stack.c b/gdb/stack.c index b36193b..b7a102e 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -1299,13 +1299,12 @@ find_frame_funname (const frame_info_ptr &frame, enum language *funlang, } else { - struct bound_minimal_symbol msymbol; CORE_ADDR pc; if (!get_frame_address_in_block_if_available (frame, &pc)) return funname; - msymbol = lookup_minimal_symbol_by_pc (pc); + bound_minimal_symbol msymbol = lookup_minimal_symbol_by_pc (pc); if (msymbol.minsym != NULL) { funname.reset (xstrdup (msymbol.minsym->print_name ())); @@ -1529,9 +1528,7 @@ info_frame_command_core (const frame_info_ptr &fi, bool selected_frame_p) } else if (frame_pc_p) { - struct bound_minimal_symbol msymbol; - - msymbol = lookup_minimal_symbol_by_pc (frame_pc); + bound_minimal_symbol msymbol = lookup_minimal_symbol_by_pc (frame_pc); if (msymbol.minsym != NULL) { funname = msymbol.minsym->print_name (); diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c index 3a223d0..0eccda2 100644 --- a/gdb/symfile-debug.c +++ b/gdb/symfile-debug.c @@ -399,7 +399,7 @@ objfile::expand_symtabs_matching } struct compunit_symtab * -objfile::find_pc_sect_compunit_symtab (struct bound_minimal_symbol msymbol, +objfile::find_pc_sect_compunit_symtab (bound_minimal_symbol msymbol, CORE_ADDR pc, struct obj_section *section, int warn_if_readin) diff --git a/gdb/symfile.c b/gdb/symfile.c index 06c7faf..b2d0b0f 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -3428,14 +3428,13 @@ read_target_long_array (CORE_ADDR memaddr, unsigned int *myaddr, static int simple_read_overlay_table (void) { - struct bound_minimal_symbol novlys_msym; - struct bound_minimal_symbol ovly_table_msym; struct gdbarch *gdbarch; int word_size; enum bfd_endian byte_order; simple_free_overlay_table (); - novlys_msym = lookup_minimal_symbol ("_novlys", NULL, NULL); + bound_minimal_symbol novlys_msym + = lookup_minimal_symbol ("_novlys", NULL, NULL); if (! novlys_msym.minsym) { error (_("Error reading inferior's overlay table: " @@ -3444,7 +3443,8 @@ simple_read_overlay_table (void) return 0; } - ovly_table_msym = lookup_bound_minimal_symbol ("_ovly_table"); + bound_minimal_symbol ovly_table_msym + = lookup_bound_minimal_symbol ("_ovly_table"); if (! ovly_table_msym.minsym) { error (_("Error reading inferior's overlay table: couldn't find " @@ -3523,7 +3523,7 @@ simple_overlay_update (struct obj_section *osect) { /* Does its cached location match what's currently in the symtab? */ - struct bound_minimal_symbol minsym + bound_minimal_symbol minsym = lookup_minimal_symbol ("_ovly_table", NULL, NULL); if (minsym.minsym == NULL) diff --git a/gdb/symtab.c b/gdb/symtab.c index 9d11703..c77537f 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -2892,14 +2892,14 @@ find_pc_sect_compunit_symtab (CORE_ADDR pc, struct obj_section *section) { struct compunit_symtab *best_cust = NULL; CORE_ADDR best_cust_range = 0; - struct bound_minimal_symbol msymbol; /* If we know that this is not a text address, return failure. This is necessary because we loop based on the block's high and low code addresses, which do not include the data ranges, and because we call find_pc_sect_psymtab which has a similar restriction based on the partial_symtab's texthigh and textlow. */ - msymbol = lookup_minimal_symbol_by_pc_section (pc, section); + bound_minimal_symbol msymbol + = lookup_minimal_symbol_by_pc_section (pc, section); if (msymbol.minsym && msymbol.minsym->data_p ()) return NULL; @@ -3091,7 +3091,6 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent) int len; const linetable_entry *item; const struct blockvector *bv; - struct bound_minimal_symbol msymbol; /* Info on best line seen so far, and where it starts, and its file. */ @@ -3170,13 +3169,12 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent) * check for the address being the same, to avoid an * infinite recursion. */ - msymbol = lookup_minimal_symbol_by_pc (pc); + bound_minimal_symbol msymbol = lookup_minimal_symbol_by_pc (pc); if (msymbol.minsym != NULL) if (msymbol.minsym->type () == mst_solib_trampoline) { - struct bound_minimal_symbol mfunsym - = lookup_minimal_symbol_text (msymbol.minsym->linkage_name (), - NULL); + bound_minimal_symbol mfunsym + = lookup_minimal_symbol_text (msymbol.minsym->linkage_name (), NULL); if (mfunsym.minsym == NULL) /* I eliminated this warning since it is coming out @@ -3919,7 +3917,7 @@ skip_prologue_sal (struct symtab_and_line *sal) } else { - struct bound_minimal_symbol msymbol + bound_minimal_symbol msymbol = lookup_minimal_symbol_by_pc_section (sal->pc, sal->section); if (msymbol.minsym == NULL) @@ -5290,7 +5288,7 @@ print_symbol_info (struct symbol *sym, int block, const char *last) for non-debugging symbols to gdb_stdout. */ static void -print_msymbol_info (struct bound_minimal_symbol msymbol) +print_msymbol_info (bound_minimal_symbol msymbol) { struct gdbarch *gdbarch = msymbol.objfile->arch (); const char *tmp; diff --git a/gdb/symtab.h b/gdb/symtab.h index a5631a2..4197a3a 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -2599,7 +2599,7 @@ struct symbol_search /* If msymbol is non-null, then a match was made on something for which only minimal_symbols exist. */ - struct bound_minimal_symbol msymbol; + bound_minimal_symbol msymbol; private: diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index e9bcbfd..f955557 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -2455,7 +2455,6 @@ tfind_outside_command (const char *args, int from_tty) static void info_scope_command (const char *args_in, int from_tty) { - struct bound_minimal_symbol msym; const struct block *block; const char *symname; const char *save_args = args_in; @@ -2579,17 +2578,20 @@ info_scope_command (const char *args_in, int from_tty) sym->value_block ()->entry_pc ())); break; case LOC_UNRESOLVED: - msym = lookup_minimal_symbol (sym->linkage_name (), - NULL, NULL); - if (msym.minsym == NULL) - gdb_printf ("Unresolved Static"); - else - { - gdb_printf ("static storage at address "); - gdb_printf ("%s", - paddress (gdbarch, msym.value_address ())); - } - break; + { + bound_minimal_symbol msym + = lookup_minimal_symbol (sym->linkage_name (), NULL, + NULL); + if (msym.minsym == NULL) + gdb_printf ("Unresolved Static"); + else + { + gdb_printf ("static storage at address "); + gdb_printf ("%s", + paddress (gdbarch, msym.value_address ())); + } + break; + } case LOC_OPTIMIZED_OUT: gdb_printf ("optimized out.\n"); continue; diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c index 53be866..6ec8216 100644 --- a/gdb/tui/tui-disasm.c +++ b/gdb/tui/tui-disasm.c @@ -157,11 +157,11 @@ tui_disassemble (struct gdbarch *gdbarch, static CORE_ADDR tui_find_backward_disassembly_start_address (CORE_ADDR addr) { - struct bound_minimal_symbol msym, msym_prev; - - msym = lookup_minimal_symbol_by_pc_section (addr - 1, nullptr, - lookup_msym_prefer::TEXT, - &msym_prev); + bound_minimal_symbol msym_prev; + bound_minimal_symbol msym + = lookup_minimal_symbol_by_pc_section (addr - 1, nullptr, + lookup_msym_prefer::TEXT, + &msym_prev); if (msym.minsym != nullptr) return msym.value_address (); else if (msym_prev.minsym != nullptr) @@ -402,7 +402,7 @@ tui_get_begin_asm_address (struct gdbarch **gdbarch_p, CORE_ADDR *addr_p) if (addr == 0) { - struct bound_minimal_symbol main_symbol + bound_minimal_symbol main_symbol = lookup_minimal_symbol (main_name (), nullptr, nullptr); if (main_symbol.minsym != nullptr) addr = main_symbol.value_address (); diff --git a/gdb/valops.c b/gdb/valops.c index a0e945c..af2b760 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -129,8 +129,7 @@ find_function_in_inferior (const char *name, struct objfile **objf_p) } else { - struct bound_minimal_symbol msymbol = - lookup_bound_minimal_symbol (name); + bound_minimal_symbol msymbol = lookup_bound_minimal_symbol (name); if (msymbol.minsym != NULL) { diff --git a/gdb/value.c b/gdb/value.c index aaa9ed2..b83e550 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -2988,7 +2988,7 @@ value_static_field (struct type *type, int fieldno) { /* With some compilers, e.g. HP aCC, static data members are reported as non-debuggable symbols. */ - struct bound_minimal_symbol msym + bound_minimal_symbol msym = lookup_minimal_symbol (phys_name, NULL, NULL); struct type *field_type = type->field (fieldno).type (); @@ -3171,7 +3171,7 @@ value_fn_field (struct value **arg1p, struct fn_field *f, struct type *ftype = TYPE_FN_FIELD_TYPE (f, j); const char *physname = TYPE_FN_FIELD_PHYSNAME (f, j); struct symbol *sym; - struct bound_minimal_symbol msym; + bound_minimal_symbol msym; sym = lookup_symbol (physname, nullptr, SEARCH_FUNCTION_DOMAIN, nullptr).symbol; diff --git a/gdb/x86-tdep.c b/gdb/x86-tdep.c index 5d7aa95..e50b5fb 100644 --- a/gdb/x86-tdep.c +++ b/gdb/x86-tdep.c @@ -42,7 +42,7 @@ bool x86_in_indirect_branch_thunk (CORE_ADDR pc, const char * const *register_names, int lo, int hi) { - struct bound_minimal_symbol bmfun = lookup_minimal_symbol_by_pc (pc); + bound_minimal_symbol bmfun = lookup_minimal_symbol_by_pc (pc); if (bmfun.minsym == nullptr) return false; diff --git a/gdb/z80-tdep.c b/gdb/z80-tdep.c index 23cdb68..e290b65 100644 --- a/gdb/z80-tdep.c +++ b/gdb/z80-tdep.c @@ -356,8 +356,8 @@ z80_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end, /* stage2: check for FP saving scheme */ if (prologue[pos] == 0xcd) /* call nn */ { - struct bound_minimal_symbol msymbol; - msymbol = lookup_minimal_symbol ("__sdcc_enter_ix", NULL, NULL); + bound_minimal_symbol msymbol + = lookup_minimal_symbol ("__sdcc_enter_ix", NULL, NULL); if (msymbol.minsym) { value = msymbol.value_address (); @@ -621,8 +621,8 @@ z80_frame_unwind_cache (const frame_info_ptr &this_frame, break; /* found */ for (i = sizeof(names)/sizeof(*names)-1; i >= 0; --i) { - struct bound_minimal_symbol msymbol; - msymbol = lookup_minimal_symbol (names[i], NULL, NULL); + bound_minimal_symbol msymbol + = lookup_minimal_symbol (names[i], NULL, NULL); if (!msymbol.minsym) continue; if (addr == msymbol.value_address ()) @@ -719,8 +719,8 @@ z80_breakpoint_kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr) static int addr = -1; if (addr == -1) { - struct bound_minimal_symbol bh; - bh = lookup_minimal_symbol ("_break_handler", NULL, NULL); + bound_minimal_symbol bh + = lookup_minimal_symbol ("_break_handler", NULL, NULL); if (bh.minsym) addr = bh.value_address (); else @@ -894,14 +894,13 @@ read_target_long_array (CORE_ADDR memaddr, unsigned int *myaddr, static int z80_read_overlay_region_table () { - struct bound_minimal_symbol novly_regions_msym; - struct bound_minimal_symbol ovly_region_table_msym; struct gdbarch *gdbarch; int word_size; enum bfd_endian byte_order; z80_free_overlay_region_table (); - novly_regions_msym = lookup_minimal_symbol ("_novly_regions", NULL, NULL); + bound_minimal_symbol novly_regions_msym + = lookup_minimal_symbol ("_novly_regions", NULL, NULL); if (! novly_regions_msym.minsym) { error (_("Error reading inferior's overlay table: " @@ -910,7 +909,8 @@ z80_read_overlay_region_table () return 0; } - ovly_region_table_msym = lookup_bound_minimal_symbol ("_ovly_region_table"); + bound_minimal_symbol ovly_region_table_msym + = lookup_bound_minimal_symbol ("_ovly_region_table"); if (! ovly_region_table_msym.minsym) { error (_("Error reading inferior's overlay table: couldn't find " |