use bound_minsym as result for lookup_minimal_symbol et al

This patch changes a few minimal symbol lookup functions to return a
bound_minimal_symbol rather than a pointer to the minsym.  This change
helps prepare gdb for computing a minimal symbol's address at the
point of use.

Note that this changes even those functions that ostensibly search a
single objfile.  That was necessary because, in fact, those functions
can search an objfile and its separate debug objfiles; and it is
important for the caller to know in which objfile the minimal symbol
was actually found.

The bulk of this patch is mechanical.

2014-02-26  Tom Tromey  <tromey@redhat.com>

	* ada-lang.c (ada_update_initial_language): Update.
	(ada_main_name, ada_has_this_exception_support): Update.
	* ada-tasks.c (ada_tasks_inferior_data_sniffer): Update.
	* aix-thread.c (pdc_symbol_addrs, pd_enable): Update.
	* arm-tdep.c (arm_skip_stub): Update.
	* auxv.c (ld_so_xfer_auxv): Update.
	* avr-tdep.c (avr_scan_prologue): Update.
	* ax-gdb.c (gen_var_ref): Update.
	* breakpoint.c (struct breakpoint_objfile_data)
	<overlay_msym, longjmp_msym, terminate_msym, exception_msym>: Change
	type to bound_minimal_symbol.
	(create_overlay_event_breakpoint)
	(create_longjmp_master_breakpoint)
	(create_std_terminate_master_breakpoint)
	(create_exception_master_breakpoint): Update.
	* bsd-uthread.c (bsd_uthread_lookup_address): Update.
	* c-exp.y (classify_name): Update.
	* coffread.c (coff_symfile_read): Update.
	* common/agent.c (agent_look_up_symbols): Update.
	* d-lang.c (d_main_name): Update.
	* dbxread.c (find_stab_function_addr, end_psymtab): Update.
	* dec-thread.c (enable_dec_thread): Update.
	* dwarf2loc.c (call_site_to_target_addr): Update.
	* elfread.c (elf_gnu_ifunc_resolve_by_got): Update.
	* eval.c (evaluate_subexp_standard): Update.
	* findvar.c (struct minsym_lookup_data) <result>: Change type
	to bound_minimal_symbol.
	<objfile>: Remove.
	(minsym_lookup_iterator_cb, default_read_var_value): Update.
	* frame.c (inside_main_func): Update.
	* frv-tdep.c (frv_frame_this_id): Update.
	* gcore.c (call_target_sbrk): Update.
	* glibc-tdep.c (glibc_skip_solib_resolver): Update.
	* gnu-v3-abi.c (gnuv3_get_typeid, gnuv3_skip_trampoline):
	Update.
	* go-lang.c (go_main_name): Update.
	* hppa-hpux-tdep.c (hppa_hpux_skip_trampoline_code)
	(hppa_hpux_find_import_stub_for_addr): Update.
	* hppa-tdep.c (hppa_extract_17,	hppa_lookup_stub_minimal_symbol):
	Update.  Change return type.
	* hppa-tdep.h (hppa_lookup_stub_minimal_symbol): Change return
	type.
	* jit.c (jit_breakpoint_re_set_internal): Update.
	* linux-fork.c (inferior_call_waitpid, checkpoint_command):
	Update.
	* linux-nat.c (get_signo): Update.
	* linux-thread-db.c (inferior_has_bug): Update
	* m32c-tdep.c (m32c_return_value)
	(m32c_m16c_address_to_pointer): Update.
	* m32r-tdep.c (m32r_frame_this_id): Update.
	* m68hc11-tdep.c (m68hc11_get_register_info): Update.
	* machoread.c (macho_resolve_oso_sym_with_minsym): Update.
	* minsyms.c (lookup_minimal_symbol_internal): Rename to
	lookup_minimal_symbol.  Change return type.
	(lookup_minimal_symbol): Remove.
	(lookup_bound_minimal_symbol): Update.
	(lookup_minimal_symbol_text): Change return type.
	(lookup_minimal_symbol_solib_trampoline): Change return type.
	* minsyms.h (lookup_minimal_symbol, lookup_minimal_symbol_text)
	(lookup_minimal_symbol_solib_trampoline): Change return type.
	* mips-linux-tdep.c (mips_linux_skip_resolver): Update.
	* objc-lang.c (lookup_objc_class, lookup_child_selector)
	(value_nsstring, find_imps): Update.
	* obsd-tdep.c (obsd_skip_solib_resolver): Update.
	* p-lang.c (pascal_main_name): Update.
	* ppc-linux-tdep.c (ppc_linux_spe_context_lookup): Update.
	* ppc-sysv-tdep.c (convert_code_addr_to_desc_addr): Update.
	* proc-service.c (ps_pglobal_lookup): Update.
	* ravenscar-thread.c (get_running_thread_msymbol): Change
	return type.
	(has_ravenscar_runtime, get_running_thread_id): Update.
	* remote.c (remote_check_symbols): Update.
	* sol-thread.c (ps_pglobal_lookup): Update.
	* sol2-tdep.c (sol2_skip_solib_resolver): Update.
	* solib-dsbt.c (lm_base): Update.
	* solib-frv.c (lm_base, frv_relocate_section_addresses):
	Update.
	* solib-irix.c (locate_base): Update.
	* solib-som.c (som_solib_create_inferior_hook)
	(som_solib_desire_dynamic_linker_symbols, link_map_start):
	Update.
	* solib-spu.c (spu_enable_break): Update.
	* solib-svr4.c (elf_locate_base, enable_break): Update.
	* spu-tdep.c (spu_get_overlay_table, spu_catch_start)
	(flush_ea_cache): Update.
	* stabsread.c (define_symbol): Update.
	* symfile.c (simple_read_overlay_table): Update.
	* symtab.c (find_pc_sect_line): Update.
	* tracepoint.c (scope_info): Update.
	* tui-disasm.c (tui_get_begin_asm_address): Update.
	* value.c (value_static_field): Update.
This commit is contained in:
Tom Tromey 2013-10-14 19:53:29 -06:00
parent 40c1a00737
commit 3b7344d5ab
63 changed files with 484 additions and 375 deletions

View file

@ -1,3 +1,97 @@
2014-02-26 Tom Tromey <tromey@redhat.com>
* ada-lang.c (ada_update_initial_language): Update.
(ada_main_name, ada_has_this_exception_support): Update.
* ada-tasks.c (ada_tasks_inferior_data_sniffer): Update.
* aix-thread.c (pdc_symbol_addrs, pd_enable): Update.
* arm-tdep.c (arm_skip_stub): Update.
* auxv.c (ld_so_xfer_auxv): Update.
* avr-tdep.c (avr_scan_prologue): Update.
* ax-gdb.c (gen_var_ref): Update.
* breakpoint.c (struct breakpoint_objfile_data)
<overlay_msym, longjmp_msym, terminate_msym, exception_msym>: Change
type to bound_minimal_symbol.
(create_overlay_event_breakpoint)
(create_longjmp_master_breakpoint)
(create_std_terminate_master_breakpoint)
(create_exception_master_breakpoint): Update.
* bsd-uthread.c (bsd_uthread_lookup_address): Update.
* c-exp.y (classify_name): Update.
* coffread.c (coff_symfile_read): Update.
* common/agent.c (agent_look_up_symbols): Update.
* d-lang.c (d_main_name): Update.
* dbxread.c (find_stab_function_addr, end_psymtab): Update.
* dec-thread.c (enable_dec_thread): Update.
* dwarf2loc.c (call_site_to_target_addr): Update.
* elfread.c (elf_gnu_ifunc_resolve_by_got): Update.
* eval.c (evaluate_subexp_standard): Update.
* findvar.c (struct minsym_lookup_data) <result>: Change type
to bound_minimal_symbol.
<objfile>: Remove.
(minsym_lookup_iterator_cb, default_read_var_value): Update.
* frame.c (inside_main_func): Update.
* frv-tdep.c (frv_frame_this_id): Update.
* gcore.c (call_target_sbrk): Update.
* glibc-tdep.c (glibc_skip_solib_resolver): Update.
* gnu-v3-abi.c (gnuv3_get_typeid, gnuv3_skip_trampoline):
Update.
* go-lang.c (go_main_name): Update.
* hppa-hpux-tdep.c (hppa_hpux_skip_trampoline_code)
(hppa_hpux_find_import_stub_for_addr): Update.
* hppa-tdep.c (hppa_extract_17, hppa_lookup_stub_minimal_symbol):
Update. Change return type.
* hppa-tdep.h (hppa_lookup_stub_minimal_symbol): Change return
type.
* jit.c (jit_breakpoint_re_set_internal): Update.
* linux-fork.c (inferior_call_waitpid, checkpoint_command):
Update.
* linux-nat.c (get_signo): Update.
* linux-thread-db.c (inferior_has_bug): Update
* m32c-tdep.c (m32c_return_value)
(m32c_m16c_address_to_pointer): Update.
* m32r-tdep.c (m32r_frame_this_id): Update.
* m68hc11-tdep.c (m68hc11_get_register_info): Update.
* machoread.c (macho_resolve_oso_sym_with_minsym): Update.
* minsyms.c (lookup_minimal_symbol_internal): Rename to
lookup_minimal_symbol. Change return type.
(lookup_minimal_symbol): Remove.
(lookup_bound_minimal_symbol): Update.
(lookup_minimal_symbol_text): Change return type.
(lookup_minimal_symbol_solib_trampoline): Change return type.
* minsyms.h (lookup_minimal_symbol, lookup_minimal_symbol_text)
(lookup_minimal_symbol_solib_trampoline): Change return type.
* mips-linux-tdep.c (mips_linux_skip_resolver): Update.
* objc-lang.c (lookup_objc_class, lookup_child_selector)
(value_nsstring, find_imps): Update.
* obsd-tdep.c (obsd_skip_solib_resolver): Update.
* p-lang.c (pascal_main_name): Update.
* ppc-linux-tdep.c (ppc_linux_spe_context_lookup): Update.
* ppc-sysv-tdep.c (convert_code_addr_to_desc_addr): Update.
* proc-service.c (ps_pglobal_lookup): Update.
* ravenscar-thread.c (get_running_thread_msymbol): Change
return type.
(has_ravenscar_runtime, get_running_thread_id): Update.
* remote.c (remote_check_symbols): Update.
* sol-thread.c (ps_pglobal_lookup): Update.
* sol2-tdep.c (sol2_skip_solib_resolver): Update.
* solib-dsbt.c (lm_base): Update.
* solib-frv.c (lm_base, frv_relocate_section_addresses):
Update.
* solib-irix.c (locate_base): Update.
* solib-som.c (som_solib_create_inferior_hook)
(som_solib_desire_dynamic_linker_symbols, link_map_start):
Update.
* solib-spu.c (spu_enable_break): Update.
* solib-svr4.c (elf_locate_base, enable_break): Update.
* spu-tdep.c (spu_get_overlay_table, spu_catch_start)
(flush_ea_cache): Update.
* stabsread.c (define_symbol): Update.
* symfile.c (simple_read_overlay_table): Update.
* symtab.c (find_pc_sect_line): Update.
* tracepoint.c (scope_info): Update.
* tui-disasm.c (tui_get_begin_asm_address): Update.
* value.c (value_static_field): Update.
2014-02-26 Tom Tromey <tromey@redhat.com> 2014-02-26 Tom Tromey <tromey@redhat.com>
* minsyms.c (prim_record_minimal_symbol_full): Use * minsyms.c (prim_record_minimal_symbol_full): Use

View file

@ -894,7 +894,7 @@ enum language
ada_update_initial_language (enum language lang) ada_update_initial_language (enum language lang)
{ {
if (lookup_minimal_symbol ("adainit", (const char *) NULL, if (lookup_minimal_symbol ("adainit", (const char *) NULL,
(struct objfile *) NULL) != NULL) (struct objfile *) NULL).minsym != NULL)
return language_ada; return language_ada;
return lang; return lang;
@ -907,7 +907,7 @@ ada_update_initial_language (enum language lang)
char * char *
ada_main_name (void) ada_main_name (void)
{ {
struct minimal_symbol *msym; struct bound_minimal_symbol msym;
static char *main_program_name = NULL; static char *main_program_name = NULL;
/* For Ada, the name of the main procedure is stored in a specific /* For Ada, the name of the main procedure is stored in a specific
@ -917,12 +917,12 @@ ada_main_name (void)
in Ada. */ in Ada. */
msym = lookup_minimal_symbol (ADA_MAIN_PROGRAM_SYMBOL_NAME, NULL, NULL); msym = lookup_minimal_symbol (ADA_MAIN_PROGRAM_SYMBOL_NAME, NULL, NULL);
if (msym != NULL) if (msym.minsym != NULL)
{ {
CORE_ADDR main_program_name_addr; CORE_ADDR main_program_name_addr;
int err_code; int err_code;
main_program_name_addr = MSYMBOL_VALUE_ADDRESS (msym); main_program_name_addr = MSYMBOL_VALUE_ADDRESS (msym.minsym);
if (main_program_name_addr == 0) if (main_program_name_addr == 0)
error (_("Invalid address for Ada main program name.")); error (_("Invalid address for Ada main program name."));
@ -11317,10 +11317,10 @@ ada_has_this_exception_support (const struct exception_support_info *einfo)
the name of the exception being raised (this name is printed in the name of the exception being raised (this name is printed in
the catchpoint message, and is also used when trying to catch the catchpoint message, and is also used when trying to catch
a specific exception). We do not handle this case for now. */ a specific exception). We do not handle this case for now. */
struct minimal_symbol *msym struct bound_minimal_symbol msym
= lookup_minimal_symbol (einfo->catch_exception_sym, NULL, NULL); = lookup_minimal_symbol (einfo->catch_exception_sym, NULL, NULL);
if (msym && MSYMBOL_TYPE (msym) != mst_solib_trampoline) if (msym.minsym && MSYMBOL_TYPE (msym.minsym) != mst_solib_trampoline)
error (_("Your Ada runtime appears to be missing some debugging " error (_("Your Ada runtime appears to be missing some debugging "
"information.\nCannot insert Ada exception catchpoint " "information.\nCannot insert Ada exception catchpoint "
"in this configuration.")); "in this configuration."));

View file

@ -846,7 +846,7 @@ read_known_tasks_list (struct ada_tasks_inferior_data *data)
static void static void
ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data) ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data)
{ {
struct minimal_symbol *msym; struct bound_minimal_symbol msym;
struct symbol *sym; struct symbol *sym;
/* Return now if already set. */ /* Return now if already set. */
@ -856,10 +856,10 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data)
/* Try array. */ /* Try array. */
msym = lookup_minimal_symbol (KNOWN_TASKS_NAME, NULL, NULL); msym = lookup_minimal_symbol (KNOWN_TASKS_NAME, NULL, NULL);
if (msym != NULL) if (msym.minsym != NULL)
{ {
data->known_tasks_kind = ADA_TASKS_ARRAY; data->known_tasks_kind = ADA_TASKS_ARRAY;
data->known_tasks_addr = MSYMBOL_VALUE_ADDRESS (msym); data->known_tasks_addr = MSYMBOL_VALUE_ADDRESS (msym.minsym);
/* Try to get pointer type and array length from the symtab. */ /* Try to get pointer type and array length from the symtab. */
sym = lookup_symbol_in_language (KNOWN_TASKS_NAME, NULL, VAR_DOMAIN, sym = lookup_symbol_in_language (KNOWN_TASKS_NAME, NULL, VAR_DOMAIN,
@ -901,10 +901,10 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data)
/* Try list. */ /* Try list. */
msym = lookup_minimal_symbol (KNOWN_TASKS_LIST, NULL, NULL); msym = lookup_minimal_symbol (KNOWN_TASKS_LIST, NULL, NULL);
if (msym != NULL) if (msym.minsym != NULL)
{ {
data->known_tasks_kind = ADA_TASKS_LIST; data->known_tasks_kind = ADA_TASKS_LIST;
data->known_tasks_addr = MSYMBOL_VALUE_ADDRESS (msym); data->known_tasks_addr = MSYMBOL_VALUE_ADDRESS (msym.minsym);
data->known_tasks_length = 1; data->known_tasks_length = 1;
sym = lookup_symbol_in_language (KNOWN_TASKS_LIST, NULL, VAR_DOMAIN, sym = lookup_symbol_in_language (KNOWN_TASKS_LIST, NULL, VAR_DOMAIN,

View file

@ -286,7 +286,7 @@ pid_to_prc (ptid_t *ptidp)
static int static int
pdc_symbol_addrs (pthdb_user_t user, pthdb_symbol_t *symbols, int count) pdc_symbol_addrs (pthdb_user_t user, pthdb_symbol_t *symbols, int count)
{ {
struct minimal_symbol *ms; struct bound_minimal_symbol ms;
int i; int i;
char *name; char *name;
@ -306,13 +306,14 @@ pdc_symbol_addrs (pthdb_user_t user, pthdb_symbol_t *symbols, int count)
symbols[i].addr = 0; symbols[i].addr = 0;
else else
{ {
if (!(ms = lookup_minimal_symbol (name, NULL, NULL))) ms = lookup_minimal_symbol (name, NULL, NULL);
if (ms.minsym == NULL)
{ {
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, " returning PDC_FAILURE\n"); fprintf_unfiltered (gdb_stdlog, " returning PDC_FAILURE\n");
return PDC_FAILURE; return PDC_FAILURE;
} }
symbols[i].addr = MSYMBOL_VALUE_ADDRESS (ms); symbols[i].addr = MSYMBOL_VALUE_ADDRESS (ms.minsym);
} }
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, " symbols[%d].addr = %s\n", fprintf_unfiltered (gdb_stdlog, " symbols[%d].addr = %s\n",
@ -890,7 +891,7 @@ pd_enable (void)
{ {
int status; int status;
char *stub_name; char *stub_name;
struct minimal_symbol *ms; struct bound_minimal_symbol ms;
/* Don't initialize twice. */ /* Don't initialize twice. */
if (pd_able) if (pd_able)
@ -908,9 +909,10 @@ pd_enable (void)
return; return;
/* Set a breakpoint on the returned stub function. */ /* Set a breakpoint on the returned stub function. */
if (!(ms = lookup_minimal_symbol (stub_name, NULL, NULL))) ms = lookup_minimal_symbol (stub_name, NULL, NULL);
if (ms.minsym == NULL)
return; return;
pd_brk_addr = MSYMBOL_VALUE_ADDRESS (ms); pd_brk_addr = MSYMBOL_VALUE_ADDRESS (ms.minsym);
if (!create_thread_event_breakpoint (target_gdbarch (), pd_brk_addr)) if (!create_thread_event_breakpoint (target_gdbarch (), pd_brk_addr))
return; return;

View file

@ -9263,7 +9263,7 @@ arm_skip_stub (struct frame_info *frame, CORE_ADDR pc)
{ {
char *target_name; char *target_name;
int target_len = namelen - 2; int target_len = namelen - 2;
struct minimal_symbol *minsym; struct bound_minimal_symbol minsym;
struct objfile *objfile; struct objfile *objfile;
struct obj_section *sec; struct obj_section *sec;
@ -9279,8 +9279,8 @@ arm_skip_stub (struct frame_info *frame, CORE_ADDR pc)
sec = find_pc_section (pc); sec = find_pc_section (pc);
objfile = (sec == NULL) ? NULL : sec->objfile; objfile = (sec == NULL) ? NULL : sec->objfile;
minsym = lookup_minimal_symbol (target_name, NULL, objfile); minsym = lookup_minimal_symbol (target_name, NULL, objfile);
if (minsym != NULL) if (minsym.minsym != NULL)
return MSYMBOL_VALUE_ADDRESS (minsym); return MSYMBOL_VALUE_ADDRESS (minsym.minsym);
else else
return 0; return 0;
} }

View file

@ -85,7 +85,7 @@ ld_so_xfer_auxv (gdb_byte *readbuf,
ULONGEST offset, ULONGEST offset,
ULONGEST len, ULONGEST *xfered_len) ULONGEST len, ULONGEST *xfered_len)
{ {
struct minimal_symbol *msym; struct bound_minimal_symbol msym;
CORE_ADDR data_address, pointer_address; CORE_ADDR data_address, pointer_address;
struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr; struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
size_t ptr_size = TYPE_LENGTH (ptr_type); size_t ptr_size = TYPE_LENGTH (ptr_type);
@ -95,17 +95,17 @@ ld_so_xfer_auxv (gdb_byte *readbuf,
size_t block; size_t block;
msym = lookup_minimal_symbol ("_dl_auxv", NULL, NULL); msym = lookup_minimal_symbol ("_dl_auxv", NULL, NULL);
if (msym == NULL) if (msym.minsym == NULL)
return TARGET_XFER_E_IO; return TARGET_XFER_E_IO;
if (MSYMBOL_SIZE (msym) != ptr_size) if (MSYMBOL_SIZE (msym.minsym) != ptr_size)
return TARGET_XFER_E_IO; return TARGET_XFER_E_IO;
/* POINTER_ADDRESS is a location where the `_dl_auxv' variable /* POINTER_ADDRESS is a location where the `_dl_auxv' variable
resides. DATA_ADDRESS is the inferior value present in resides. DATA_ADDRESS is the inferior value present in
`_dl_auxv', therefore the real inferior AUXV address. */ `_dl_auxv', therefore the real inferior AUXV address. */
pointer_address = MSYMBOL_VALUE_ADDRESS (msym); pointer_address = MSYMBOL_VALUE_ADDRESS (msym.minsym);
/* The location of the _dl_auxv symbol may no longer be correct if /* The location of the _dl_auxv symbol may no longer be correct if
ld.so runs at a different address than the one present in the ld.so runs at a different address than the one present in the

View file

@ -492,7 +492,7 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
int i; int i;
unsigned short insn; unsigned short insn;
int scan_stage = 0; int scan_stage = 0;
struct minimal_symbol *msymbol; struct bound_minimal_symbol msymbol;
unsigned char prologue[AVR_MAX_PROLOGUE_SIZE]; unsigned char prologue[AVR_MAX_PROLOGUE_SIZE];
int vpc = 0; int vpc = 0;
int len; int len;
@ -586,7 +586,7 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
pc_offset += 2; pc_offset += 2;
msymbol = lookup_minimal_symbol ("__prologue_saves__", NULL, NULL); msymbol = lookup_minimal_symbol ("__prologue_saves__", NULL, NULL);
if (!msymbol) if (!msymbol.minsym)
break; break;
insn = extract_unsigned_integer (&prologue[vpc + 8], 2, byte_order); insn = extract_unsigned_integer (&prologue[vpc + 8], 2, byte_order);
@ -624,7 +624,8 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
/* Resolve offset (in words) from __prologue_saves__ symbol. /* Resolve offset (in words) from __prologue_saves__ symbol.
Which is a pushes count in `-mcall-prologues' mode */ Which is a pushes count in `-mcall-prologues' mode */
num_pushes = AVR_MAX_PUSHES - (i - MSYMBOL_VALUE_ADDRESS (msymbol)) / 2; num_pushes = (AVR_MAX_PUSHES
- (i - MSYMBOL_VALUE_ADDRESS (msymbol.minsym)) / 2);
if (num_pushes > AVR_MAX_PUSHES) if (num_pushes > AVR_MAX_PUSHES)
{ {

View file

@ -712,14 +712,14 @@ gen_var_ref (struct gdbarch *gdbarch, struct agent_expr *ax,
case LOC_UNRESOLVED: case LOC_UNRESOLVED:
{ {
struct minimal_symbol *msym struct bound_minimal_symbol msym
= lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (var), NULL, NULL); = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (var), NULL, NULL);
if (!msym) if (!msym.minsym)
error (_("Couldn't resolve symbol `%s'."), SYMBOL_PRINT_NAME (var)); error (_("Couldn't resolve symbol `%s'."), SYMBOL_PRINT_NAME (var));
/* Push the address of the variable. */ /* Push the address of the variable. */
ax_const_l (ax, MSYMBOL_VALUE_ADDRESS (msym)); ax_const_l (ax, MSYMBOL_VALUE_ADDRESS (msym.minsym));
value->kind = axs_lvalue_memory; value->kind = axs_lvalue_memory;
} }
break; break;

View file

@ -3146,10 +3146,10 @@ static const char *const longjmp_names[] =
struct breakpoint_objfile_data struct breakpoint_objfile_data
{ {
/* Minimal symbol for "_ovly_debug_event" (if any). */ /* Minimal symbol for "_ovly_debug_event" (if any). */
struct minimal_symbol *overlay_msym; struct bound_minimal_symbol overlay_msym;
/* Minimal symbol(s) for "longjmp", "siglongjmp", etc. (if any). */ /* Minimal symbol(s) for "longjmp", "siglongjmp", etc. (if any). */
struct minimal_symbol *longjmp_msym[NUM_LONGJMP_NAMES]; struct bound_minimal_symbol longjmp_msym[NUM_LONGJMP_NAMES];
/* True if we have looked for longjmp probes. */ /* True if we have looked for longjmp probes. */
int longjmp_searched; int longjmp_searched;
@ -3158,10 +3158,10 @@ struct breakpoint_objfile_data
VEC (probe_p) *longjmp_probes; VEC (probe_p) *longjmp_probes;
/* Minimal symbol for "std::terminate()" (if any). */ /* Minimal symbol for "std::terminate()" (if any). */
struct minimal_symbol *terminate_msym; struct bound_minimal_symbol terminate_msym;
/* Minimal symbol for "_Unwind_DebugHook" (if any). */ /* Minimal symbol for "_Unwind_DebugHook" (if any). */
struct minimal_symbol *exception_msym; struct bound_minimal_symbol exception_msym;
/* True if we have looked for exception probes. */ /* True if we have looked for exception probes. */
int exception_searched; int exception_searched;
@ -3226,24 +3226,24 @@ create_overlay_event_breakpoint (void)
bp_objfile_data = get_breakpoint_objfile_data (objfile); bp_objfile_data = get_breakpoint_objfile_data (objfile);
if (msym_not_found_p (bp_objfile_data->overlay_msym)) if (msym_not_found_p (bp_objfile_data->overlay_msym.minsym))
continue; continue;
if (bp_objfile_data->overlay_msym == NULL) if (bp_objfile_data->overlay_msym.minsym == NULL)
{ {
struct minimal_symbol *m; struct bound_minimal_symbol m;
m = lookup_minimal_symbol_text (func_name, objfile); m = lookup_minimal_symbol_text (func_name, objfile);
if (m == NULL) if (m.minsym == NULL)
{ {
/* Avoid future lookups in this objfile. */ /* Avoid future lookups in this objfile. */
bp_objfile_data->overlay_msym = &msym_not_found; bp_objfile_data->overlay_msym.minsym = &msym_not_found;
continue; continue;
} }
bp_objfile_data->overlay_msym = m; bp_objfile_data->overlay_msym = m;
} }
addr = MSYMBOL_VALUE_ADDRESS (bp_objfile_data->overlay_msym); addr = MSYMBOL_VALUE_ADDRESS (bp_objfile_data->overlay_msym.minsym);
b = create_internal_breakpoint (get_objfile_arch (objfile), addr, b = create_internal_breakpoint (get_objfile_arch (objfile), addr,
bp_overlay_event, bp_overlay_event,
&internal_breakpoint_ops); &internal_breakpoint_ops);
@ -3342,25 +3342,25 @@ create_longjmp_master_breakpoint (void)
const char *func_name; const char *func_name;
CORE_ADDR addr; CORE_ADDR addr;
if (msym_not_found_p (bp_objfile_data->longjmp_msym[i])) if (msym_not_found_p (bp_objfile_data->longjmp_msym[i].minsym))
continue; continue;
func_name = longjmp_names[i]; func_name = longjmp_names[i];
if (bp_objfile_data->longjmp_msym[i] == NULL) if (bp_objfile_data->longjmp_msym[i].minsym == NULL)
{ {
struct minimal_symbol *m; struct bound_minimal_symbol m;
m = lookup_minimal_symbol_text (func_name, objfile); m = lookup_minimal_symbol_text (func_name, objfile);
if (m == NULL) if (m.minsym == NULL)
{ {
/* Prevent future lookups in this objfile. */ /* Prevent future lookups in this objfile. */
bp_objfile_data->longjmp_msym[i] = &msym_not_found; bp_objfile_data->longjmp_msym[i].minsym = &msym_not_found;
continue; continue;
} }
bp_objfile_data->longjmp_msym[i] = m; bp_objfile_data->longjmp_msym[i] = m;
} }
addr = MSYMBOL_VALUE_ADDRESS (bp_objfile_data->longjmp_msym[i]); addr = MSYMBOL_VALUE_ADDRESS (bp_objfile_data->longjmp_msym[i].minsym);
b = create_internal_breakpoint (gdbarch, addr, bp_longjmp_master, b = create_internal_breakpoint (gdbarch, addr, bp_longjmp_master,
&internal_breakpoint_ops); &internal_breakpoint_ops);
b->addr_string = xstrdup (func_name); b->addr_string = xstrdup (func_name);
@ -3397,25 +3397,25 @@ create_std_terminate_master_breakpoint (void)
bp_objfile_data = get_breakpoint_objfile_data (objfile); bp_objfile_data = get_breakpoint_objfile_data (objfile);
if (msym_not_found_p (bp_objfile_data->terminate_msym)) if (msym_not_found_p (bp_objfile_data->terminate_msym.minsym))
continue; continue;
if (bp_objfile_data->terminate_msym == NULL) if (bp_objfile_data->terminate_msym.minsym == NULL)
{ {
struct minimal_symbol *m; struct bound_minimal_symbol m;
m = lookup_minimal_symbol (func_name, NULL, objfile); m = lookup_minimal_symbol (func_name, NULL, objfile);
if (m == NULL || (MSYMBOL_TYPE (m) != mst_text if (m.minsym == NULL || (MSYMBOL_TYPE (m.minsym) != mst_text
&& MSYMBOL_TYPE (m) != mst_file_text)) && MSYMBOL_TYPE (m.minsym) != mst_file_text))
{ {
/* Prevent future lookups in this objfile. */ /* Prevent future lookups in this objfile. */
bp_objfile_data->terminate_msym = &msym_not_found; bp_objfile_data->terminate_msym.minsym = &msym_not_found;
continue; continue;
} }
bp_objfile_data->terminate_msym = m; bp_objfile_data->terminate_msym = m;
} }
addr = MSYMBOL_VALUE_ADDRESS (bp_objfile_data->terminate_msym); addr = MSYMBOL_VALUE_ADDRESS (bp_objfile_data->terminate_msym.minsym);
b = create_internal_breakpoint (get_objfile_arch (objfile), addr, b = create_internal_breakpoint (get_objfile_arch (objfile), addr,
bp_std_terminate_master, bp_std_terminate_master,
&internal_breakpoint_ops); &internal_breakpoint_ops);
@ -3496,26 +3496,26 @@ create_exception_master_breakpoint (void)
/* Otherwise, try the hook function. */ /* Otherwise, try the hook function. */
if (msym_not_found_p (bp_objfile_data->exception_msym)) if (msym_not_found_p (bp_objfile_data->exception_msym.minsym))
continue; continue;
gdbarch = get_objfile_arch (objfile); gdbarch = get_objfile_arch (objfile);
if (bp_objfile_data->exception_msym == NULL) if (bp_objfile_data->exception_msym.minsym == NULL)
{ {
struct minimal_symbol *debug_hook; struct bound_minimal_symbol debug_hook;
debug_hook = lookup_minimal_symbol (func_name, NULL, objfile); debug_hook = lookup_minimal_symbol (func_name, NULL, objfile);
if (debug_hook == NULL) if (debug_hook.minsym == NULL)
{ {
bp_objfile_data->exception_msym = &msym_not_found; bp_objfile_data->exception_msym.minsym = &msym_not_found;
continue; continue;
} }
bp_objfile_data->exception_msym = debug_hook; bp_objfile_data->exception_msym = debug_hook;
} }
addr = MSYMBOL_VALUE_ADDRESS (bp_objfile_data->exception_msym); addr = MSYMBOL_VALUE_ADDRESS (bp_objfile_data->exception_msym.minsym);
addr = gdbarch_convert_from_func_ptr_addr (gdbarch, addr, addr = gdbarch_convert_from_func_ptr_addr (gdbarch, addr,
&current_target); &current_target);
b = create_internal_breakpoint (gdbarch, addr, bp_exception_master, b = create_internal_breakpoint (gdbarch, addr, bp_exception_master,

View file

@ -125,11 +125,11 @@ static int bsd_uthread_active;
static CORE_ADDR static CORE_ADDR
bsd_uthread_lookup_address (const char *name, struct objfile *objfile) bsd_uthread_lookup_address (const char *name, struct objfile *objfile)
{ {
struct minimal_symbol *sym; struct bound_minimal_symbol sym;
sym = lookup_minimal_symbol (name, NULL, objfile); sym = lookup_minimal_symbol (name, NULL, objfile);
if (sym) if (sym.minsym)
return MSYMBOL_VALUE_ADDRESS (sym); return MSYMBOL_VALUE_ADDRESS (sym.minsym);
return 0; return 0;
} }

View file

@ -2935,7 +2935,7 @@ classify_name (const struct block *block, int is_quoted_name)
if (sym == NULL if (sym == NULL
&& parse_language->la_language == language_cplus && parse_language->la_language == language_cplus
&& is_a_field_of_this.type == NULL && is_a_field_of_this.type == NULL
&& !lookup_minimal_symbol (copy, NULL, NULL)) && lookup_minimal_symbol (copy, NULL, NULL).minsym == NULL)
return UNKNOWN_CPP_NAME; return UNKNOWN_CPP_NAME;
return NAME; return NAME;

View file

@ -680,14 +680,15 @@ coff_symfile_read (struct objfile *objfile, int symfile_flags)
|| strncmp (name, "_imp_", 5) == 0)) || strncmp (name, "_imp_", 5) == 0))
{ {
const char *name1 = (name[1] == '_' ? &name[7] : &name[6]); const char *name1 = (name[1] == '_' ? &name[7] : &name[6]);
struct minimal_symbol *found; struct bound_minimal_symbol found;
found = lookup_minimal_symbol (name1, NULL, objfile); found = lookup_minimal_symbol (name1, NULL, objfile);
/* If found, there are symbols named "_imp_foo" and "foo" /* If found, there are symbols named "_imp_foo" and "foo"
respectively in OBJFILE. Set the type of symbol "foo" respectively in OBJFILE. Set the type of symbol "foo"
as 'mst_solib_trampoline'. */ as 'mst_solib_trampoline'. */
if (found != NULL && MSYMBOL_TYPE (found) == mst_text) if (found.minsym != NULL
MSYMBOL_TYPE (found) = mst_solib_trampoline; && MSYMBOL_TYPE (found.minsym) == mst_text)
MSYMBOL_TYPE (found.minsym) = mst_solib_trampoline;
} }
} }
} }

View file

@ -98,12 +98,12 @@ agent_look_up_symbols (void *arg)
if (look_up_one_symbol (symbol_list[i].name, addrp, 1) == 0) if (look_up_one_symbol (symbol_list[i].name, addrp, 1) == 0)
#else #else
struct minimal_symbol *sym = struct bound_minimal_symbol sym =
lookup_minimal_symbol (symbol_list[i].name, NULL, lookup_minimal_symbol (symbol_list[i].name, NULL,
(struct objfile *) arg); (struct objfile *) arg);
if (sym != NULL) if (sym.minsym != NULL)
*addrp = MSYMBOL_VALUE_ADDRESS (sym); *addrp = MSYMBOL_VALUE_ADDRESS (sym.minsym);
else else
#endif #endif
{ {

View file

@ -37,10 +37,10 @@ static const char D_MAIN[] = "D main";
const char * const char *
d_main_name (void) d_main_name (void)
{ {
struct minimal_symbol *msym; struct bound_minimal_symbol msym;
msym = lookup_minimal_symbol (D_MAIN, NULL, NULL); msym = lookup_minimal_symbol (D_MAIN, NULL, NULL);
if (msym != NULL) if (msym.minsym != NULL)
return D_MAIN; return D_MAIN;
/* No known entry procedure found, the main program is probably not D. */ /* No known entry procedure found, the main program is probably not D. */

View file

@ -1133,7 +1133,7 @@ static CORE_ADDR
find_stab_function_addr (char *namestring, const char *filename, find_stab_function_addr (char *namestring, const char *filename,
struct objfile *objfile) struct objfile *objfile)
{ {
struct minimal_symbol *msym; struct bound_minimal_symbol msym;
char *p; char *p;
int n; int n;
@ -1146,7 +1146,7 @@ find_stab_function_addr (char *namestring, const char *filename,
p[n] = 0; p[n] = 0;
msym = lookup_minimal_symbol (p, filename, objfile); msym = lookup_minimal_symbol (p, filename, objfile);
if (msym == NULL) if (msym.minsym == NULL)
{ {
/* Sun Fortran appends an underscore to the minimal symbol name, /* Sun Fortran appends an underscore to the minimal symbol name,
try again with an appended underscore if the minimal symbol try again with an appended underscore if the minimal symbol
@ -1156,13 +1156,13 @@ find_stab_function_addr (char *namestring, const char *filename,
msym = lookup_minimal_symbol (p, filename, objfile); msym = lookup_minimal_symbol (p, filename, objfile);
} }
if (msym == NULL && filename != NULL) if (msym.minsym == NULL && filename != NULL)
{ {
/* Try again without the filename. */ /* Try again without the filename. */
p[n] = 0; p[n] = 0;
msym = lookup_minimal_symbol (p, NULL, objfile); msym = lookup_minimal_symbol (p, NULL, objfile);
} }
if (msym == NULL && filename != NULL) if (msym.minsym == NULL && filename != NULL)
{ {
/* And try again for Sun Fortran, but without the filename. */ /* And try again for Sun Fortran, but without the filename. */
p[n] = '_'; p[n] = '_';
@ -1170,7 +1170,7 @@ find_stab_function_addr (char *namestring, const char *filename,
msym = lookup_minimal_symbol (p, NULL, objfile); msym = lookup_minimal_symbol (p, NULL, objfile);
} }
return msym == NULL ? 0 : MSYMBOL_VALUE_ADDRESS (msym); return msym.minsym == NULL ? 0 : MSYMBOL_VALUE_ADDRESS (msym.minsym);
} }
static void static void
@ -2256,7 +2256,7 @@ end_psymtab (struct objfile *objfile, struct partial_symtab *pst,
{ {
char *p; char *p;
int n; int n;
struct minimal_symbol *minsym; struct bound_minimal_symbol minsym;
p = strchr (last_function_name, ':'); p = strchr (last_function_name, ':');
if (p == NULL) if (p == NULL)
@ -2267,7 +2267,7 @@ end_psymtab (struct objfile *objfile, struct partial_symtab *pst,
p[n] = 0; p[n] = 0;
minsym = lookup_minimal_symbol (p, pst->filename, objfile); minsym = lookup_minimal_symbol (p, pst->filename, objfile);
if (minsym == NULL) if (minsym.minsym == NULL)
{ {
/* Sun Fortran appends an underscore to the minimal symbol name, /* Sun Fortran appends an underscore to the minimal symbol name,
try again with an appended underscore if the minimal symbol try again with an appended underscore if the minimal symbol
@ -2277,8 +2277,9 @@ end_psymtab (struct objfile *objfile, struct partial_symtab *pst,
minsym = lookup_minimal_symbol (p, pst->filename, objfile); minsym = lookup_minimal_symbol (p, pst->filename, objfile);
} }
if (minsym) if (minsym.minsym)
pst->texthigh = MSYMBOL_VALUE_ADDRESS (minsym) + MSYMBOL_SIZE (minsym); pst->texthigh = (MSYMBOL_VALUE_ADDRESS (minsym.minsym)
+ MSYMBOL_SIZE (minsym.minsym));
last_function_name = NULL; last_function_name = NULL;
} }

View file

@ -225,7 +225,7 @@ static pthreadDebugCallbacks_t debug_callbacks =
static void static void
enable_dec_thread (void) enable_dec_thread (void)
{ {
struct minimal_symbol *msym; struct bound_minimal_symbol msym;
void* caller_context; void* caller_context;
int status; int status;
@ -234,14 +234,14 @@ enable_dec_thread (void)
return; return;
msym = lookup_minimal_symbol ("__pthread_dbg_symtable", NULL, NULL); msym = lookup_minimal_symbol ("__pthread_dbg_symtable", NULL, NULL);
if (msym == NULL) if (msym.minsym == NULL)
{ {
debug ("enable_dec_thread: No __pthread_dbg_symtable"); debug ("enable_dec_thread: No __pthread_dbg_symtable");
return; return;
} }
status = pthreadDebugContextInit (&caller_context, &debug_callbacks, status = pthreadDebugContextInit (&caller_context, &debug_callbacks,
(void *) SYMBOL_VALUE_ADDRESS (msym), (void *) SYMBOL_VALUE_ADDRESS (msym.minsym),
&debug_context); &debug_context);
if (status != ESUCCESS) if (status != ESUCCESS)
{ {

View file

@ -588,23 +588,24 @@ call_site_to_target_addr (struct gdbarch *call_site_gdbarch,
case FIELD_LOC_KIND_PHYSNAME: case FIELD_LOC_KIND_PHYSNAME:
{ {
const char *physname; const char *physname;
struct minimal_symbol *msym; struct bound_minimal_symbol msym;
physname = FIELD_STATIC_PHYSNAME (call_site->target); physname = FIELD_STATIC_PHYSNAME (call_site->target);
/* Handle both the mangled and demangled PHYSNAME. */ /* Handle both the mangled and demangled PHYSNAME. */
msym = lookup_minimal_symbol (physname, NULL, NULL); msym = lookup_minimal_symbol (physname, NULL, NULL);
if (msym == NULL) if (msym.minsym == NULL)
{ {
msym = lookup_minimal_symbol_by_pc (call_site->pc - 1).minsym; msym = lookup_minimal_symbol_by_pc (call_site->pc - 1);
throw_error (NO_ENTRY_VALUE_ERROR, throw_error (NO_ENTRY_VALUE_ERROR,
_("Cannot find function \"%s\" for a call site target " _("Cannot find function \"%s\" for a call site target "
"at %s in %s"), "at %s in %s"),
physname, paddress (call_site_gdbarch, call_site->pc), physname, paddress (call_site_gdbarch, call_site->pc),
msym == NULL ? "???" : MSYMBOL_PRINT_NAME (msym)); (msym.minsym == NULL ? "???"
: MSYMBOL_PRINT_NAME (msym.minsym)));
} }
return MSYMBOL_VALUE_ADDRESS (msym); return MSYMBOL_VALUE_ADDRESS (msym.minsym);
} }
case FIELD_LOC_KIND_PHYSADDR: case FIELD_LOC_KIND_PHYSADDR:

View file

@ -884,20 +884,20 @@ elf_gnu_ifunc_resolve_by_got (const char *name, CORE_ADDR *addr_p)
CORE_ADDR pointer_address, addr; CORE_ADDR pointer_address, addr;
asection *plt; asection *plt;
gdb_byte *buf = alloca (ptr_size); gdb_byte *buf = alloca (ptr_size);
struct minimal_symbol *msym; struct bound_minimal_symbol msym;
msym = lookup_minimal_symbol (name_got_plt, NULL, objfile); msym = lookup_minimal_symbol (name_got_plt, NULL, objfile);
if (msym == NULL) if (msym.minsym == NULL)
continue; continue;
if (MSYMBOL_TYPE (msym) != mst_slot_got_plt) if (MSYMBOL_TYPE (msym.minsym) != mst_slot_got_plt)
continue; continue;
pointer_address = MSYMBOL_VALUE_ADDRESS (msym); pointer_address = MSYMBOL_VALUE_ADDRESS (msym.minsym);
plt = bfd_get_section_by_name (obfd, ".plt"); plt = bfd_get_section_by_name (obfd, ".plt");
if (plt == NULL) if (plt == NULL)
continue; continue;
if (MSYMBOL_SIZE (msym) != ptr_size) if (MSYMBOL_SIZE (msym.minsym) != ptr_size)
continue; continue;
if (target_read_memory (pointer_address, buf, ptr_size) != 0) if (target_read_memory (pointer_address, buf, ptr_size) != 0)
continue; continue;

View file

@ -1113,7 +1113,7 @@ evaluate_subexp_standard (struct type *expect_type,
if (value_as_long (target) == 0) if (value_as_long (target) == 0)
return value_from_longest (long_type, 0); return value_from_longest (long_type, 0);
if (lookup_minimal_symbol ("objc_msg_lookup", 0, 0)) if (lookup_minimal_symbol ("objc_msg_lookup", 0, 0).minsym)
gnu_runtime = 1; gnu_runtime = 1;
/* Find the method dispatch (Apple runtime) or method lookup /* Find the method dispatch (Apple runtime) or method lookup

View file

@ -390,10 +390,7 @@ struct minsym_lookup_data
/* The field where the callback should store the minimal symbol /* The field where the callback should store the minimal symbol
if found. It should be initialized to NULL before the search if found. It should be initialized to NULL before the search
is started. */ is started. */
struct minimal_symbol *result; struct bound_minimal_symbol result;
/* The objfile in which the symbol was found. */
struct objfile *objfile;
}; };
/* A callback function for gdbarch_iterate_over_objfiles_in_search_order. /* A callback function for gdbarch_iterate_over_objfiles_in_search_order.
@ -406,13 +403,12 @@ minsym_lookup_iterator_cb (struct objfile *objfile, void *cb_data)
{ {
struct minsym_lookup_data *data = (struct minsym_lookup_data *) cb_data; struct minsym_lookup_data *data = (struct minsym_lookup_data *) cb_data;
gdb_assert (data->result == NULL); gdb_assert (data->result.minsym == NULL);
data->result = lookup_minimal_symbol (data->name, NULL, objfile); data->result = lookup_minimal_symbol (data->name, NULL, objfile);
data->objfile = objfile;
/* The iterator should stop iff a match was found. */ /* The iterator should stop iff a match was found. */
return (data->result != NULL); return (data->result.minsym != NULL);
} }
/* A default implementation for the "la_read_var_value" hook in /* A default implementation for the "la_read_var_value" hook in
@ -572,18 +568,18 @@ default_read_var_value (struct symbol *var, struct frame_info *frame)
(get_objfile_arch (SYMBOL_SYMTAB (var)->objfile), (get_objfile_arch (SYMBOL_SYMTAB (var)->objfile),
minsym_lookup_iterator_cb, &lookup_data, minsym_lookup_iterator_cb, &lookup_data,
SYMBOL_SYMTAB (var)->objfile); SYMBOL_SYMTAB (var)->objfile);
msym = lookup_data.result; msym = lookup_data.result.minsym;
if (msym == NULL) if (msym == NULL)
error (_("No global symbol \"%s\"."), SYMBOL_LINKAGE_NAME (var)); error (_("No global symbol \"%s\"."), SYMBOL_LINKAGE_NAME (var));
if (overlay_debugging) if (overlay_debugging)
addr = symbol_overlayed_address (MSYMBOL_VALUE_ADDRESS (msym), addr = symbol_overlayed_address (MSYMBOL_VALUE_ADDRESS (msym),
MSYMBOL_OBJ_SECTION (lookup_data.objfile, MSYMBOL_OBJ_SECTION (lookup_data.result.objfile,
msym)); msym));
else else
addr = MSYMBOL_VALUE_ADDRESS (msym); addr = MSYMBOL_VALUE_ADDRESS (msym);
obj_section = MSYMBOL_OBJ_SECTION (lookup_data.objfile, msym); obj_section = MSYMBOL_OBJ_SECTION (lookup_data.result.objfile, msym);
if (obj_section if (obj_section
&& (obj_section->the_bfd_section->flags & SEC_THREAD_LOCAL) != 0) && (obj_section->the_bfd_section->flags & SEC_THREAD_LOCAL) != 0)
addr = target_translate_tls_address (obj_section->objfile, addr); addr = target_translate_tls_address (obj_section->objfile, addr);

View file

@ -2007,18 +2007,18 @@ frame_debug_got_null_frame (struct frame_info *this_frame,
static int static int
inside_main_func (struct frame_info *this_frame) inside_main_func (struct frame_info *this_frame)
{ {
struct minimal_symbol *msymbol; struct bound_minimal_symbol msymbol;
CORE_ADDR maddr; CORE_ADDR maddr;
if (symfile_objfile == 0) if (symfile_objfile == 0)
return 0; return 0;
msymbol = lookup_minimal_symbol (main_name (), NULL, symfile_objfile); msymbol = lookup_minimal_symbol (main_name (), NULL, symfile_objfile);
if (msymbol == NULL) if (msymbol.minsym == NULL)
return 0; return 0;
/* Make certain that the code, and not descriptor, address is /* Make certain that the code, and not descriptor, address is
returned. */ returned. */
maddr = gdbarch_convert_from_func_ptr_addr (get_frame_arch (this_frame), maddr = gdbarch_convert_from_func_ptr_addr (get_frame_arch (this_frame),
MSYMBOL_VALUE_ADDRESS (msymbol), MSYMBOL_VALUE_ADDRESS (msymbol.minsym),
&current_target); &current_target);
return maddr == get_frame_func (this_frame); return maddr == get_frame_func (this_frame);
} }

View file

@ -1391,7 +1391,7 @@ frv_frame_this_id (struct frame_info *this_frame,
= frv_frame_unwind_cache (this_frame, this_prologue_cache); = frv_frame_unwind_cache (this_frame, this_prologue_cache);
CORE_ADDR base; CORE_ADDR base;
CORE_ADDR func; CORE_ADDR func;
struct minimal_symbol *msym_stack; struct bound_minimal_symbol msym_stack;
struct frame_id id; struct frame_id id;
/* The FUNC is easy. */ /* The FUNC is easy. */
@ -1399,7 +1399,8 @@ frv_frame_this_id (struct frame_info *this_frame,
/* Check if the stack is empty. */ /* Check if the stack is empty. */
msym_stack = lookup_minimal_symbol ("_stack", NULL, NULL); msym_stack = lookup_minimal_symbol ("_stack", NULL, NULL);
if (msym_stack && info->base == MSYMBOL_VALUE_ADDRESS (msym_stack)) if (msym_stack.minsym
&& info->base == MSYMBOL_VALUE_ADDRESS (msym_stack.minsym))
return; return;
/* Hopefully the prologue analysis either correctly determined the /* Hopefully the prologue analysis either correctly determined the

View file

@ -268,13 +268,13 @@ call_target_sbrk (int sbrk_arg)
struct value *sbrk_fn, *ret; struct value *sbrk_fn, *ret;
bfd_vma tmp; bfd_vma tmp;
if (lookup_minimal_symbol ("sbrk", NULL, NULL) != NULL) if (lookup_minimal_symbol ("sbrk", NULL, NULL).minsym != NULL)
{ {
sbrk_fn = find_function_in_inferior ("sbrk", &sbrk_objf); sbrk_fn = find_function_in_inferior ("sbrk", &sbrk_objf);
if (sbrk_fn == NULL) if (sbrk_fn == NULL)
return (bfd_vma) 0; return (bfd_vma) 0;
} }
else if (lookup_minimal_symbol ("_sbrk", NULL, NULL) != NULL) else if (lookup_minimal_symbol ("_sbrk", NULL, NULL).minsym != NULL)
{ {
sbrk_fn = find_function_in_inferior ("_sbrk", &sbrk_objf); sbrk_fn = find_function_in_inferior ("_sbrk", &sbrk_objf);
if (sbrk_fn == NULL) if (sbrk_fn == NULL)

View file

@ -59,14 +59,14 @@ glibc_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
if (resolver.minsym) if (resolver.minsym)
{ {
/* The dynamic linker began using this name in early 2005. */ /* The dynamic linker began using this name in early 2005. */
struct minimal_symbol *fixup struct bound_minimal_symbol fixup
= lookup_minimal_symbol ("_dl_fixup", NULL, resolver.objfile); = lookup_minimal_symbol ("_dl_fixup", NULL, resolver.objfile);
/* This is the name used in older versions. */ /* This is the name used in older versions. */
if (! fixup) if (! fixup.minsym)
fixup = lookup_minimal_symbol ("fixup", NULL, resolver.objfile); fixup = lookup_minimal_symbol ("fixup", NULL, resolver.objfile);
if (fixup && MSYMBOL_VALUE_ADDRESS (fixup) == pc) if (fixup.minsym && MSYMBOL_VALUE_ADDRESS (fixup.minsym) == pc)
return frame_unwind_caller_pc (get_current_frame ()); return frame_unwind_caller_pc (get_current_frame ());
} }

View file

@ -1122,16 +1122,17 @@ gnuv3_get_typeid (struct value *value)
else else
{ {
char *sym_name; char *sym_name;
struct minimal_symbol *minsym; struct bound_minimal_symbol minsym;
sym_name = concat ("typeinfo for ", typename, (char *) NULL); sym_name = concat ("typeinfo for ", typename, (char *) NULL);
make_cleanup (xfree, sym_name); make_cleanup (xfree, sym_name);
minsym = lookup_minimal_symbol (sym_name, NULL, NULL); minsym = lookup_minimal_symbol (sym_name, NULL, NULL);
if (minsym == NULL) if (minsym.minsym == NULL)
error (_("could not find typeinfo symbol for '%s'"), typename); error (_("could not find typeinfo symbol for '%s'"), typename);
result = value_at_lazy (typeinfo_type, MSYMBOL_VALUE_ADDRESS (minsym)); result = value_at_lazy (typeinfo_type,
MSYMBOL_VALUE_ADDRESS (minsym.minsym));
} }
do_cleanups (cleanup); do_cleanups (cleanup);
@ -1209,7 +1210,7 @@ gnuv3_skip_trampoline (struct frame_info *frame, CORE_ADDR stop_pc)
{ {
CORE_ADDR real_stop_pc, method_stop_pc, func_addr; CORE_ADDR real_stop_pc, method_stop_pc, func_addr;
struct gdbarch *gdbarch = get_frame_arch (frame); struct gdbarch *gdbarch = get_frame_arch (frame);
struct minimal_symbol *thunk_sym, *fn_sym; struct bound_minimal_symbol thunk_sym, fn_sym;
struct obj_section *section; struct obj_section *section;
const char *thunk_name, *fn_name; const char *thunk_name, *fn_name;
@ -1218,24 +1219,24 @@ gnuv3_skip_trampoline (struct frame_info *frame, CORE_ADDR stop_pc)
real_stop_pc = stop_pc; real_stop_pc = stop_pc;
/* Find the linker symbol for this potential thunk. */ /* Find the linker symbol for this potential thunk. */
thunk_sym = lookup_minimal_symbol_by_pc (real_stop_pc).minsym; thunk_sym = lookup_minimal_symbol_by_pc (real_stop_pc);
section = find_pc_section (real_stop_pc); section = find_pc_section (real_stop_pc);
if (thunk_sym == NULL || section == NULL) if (thunk_sym.minsym == NULL || section == NULL)
return 0; return 0;
/* The symbol's demangled name should be something like "virtual /* The symbol's demangled name should be something like "virtual
thunk to FUNCTION", where FUNCTION is the name of the function thunk to FUNCTION", where FUNCTION is the name of the function
being thunked to. */ being thunked to. */
thunk_name = MSYMBOL_DEMANGLED_NAME (thunk_sym); thunk_name = MSYMBOL_DEMANGLED_NAME (thunk_sym.minsym);
if (thunk_name == NULL || strstr (thunk_name, " thunk to ") == NULL) if (thunk_name == NULL || strstr (thunk_name, " thunk to ") == NULL)
return 0; return 0;
fn_name = strstr (thunk_name, " thunk to ") + strlen (" thunk to "); fn_name = strstr (thunk_name, " thunk to ") + strlen (" thunk to ");
fn_sym = lookup_minimal_symbol (fn_name, NULL, section->objfile); fn_sym = lookup_minimal_symbol (fn_name, NULL, section->objfile);
if (fn_sym == NULL) if (fn_sym.minsym == NULL)
return 0; return 0;
method_stop_pc = MSYMBOL_VALUE_ADDRESS (fn_sym); method_stop_pc = MSYMBOL_VALUE_ADDRESS (fn_sym.minsym);
/* Some targets have minimal symbols pointing to function descriptors /* Some targets have minimal symbols pointing to function descriptors
(powerpc 64 for example). Make sure to retrieve the address (powerpc 64 for example). Make sure to retrieve the address

View file

@ -56,10 +56,10 @@ static const char GO_MAIN_MAIN[] = "main.main";
const char * const char *
go_main_name (void) go_main_name (void)
{ {
struct minimal_symbol *msym; struct bound_minimal_symbol msym;
msym = lookup_minimal_symbol (GO_MAIN_MAIN, NULL, NULL); msym = lookup_minimal_symbol (GO_MAIN_MAIN, NULL, NULL);
if (msym != NULL) if (msym.minsym != NULL)
return GO_MAIN_MAIN; return GO_MAIN_MAIN;
/* No known entry procedure found, the main program is probably not Go. */ /* No known entry procedure found, the main program is probably not Go. */

View file

@ -460,7 +460,7 @@ hppa_hpux_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
(curr_inst == 0xeaa0d002)) (curr_inst == 0xeaa0d002))
{ {
struct bound_minimal_symbol stubsym; struct bound_minimal_symbol stubsym;
struct minimal_symbol *libsym; struct bound_minimal_symbol libsym;
stubsym = lookup_minimal_symbol_by_pc (loc); stubsym = lookup_minimal_symbol_by_pc (loc);
if (stubsym.minsym == NULL) if (stubsym.minsym == NULL)
@ -471,14 +471,14 @@ hppa_hpux_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
libsym = lookup_minimal_symbol (MSYMBOL_LINKAGE_NAME (stubsym.minsym), libsym = lookup_minimal_symbol (MSYMBOL_LINKAGE_NAME (stubsym.minsym),
NULL, NULL); NULL, NULL);
if (libsym == NULL) if (libsym.minsym == NULL)
{ {
warning (_("Unable to find library symbol for %s."), warning (_("Unable to find library symbol for %s."),
MSYMBOL_PRINT_NAME (stubsym.minsym)); MSYMBOL_PRINT_NAME (stubsym.minsym));
return orig_pc == pc ? 0 : pc & ~0x3; return orig_pc == pc ? 0 : pc & ~0x3;
} }
return MSYMBOL_VALUE (libsym); return MSYMBOL_VALUE (libsym.minsym);
} }
/* Does it look like bl X,%rp or bl X,%r0? Another way to do a /* Does it look like bl X,%rp or bl X,%r0? Another way to do a
@ -1014,7 +1014,7 @@ hppa_hpux_find_import_stub_for_addr (CORE_ADDR funcaddr)
{ {
struct objfile *objfile; struct objfile *objfile;
struct bound_minimal_symbol funsym; struct bound_minimal_symbol funsym;
struct minimal_symbol *stubsym; struct bound_minimal_symbol stubsym;
CORE_ADDR stubaddr; CORE_ADDR stubaddr;
funsym = lookup_minimal_symbol_by_pc (funcaddr); funsym = lookup_minimal_symbol_by_pc (funcaddr);
@ -1025,17 +1025,17 @@ hppa_hpux_find_import_stub_for_addr (CORE_ADDR funcaddr)
stubsym = lookup_minimal_symbol_solib_trampoline stubsym = lookup_minimal_symbol_solib_trampoline
(MSYMBOL_LINKAGE_NAME (funsym.minsym), objfile); (MSYMBOL_LINKAGE_NAME (funsym.minsym), objfile);
if (stubsym) if (stubsym.minsym)
{ {
struct unwind_table_entry *u; struct unwind_table_entry *u;
u = find_unwind_entry (MSYMBOL_VALUE (stubsym)); u = find_unwind_entry (MSYMBOL_VALUE (stubsym.minsym));
if (u == NULL if (u == NULL
|| (u->stub_unwind.stub_type != IMPORT || (u->stub_unwind.stub_type != IMPORT
&& u->stub_unwind.stub_type != IMPORT_SHLIB)) && u->stub_unwind.stub_type != IMPORT_SHLIB))
continue; continue;
stubaddr = MSYMBOL_VALUE (stubsym); stubaddr = MSYMBOL_VALUE (stubsym.minsym);
/* If we found an IMPORT stub, then we can stop searching; /* If we found an IMPORT stub, then we can stop searching;
if we found an IMPORT_SHLIB, we want to continue the search if we found an IMPORT_SHLIB, we want to continue the search

View file

@ -162,11 +162,11 @@ hppa_extract_17 (unsigned word)
CORE_ADDR CORE_ADDR
hppa_symbol_address(const char *sym) hppa_symbol_address(const char *sym)
{ {
struct minimal_symbol *minsym; struct bound_minimal_symbol minsym;
minsym = lookup_minimal_symbol (sym, NULL, NULL); minsym = lookup_minimal_symbol (sym, NULL, NULL);
if (minsym) if (minsym.minsym)
return MSYMBOL_VALUE_ADDRESS (minsym); return MSYMBOL_VALUE_ADDRESS (minsym.minsym);
else else
return (CORE_ADDR)-1; return (CORE_ADDR)-1;
} }
@ -2463,12 +2463,13 @@ hppa_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
/* Return the minimal symbol whose name is NAME and stub type is STUB_TYPE. /* Return the minimal symbol whose name is NAME and stub type is STUB_TYPE.
Return NULL if no such symbol was found. */ Return NULL if no such symbol was found. */
struct minimal_symbol * struct bound_minimal_symbol
hppa_lookup_stub_minimal_symbol (const char *name, hppa_lookup_stub_minimal_symbol (const char *name,
enum unwind_stub_types stub_type) enum unwind_stub_types stub_type)
{ {
struct objfile *objfile; struct objfile *objfile;
struct minimal_symbol *msym; struct minimal_symbol *msym;
struct bound_minimal_symbol result = { NULL, NULL };
ALL_MSYMBOLS (objfile, msym) ALL_MSYMBOLS (objfile, msym)
{ {
@ -2478,11 +2479,15 @@ hppa_lookup_stub_minimal_symbol (const char *name,
u = find_unwind_entry (MSYMBOL_VALUE (msym)); u = find_unwind_entry (MSYMBOL_VALUE (msym));
if (u != NULL && u->stub_unwind.stub_type == stub_type) if (u != NULL && u->stub_unwind.stub_type == stub_type)
return msym; {
result.objfile = objfile;
result.minsym = msym;
return result;
}
} }
} }
return NULL; return result;
} }
static void static void

View file

@ -240,7 +240,7 @@ extern void hppa_write_pc (struct regcache *regcache, CORE_ADDR pc);
extern CORE_ADDR hppa_unwind_pc (struct gdbarch *gdbarch, extern CORE_ADDR hppa_unwind_pc (struct gdbarch *gdbarch,
struct frame_info *next_frame); struct frame_info *next_frame);
extern struct minimal_symbol * extern struct bound_minimal_symbol
hppa_lookup_stub_minimal_symbol (const char *name, hppa_lookup_stub_minimal_symbol (const char *name,
enum unwind_stub_types stub_type); enum unwind_stub_types stub_type);

View file

@ -1016,7 +1016,7 @@ jit_breakpoint_re_set_internal (struct gdbarch *gdbarch,
struct jit_program_space_data *ps_data) struct jit_program_space_data *ps_data)
{ {
struct bound_minimal_symbol reg_symbol; struct bound_minimal_symbol reg_symbol;
struct minimal_symbol *desc_symbol; struct bound_minimal_symbol desc_symbol;
struct jit_objfile_data *objf_data; struct jit_objfile_data *objf_data;
CORE_ADDR addr; CORE_ADDR addr;
@ -1031,12 +1031,13 @@ jit_breakpoint_re_set_internal (struct gdbarch *gdbarch,
desc_symbol = lookup_minimal_symbol (jit_descriptor_name, NULL, desc_symbol = lookup_minimal_symbol (jit_descriptor_name, NULL,
reg_symbol.objfile); reg_symbol.objfile);
if (desc_symbol == NULL || MSYMBOL_VALUE_ADDRESS (desc_symbol) == 0) if (desc_symbol.minsym == NULL
|| MSYMBOL_VALUE_ADDRESS (desc_symbol.minsym) == 0)
return 1; return 1;
objf_data = get_jit_objfile_data (reg_symbol.objfile); objf_data = get_jit_objfile_data (reg_symbol.objfile);
objf_data->register_code = reg_symbol.minsym; objf_data->register_code = reg_symbol.minsym;
objf_data->descriptor = desc_symbol; objf_data->descriptor = desc_symbol.minsym;
ps_data->objfile = reg_symbol.objfile; ps_data->objfile = reg_symbol.objfile;
} }

View file

@ -455,9 +455,10 @@ inferior_call_waitpid (ptid_t pptid, int pid)
old_cleanup = make_cleanup (inferior_call_waitpid_cleanup, oldfp); old_cleanup = make_cleanup (inferior_call_waitpid_cleanup, oldfp);
/* Get the waitpid_fn. */ /* Get the waitpid_fn. */
if (lookup_minimal_symbol ("waitpid", NULL, NULL) != NULL) if (lookup_minimal_symbol ("waitpid", NULL, NULL).minsym != NULL)
waitpid_fn = find_function_in_inferior ("waitpid", &waitpid_objf); waitpid_fn = find_function_in_inferior ("waitpid", &waitpid_objf);
if (!waitpid_fn && lookup_minimal_symbol ("_waitpid", NULL, NULL) != NULL) if (!waitpid_fn
&& lookup_minimal_symbol ("_waitpid", NULL, NULL).minsym != NULL)
waitpid_fn = find_function_in_inferior ("_waitpid", &waitpid_objf); waitpid_fn = find_function_in_inferior ("_waitpid", &waitpid_objf);
if (!waitpid_fn) if (!waitpid_fn)
goto out; goto out;
@ -668,10 +669,10 @@ checkpoint_command (char *args, int from_tty)
/* Make the inferior fork, record its (and gdb's) state. */ /* Make the inferior fork, record its (and gdb's) state. */
if (lookup_minimal_symbol ("fork", NULL, NULL) != NULL) if (lookup_minimal_symbol ("fork", NULL, NULL).minsym != NULL)
fork_fn = find_function_in_inferior ("fork", &fork_objf); fork_fn = find_function_in_inferior ("fork", &fork_objf);
if (!fork_fn) if (!fork_fn)
if (lookup_minimal_symbol ("_fork", NULL, NULL) != NULL) if (lookup_minimal_symbol ("_fork", NULL, NULL).minsym != NULL)
fork_fn = find_function_in_inferior ("fork", &fork_objf); fork_fn = find_function_in_inferior ("fork", &fork_objf);
if (!fork_fn) if (!fork_fn)
error (_("checkpoint: can't find fork function in inferior.")); error (_("checkpoint: can't find fork function in inferior."));

View file

@ -5031,14 +5031,15 @@ Enables printf debugging output."),
static int static int
get_signo (const char *name) get_signo (const char *name)
{ {
struct minimal_symbol *ms; struct bound_minimal_symbol ms;
int signo; int signo;
ms = lookup_minimal_symbol (name, NULL, NULL); ms = lookup_minimal_symbol (name, NULL, NULL);
if (ms == NULL) if (ms.minsym == NULL)
return 0; return 0;
if (target_read_memory (MSYMBOL_VALUE_ADDRESS (ms), (gdb_byte *) &signo, if (target_read_memory (MSYMBOL_VALUE_ADDRESS (ms.minsym),
(gdb_byte *) &signo,
sizeof (signo)) != 0) sizeof (signo)) != 0)
return 0; return 0;

View file

@ -565,16 +565,16 @@ enable_thread_event (int event, CORE_ADDR *bp)
static int static int
inferior_has_bug (const char *ver_symbol, int ver_major_min, int ver_minor_min) inferior_has_bug (const char *ver_symbol, int ver_major_min, int ver_minor_min)
{ {
struct minimal_symbol *version_msym; struct bound_minimal_symbol version_msym;
CORE_ADDR version_addr; CORE_ADDR version_addr;
char *version; char *version;
int err, got, retval = 0; int err, got, retval = 0;
version_msym = lookup_minimal_symbol (ver_symbol, NULL, NULL); version_msym = lookup_minimal_symbol (ver_symbol, NULL, NULL);
if (version_msym == NULL) if (version_msym.minsym == NULL)
return 0; return 0;
version_addr = MSYMBOL_VALUE_ADDRESS (version_msym); version_addr = MSYMBOL_VALUE_ADDRESS (version_msym.minsym);
got = target_read_string (version_addr, &version, 32, &err); got = target_read_string (version_addr, &version, 32, &err);
if (err == 0 && memchr (version, 0, got) == &version[got -1]) if (err == 0 && memchr (version, 0, got) == &version[got -1])
{ {

View file

@ -2240,14 +2240,15 @@ m32c_return_value (struct gdbarch *gdbarch,
/* Everything else is passed in mem0, using as many bytes as /* Everything else is passed in mem0, using as many bytes as
needed. This is not what the Renesas tools do, but it's needed. This is not what the Renesas tools do, but it's
what GCC does at the moment. */ what GCC does at the moment. */
struct minimal_symbol *mem0 struct bound_minimal_symbol mem0
= lookup_minimal_symbol ("mem0", NULL, NULL); = lookup_minimal_symbol ("mem0", NULL, NULL);
if (! mem0) if (! mem0.minsym)
error (_("The return value is stored in memory at 'mem0', " error (_("The return value is stored in memory at 'mem0', "
"but GDB cannot find\n" "but GDB cannot find\n"
"its address.")); "its address."));
read_memory (MSYMBOL_VALUE_ADDRESS (mem0), readbuf, valtype_len); read_memory (MSYMBOL_VALUE_ADDRESS (mem0.minsym), readbuf,
valtype_len);
} }
} }
@ -2272,14 +2273,15 @@ m32c_return_value (struct gdbarch *gdbarch,
/* Everything else is passed in mem0, using as many bytes as /* Everything else is passed in mem0, using as many bytes as
needed. This is not what the Renesas tools do, but it's needed. This is not what the Renesas tools do, but it's
what GCC does at the moment. */ what GCC does at the moment. */
struct minimal_symbol *mem0 struct bound_minimal_symbol mem0
= lookup_minimal_symbol ("mem0", NULL, NULL); = lookup_minimal_symbol ("mem0", NULL, NULL);
if (! mem0) if (! mem0.minsym)
error (_("The return value is stored in memory at 'mem0', " error (_("The return value is stored in memory at 'mem0', "
"but GDB cannot find\n" "but GDB cannot find\n"
" its address.")); " its address."));
write_memory (MSYMBOL_VALUE_ADDRESS (mem0), writebuf, valtype_len); write_memory (MSYMBOL_VALUE_ADDRESS (mem0.minsym), writebuf,
valtype_len);
} }
} }
@ -2450,7 +2452,7 @@ m32c_m16c_address_to_pointer (struct gdbarch *gdbarch,
{ {
const char *func_name; const char *func_name;
char *tramp_name; char *tramp_name;
struct minimal_symbol *tramp_msym; struct bound_minimal_symbol tramp_msym;
/* Try to find a linker symbol at this address. */ /* Try to find a linker symbol at this address. */
struct bound_minimal_symbol func_msym struct bound_minimal_symbol func_msym
@ -2473,7 +2475,7 @@ m32c_m16c_address_to_pointer (struct gdbarch *gdbarch,
the name any more. */ the name any more. */
xfree (tramp_name); xfree (tramp_name);
if (! tramp_msym) if (! tramp_msym.minsym)
{ {
CORE_ADDR ptrval; CORE_ADDR ptrval;
@ -2505,7 +2507,7 @@ m32c_m16c_address_to_pointer (struct gdbarch *gdbarch,
else else
{ {
/* The trampoline's address is our pointer. */ /* The trampoline's address is our pointer. */
addr = MSYMBOL_VALUE_ADDRESS (tramp_msym); addr = MSYMBOL_VALUE_ADDRESS (tramp_msym.minsym);
} }
} }
@ -2542,7 +2544,7 @@ m32c_m16c_pointer_to_address (struct gdbarch *gdbarch,
if (len > 4 if (len > 4
&& strcmp (ptr_msym_name + len - 4, ".plt") == 0) && strcmp (ptr_msym_name + len - 4, ".plt") == 0)
{ {
struct minimal_symbol *func_msym; struct bound_minimal_symbol func_msym;
/* We have a .plt symbol; try to find the symbol for the /* We have a .plt symbol; try to find the symbol for the
corresponding function. corresponding function.
@ -2557,8 +2559,8 @@ m32c_m16c_pointer_to_address (struct gdbarch *gdbarch,
/* If we do have such a symbol, return its value as the /* If we do have such a symbol, return its value as the
function's true address. */ function's true address. */
if (func_msym) if (func_msym.minsym)
ptr = MSYMBOL_VALUE_ADDRESS (func_msym); ptr = MSYMBOL_VALUE_ADDRESS (func_msym.minsym);
} }
} }
else else

View file

@ -836,7 +836,7 @@ m32r_frame_this_id (struct frame_info *this_frame,
= m32r_frame_unwind_cache (this_frame, this_prologue_cache); = m32r_frame_unwind_cache (this_frame, this_prologue_cache);
CORE_ADDR base; CORE_ADDR base;
CORE_ADDR func; CORE_ADDR func;
struct minimal_symbol *msym_stack; struct bound_minimal_symbol msym_stack;
struct frame_id id; struct frame_id id;
/* The FUNC is easy. */ /* The FUNC is easy. */
@ -844,7 +844,8 @@ m32r_frame_this_id (struct frame_info *this_frame,
/* Check if the stack is empty. */ /* Check if the stack is empty. */
msym_stack = lookup_minimal_symbol ("_stack", NULL, NULL); msym_stack = lookup_minimal_symbol ("_stack", NULL, NULL);
if (msym_stack && info->base == MSYMBOL_VALUE_ADDRESS (msym_stack)) if (msym_stack.minsym
&& info->base == MSYMBOL_VALUE_ADDRESS (msym_stack.minsym))
return; return;
/* Hopefully the prologue analysis either correctly determined the /* Hopefully the prologue analysis either correctly determined the

View file

@ -199,12 +199,12 @@ static int soft_reg_initialized = 0;
static void static void
m68hc11_get_register_info (struct m68hc11_soft_reg *reg, const char *name) m68hc11_get_register_info (struct m68hc11_soft_reg *reg, const char *name)
{ {
struct minimal_symbol *msymbol; struct bound_minimal_symbol msymbol;
msymbol = lookup_minimal_symbol (name, NULL, NULL); msymbol = lookup_minimal_symbol (name, NULL, NULL);
if (msymbol) if (msymbol.minsym)
{ {
reg->addr = MSYMBOL_VALUE_ADDRESS (msymbol); reg->addr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
reg->name = xstrdup (name); reg->name = xstrdup (name);
/* Keep track of the address range for soft registers. */ /* Keep track of the address range for soft registers. */

View file

@ -429,19 +429,19 @@ static CORE_ADDR
macho_resolve_oso_sym_with_minsym (struct objfile *main_objfile, asymbol *sym) macho_resolve_oso_sym_with_minsym (struct objfile *main_objfile, asymbol *sym)
{ {
/* For common symbol and global symbols, use the min symtab. */ /* For common symbol and global symbols, use the min symtab. */
struct minimal_symbol *msym; struct bound_minimal_symbol msym;
const char *name = sym->name; const char *name = sym->name;
if (name[0] == bfd_get_symbol_leading_char (main_objfile->obfd)) if (name[0] == bfd_get_symbol_leading_char (main_objfile->obfd))
++name; ++name;
msym = lookup_minimal_symbol (name, NULL, main_objfile); msym = lookup_minimal_symbol (name, NULL, main_objfile);
if (msym == NULL) if (msym.minsym == NULL)
{ {
warning (_("can't find symbol '%s' in minsymtab"), name); warning (_("can't find symbol '%s' in minsymtab"), name);
return 0; return 0;
} }
else else
return MSYMBOL_VALUE_ADDRESS (msym); return MSYMBOL_VALUE_ADDRESS (msym.minsym);
} }
/* Add oso file OSO/ABFD as a symbol file. */ /* Add oso file OSO/ABFD as a symbol file. */

View file

@ -159,9 +159,9 @@ add_minsym_to_demangled_hash_table (struct minimal_symbol *sym,
Obviously, there must be distinct mangled names for each of these, Obviously, there must be distinct mangled names for each of these,
but the demangled names are all the same: S::S or S::~S. */ but the demangled names are all the same: S::S or S::~S. */
static struct bound_minimal_symbol struct bound_minimal_symbol
lookup_minimal_symbol_internal (const char *name, const char *sfile, lookup_minimal_symbol (const char *name, const char *sfile,
struct objfile *objf) struct objfile *objf)
{ {
struct objfile *objfile; struct objfile *objfile;
struct bound_minimal_symbol found_symbol = { NULL, NULL }; struct bound_minimal_symbol found_symbol = { NULL, NULL };
@ -294,23 +294,10 @@ lookup_minimal_symbol_internal (const char *name, const char *sfile,
/* See minsyms.h. */ /* See minsyms.h. */
struct minimal_symbol *
lookup_minimal_symbol (const char *name, const char *sfile,
struct objfile *objf)
{
struct bound_minimal_symbol bms = lookup_minimal_symbol_internal (name,
sfile,
objf);
return bms.minsym;
}
/* See minsyms.h. */
struct bound_minimal_symbol struct bound_minimal_symbol
lookup_bound_minimal_symbol (const char *name) lookup_bound_minimal_symbol (const char *name)
{ {
return lookup_minimal_symbol_internal (name, NULL, NULL); return lookup_minimal_symbol (name, NULL, NULL);
} }
/* See minsyms.h. */ /* See minsyms.h. */
@ -349,25 +336,25 @@ iterate_over_minimal_symbols (struct objfile *objf, const char *name,
/* See minsyms.h. */ /* See minsyms.h. */
struct minimal_symbol * struct bound_minimal_symbol
lookup_minimal_symbol_text (const char *name, struct objfile *objf) lookup_minimal_symbol_text (const char *name, struct objfile *objf)
{ {
struct objfile *objfile; struct objfile *objfile;
struct minimal_symbol *msymbol; struct minimal_symbol *msymbol;
struct minimal_symbol *found_symbol = NULL; struct bound_minimal_symbol found_symbol = { NULL, NULL };
struct minimal_symbol *found_file_symbol = NULL; struct bound_minimal_symbol found_file_symbol = { NULL, NULL };
unsigned int hash = msymbol_hash (name) % MINIMAL_SYMBOL_HASH_SIZE; unsigned int hash = msymbol_hash (name) % MINIMAL_SYMBOL_HASH_SIZE;
for (objfile = object_files; for (objfile = object_files;
objfile != NULL && found_symbol == NULL; objfile != NULL && found_symbol.minsym == NULL;
objfile = objfile->next) objfile = objfile->next)
{ {
if (objf == NULL || objf == objfile if (objf == NULL || objf == objfile
|| objf == objfile->separate_debug_objfile_backlink) || objf == objfile->separate_debug_objfile_backlink)
{ {
for (msymbol = objfile->msymbol_hash[hash]; for (msymbol = objfile->msymbol_hash[hash];
msymbol != NULL && found_symbol == NULL; msymbol != NULL && found_symbol.minsym == NULL;
msymbol = msymbol->hash_next) msymbol = msymbol->hash_next)
{ {
if (strcmp (MSYMBOL_LINKAGE_NAME (msymbol), name) == 0 && if (strcmp (MSYMBOL_LINKAGE_NAME (msymbol), name) == 0 &&
@ -378,10 +365,12 @@ lookup_minimal_symbol_text (const char *name, struct objfile *objf)
switch (MSYMBOL_TYPE (msymbol)) switch (MSYMBOL_TYPE (msymbol))
{ {
case mst_file_text: case mst_file_text:
found_file_symbol = msymbol; found_file_symbol.minsym = msymbol;
found_file_symbol.objfile = objfile;
break; break;
default: default:
found_symbol = msymbol; found_symbol.minsym = msymbol;
found_symbol.objfile = objfile;
break; break;
} }
} }
@ -389,14 +378,11 @@ lookup_minimal_symbol_text (const char *name, struct objfile *objf)
} }
} }
/* External symbols are best. */ /* External symbols are best. */
if (found_symbol) if (found_symbol.minsym)
return found_symbol; return found_symbol;
/* File-local symbols are next best. */ /* File-local symbols are next best. */
if (found_file_symbol) return found_file_symbol;
return found_file_symbol;
return NULL;
} }
/* See minsyms.h. */ /* See minsyms.h. */
@ -433,35 +419,39 @@ lookup_minimal_symbol_by_pc_name (CORE_ADDR pc, const char *name,
/* See minsyms.h. */ /* See minsyms.h. */
struct minimal_symbol * struct bound_minimal_symbol
lookup_minimal_symbol_solib_trampoline (const char *name, lookup_minimal_symbol_solib_trampoline (const char *name,
struct objfile *objf) struct objfile *objf)
{ {
struct objfile *objfile; struct objfile *objfile;
struct minimal_symbol *msymbol; struct minimal_symbol *msymbol;
struct minimal_symbol *found_symbol = NULL; struct bound_minimal_symbol found_symbol = { NULL, NULL };
unsigned int hash = msymbol_hash (name) % MINIMAL_SYMBOL_HASH_SIZE; unsigned int hash = msymbol_hash (name) % MINIMAL_SYMBOL_HASH_SIZE;
for (objfile = object_files; for (objfile = object_files;
objfile != NULL && found_symbol == NULL; objfile != NULL;
objfile = objfile->next) objfile = objfile->next)
{ {
if (objf == NULL || objf == objfile if (objf == NULL || objf == objfile
|| objf == objfile->separate_debug_objfile_backlink) || objf == objfile->separate_debug_objfile_backlink)
{ {
for (msymbol = objfile->msymbol_hash[hash]; for (msymbol = objfile->msymbol_hash[hash];
msymbol != NULL && found_symbol == NULL; msymbol != NULL;
msymbol = msymbol->hash_next) msymbol = msymbol->hash_next)
{ {
if (strcmp (MSYMBOL_LINKAGE_NAME (msymbol), name) == 0 && if (strcmp (MSYMBOL_LINKAGE_NAME (msymbol), name) == 0 &&
MSYMBOL_TYPE (msymbol) == mst_solib_trampoline) MSYMBOL_TYPE (msymbol) == mst_solib_trampoline)
return msymbol; {
found_symbol.objfile = objfile;
found_symbol.minsym = msymbol;
return found_symbol;
}
} }
} }
} }
return NULL; return found_symbol;
} }
/* Search through the minimal symbol table for each objfile and find /* Search through the minimal symbol table for each objfile and find

View file

@ -164,17 +164,17 @@ unsigned int msymbol_hash_iw (const char *);
/* Look through all the current minimal symbol tables and find the /* Look through all the current minimal symbol tables and find the
first minimal symbol that matches NAME. If OBJF is non-NULL, limit first minimal symbol that matches NAME. If OBJF is non-NULL, limit
the search to that objfile. If SFILE is non-NULL, the only file-scope the search to that objfile. If SFILE is non-NULL, the only
symbols considered will be from that source file (global symbols are file-scope symbols considered will be from that source file (global
still preferred). Returns a pointer to the minimal symbol that symbols are still preferred). Returns a bound minimal symbol that
matches, or NULL if no match is found. */ matches, or an empty bound minimal symbol if no match is found. */
struct minimal_symbol *lookup_minimal_symbol (const char *, struct bound_minimal_symbol lookup_minimal_symbol (const char *,
const char *, const char *,
struct objfile *); struct objfile *);
/* Like lookup_minimal_symbol, but searches all files and objfiles /* Like lookup_minimal_symbol, but searches all files and
and returns a bound minimal symbol. */ objfiles. */
struct bound_minimal_symbol lookup_bound_minimal_symbol (const char *); struct bound_minimal_symbol lookup_bound_minimal_symbol (const char *);
@ -185,13 +185,14 @@ struct bound_minimal_symbol lookup_minimal_symbol_and_objfile (const char *);
/* Look through all the current minimal symbol tables and find the /* Look through all the current minimal symbol tables and find the
first minimal symbol that matches NAME and has text type. If OBJF first minimal symbol that matches NAME and has text type. If OBJF
is non-NULL, limit the search to that objfile. Returns a pointer is non-NULL, limit the search to that objfile. Returns a bound
to the minimal symbol that matches, or NULL if no match is found. minimal symbol that matches, or an "empty" bound minimal symbol
otherwise.
This function only searches the mangled (linkage) names. */ This function only searches the mangled (linkage) names. */
struct minimal_symbol *lookup_minimal_symbol_text (const char *, struct bound_minimal_symbol lookup_minimal_symbol_text (const char *,
struct objfile *); struct objfile *);
/* Look through all the current minimal symbol tables and find the /* Look through all the current minimal symbol tables and find the
first minimal symbol that matches NAME and is a solib trampoline. first minimal symbol that matches NAME and is a solib trampoline.
@ -201,7 +202,7 @@ struct minimal_symbol *lookup_minimal_symbol_text (const char *,
This function only searches the mangled (linkage) names. */ This function only searches the mangled (linkage) names. */
struct minimal_symbol *lookup_minimal_symbol_solib_trampoline struct bound_minimal_symbol lookup_minimal_symbol_solib_trampoline
(const char *, (const char *,
struct objfile *); struct objfile *);

View file

@ -822,11 +822,11 @@ mips_linux_in_dynsym_resolve_code (CORE_ADDR pc)
static CORE_ADDR static CORE_ADDR
mips_linux_skip_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) mips_linux_skip_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
{ {
struct minimal_symbol *resolver; struct bound_minimal_symbol resolver;
resolver = lookup_minimal_symbol ("__dl_runtime_resolve", NULL, NULL); resolver = lookup_minimal_symbol ("__dl_runtime_resolve", NULL, NULL);
if (resolver && MSYMBOL_VALUE_ADDRESS (resolver) == pc) if (resolver.minsym && MSYMBOL_VALUE_ADDRESS (resolver.minsym) == pc)
return frame_unwind_caller_pc (get_current_frame ()); return frame_unwind_caller_pc (get_current_frame ());
return glibc_skip_solib_resolver (gdbarch, pc); return glibc_skip_solib_resolver (gdbarch, pc);

View file

@ -120,9 +120,9 @@ lookup_objc_class (struct gdbarch *gdbarch, char *classname)
return 0; return 0;
} }
if (lookup_minimal_symbol("objc_lookUpClass", 0, 0)) if (lookup_minimal_symbol("objc_lookUpClass", 0, 0).minsym)
function = find_function_in_inferior("objc_lookUpClass", NULL); function = find_function_in_inferior("objc_lookUpClass", NULL);
else if (lookup_minimal_symbol ("objc_lookup_class", 0, 0)) else if (lookup_minimal_symbol ("objc_lookup_class", 0, 0).minsym)
function = find_function_in_inferior("objc_lookup_class", NULL); function = find_function_in_inferior("objc_lookup_class", NULL);
else else
{ {
@ -149,9 +149,9 @@ lookup_child_selector (struct gdbarch *gdbarch, char *selname)
return 0; return 0;
} }
if (lookup_minimal_symbol("sel_getUid", 0, 0)) if (lookup_minimal_symbol("sel_getUid", 0, 0).minsym)
function = find_function_in_inferior("sel_getUid", NULL); function = find_function_in_inferior("sel_getUid", NULL);
else if (lookup_minimal_symbol ("sel_get_any_uid", 0, 0)) else if (lookup_minimal_symbol ("sel_get_any_uid", 0, 0).minsym)
function = find_function_in_inferior("sel_get_any_uid", NULL); function = find_function_in_inferior("sel_get_any_uid", NULL);
else else
{ {
@ -181,17 +181,17 @@ value_nsstring (struct gdbarch *gdbarch, char *ptr, int len)
stringValue[2] = value_string(ptr, len, char_type); stringValue[2] = value_string(ptr, len, char_type);
stringValue[2] = value_coerce_array(stringValue[2]); stringValue[2] = value_coerce_array(stringValue[2]);
/* _NSNewStringFromCString replaces "istr" after Lantern2A. */ /* _NSNewStringFromCString replaces "istr" after Lantern2A. */
if (lookup_minimal_symbol("_NSNewStringFromCString", 0, 0)) if (lookup_minimal_symbol("_NSNewStringFromCString", 0, 0).minsym)
{ {
function = find_function_in_inferior("_NSNewStringFromCString", NULL); function = find_function_in_inferior("_NSNewStringFromCString", NULL);
nsstringValue = call_function_by_hand(function, 1, &stringValue[2]); nsstringValue = call_function_by_hand(function, 1, &stringValue[2]);
} }
else if (lookup_minimal_symbol("istr", 0, 0)) else if (lookup_minimal_symbol("istr", 0, 0).minsym)
{ {
function = find_function_in_inferior("istr", NULL); function = find_function_in_inferior("istr", NULL);
nsstringValue = call_function_by_hand(function, 1, &stringValue[2]); nsstringValue = call_function_by_hand(function, 1, &stringValue[2]);
} }
else if (lookup_minimal_symbol("+[NSString stringWithCString:]", 0, 0)) else if (lookup_minimal_symbol("+[NSString stringWithCString:]", 0, 0).minsym)
{ {
function function
= find_function_in_inferior("+[NSString stringWithCString:]", NULL); = find_function_in_inferior("+[NSString stringWithCString:]", NULL);
@ -1152,11 +1152,12 @@ find_imps (const char *method, VEC (const_char_ptr) **symbol_names)
SYMBOL_NATURAL_NAME (sym)); SYMBOL_NATURAL_NAME (sym));
else else
{ {
struct minimal_symbol *msym = lookup_minimal_symbol (selector, 0, 0); struct bound_minimal_symbol msym
= lookup_minimal_symbol (selector, 0, 0);
if (msym != NULL) if (msym.minsym != NULL)
VEC_safe_push (const_char_ptr, *symbol_names, VEC_safe_push (const_char_ptr, *symbol_names,
MSYMBOL_NATURAL_NAME (msym)); MSYMBOL_NATURAL_NAME (msym.minsym));
} }
} }

View file

@ -26,10 +26,10 @@
CORE_ADDR CORE_ADDR
obsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) obsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
{ {
struct minimal_symbol *msym; struct bound_minimal_symbol msym;
msym = lookup_minimal_symbol("_dl_bind", NULL, NULL); msym = lookup_minimal_symbol("_dl_bind", NULL, NULL);
if (msym && MSYMBOL_VALUE_ADDRESS (msym) == pc) if (msym.minsym && MSYMBOL_VALUE_ADDRESS (msym.minsym) == pc)
return frame_unwind_caller_pc (get_current_frame ()); return frame_unwind_caller_pc (get_current_frame ());
else else
return find_solib_trampoline_target (get_current_frame (), pc); return find_solib_trampoline_target (get_current_frame (), pc);

View file

@ -59,23 +59,23 @@ static const char GPC_MAIN_PROGRAM_NAME_2[] = "pascal_main_program";
const char * const char *
pascal_main_name (void) pascal_main_name (void)
{ {
struct minimal_symbol *msym; struct bound_minimal_symbol msym;
msym = lookup_minimal_symbol (GPC_P_INITIALIZE, NULL, NULL); msym = lookup_minimal_symbol (GPC_P_INITIALIZE, NULL, NULL);
/* If '_p_initialize' was not found, the main program is likely not /* If '_p_initialize' was not found, the main program is likely not
written in Pascal. */ written in Pascal. */
if (msym == NULL) if (msym.minsym == NULL)
return NULL; return NULL;
msym = lookup_minimal_symbol (GPC_MAIN_PROGRAM_NAME_1, NULL, NULL); msym = lookup_minimal_symbol (GPC_MAIN_PROGRAM_NAME_1, NULL, NULL);
if (msym != NULL) if (msym.minsym != NULL)
{ {
return GPC_MAIN_PROGRAM_NAME_1; return GPC_MAIN_PROGRAM_NAME_1;
} }
msym = lookup_minimal_symbol (GPC_MAIN_PROGRAM_NAME_2, NULL, NULL); msym = lookup_minimal_symbol (GPC_MAIN_PROGRAM_NAME_2, NULL, NULL);
if (msym != NULL) if (msym.minsym != NULL)
{ {
return GPC_MAIN_PROGRAM_NAME_2; return GPC_MAIN_PROGRAM_NAME_2;
} }

View file

@ -1011,7 +1011,7 @@ static CORE_ADDR spe_context_cache_address;
static void static void
ppc_linux_spe_context_lookup (struct objfile *objfile) ppc_linux_spe_context_lookup (struct objfile *objfile)
{ {
struct minimal_symbol *sym; struct bound_minimal_symbol sym;
if (!objfile) if (!objfile)
{ {
@ -1024,11 +1024,11 @@ ppc_linux_spe_context_lookup (struct objfile *objfile)
} }
sym = lookup_minimal_symbol ("__spe_current_active_context", NULL, objfile); sym = lookup_minimal_symbol ("__spe_current_active_context", NULL, objfile);
if (sym) if (sym.minsym)
{ {
spe_context_objfile = objfile; spe_context_objfile = objfile;
spe_context_lm_addr = svr4_fetch_objfile_link_map (objfile); spe_context_lm_addr = svr4_fetch_objfile_link_map (objfile);
spe_context_offset = MSYMBOL_VALUE_ADDRESS (sym); spe_context_offset = MSYMBOL_VALUE_ADDRESS (sym.minsym);
spe_context_cache_ptid = minus_one_ptid; spe_context_cache_ptid = minus_one_ptid;
spe_context_cache_address = 0; spe_context_cache_address = 0;
return; return;

View file

@ -1076,7 +1076,7 @@ convert_code_addr_to_desc_addr (CORE_ADDR code_addr, CORE_ADDR *desc_addr)
{ {
struct obj_section *dot_fn_section; struct obj_section *dot_fn_section;
struct bound_minimal_symbol dot_fn; struct bound_minimal_symbol dot_fn;
struct minimal_symbol *fn; struct bound_minimal_symbol fn;
/* Find the minimal symbol that corresponds to CODE_ADDR (should /* Find the minimal symbol that corresponds to CODE_ADDR (should
have a name of the form ".FN"). */ have a name of the form ".FN"). */
@ -1094,10 +1094,10 @@ convert_code_addr_to_desc_addr (CORE_ADDR code_addr, CORE_ADDR *desc_addr)
contain a minimal symbol with the same name. */ contain a minimal symbol with the same name. */
fn = lookup_minimal_symbol (MSYMBOL_LINKAGE_NAME (dot_fn.minsym) + 1, NULL, fn = lookup_minimal_symbol (MSYMBOL_LINKAGE_NAME (dot_fn.minsym) + 1, NULL,
dot_fn_section->objfile); dot_fn_section->objfile);
if (fn == NULL) if (fn.minsym == NULL)
return 0; return 0;
/* Found a descriptor. */ /* Found a descriptor. */
(*desc_addr) = MSYMBOL_VALUE_ADDRESS (fn); (*desc_addr) = MSYMBOL_VALUE_ADDRESS (fn.minsym);
return 1; return 1;
} }

View file

@ -194,7 +194,7 @@ ps_err_e
ps_pglobal_lookup (gdb_ps_prochandle_t ph, const char *obj, ps_pglobal_lookup (gdb_ps_prochandle_t ph, const char *obj,
const char *name, psaddr_t *sym_addr) const char *name, psaddr_t *sym_addr)
{ {
struct minimal_symbol *ms; struct bound_minimal_symbol ms;
struct cleanup *old_chain = save_current_program_space (); struct cleanup *old_chain = save_current_program_space ();
struct inferior *inf = find_inferior_pid (ptid_get_pid (ph->ptid)); struct inferior *inf = find_inferior_pid (ptid_get_pid (ph->ptid));
ps_err_e result; ps_err_e result;
@ -203,11 +203,11 @@ ps_pglobal_lookup (gdb_ps_prochandle_t ph, const char *obj,
/* FIXME: kettenis/2000-09-03: What should we do with OBJ? */ /* FIXME: kettenis/2000-09-03: What should we do with OBJ? */
ms = lookup_minimal_symbol (name, NULL, NULL); ms = lookup_minimal_symbol (name, NULL, NULL);
if (ms == NULL) if (ms.minsym == NULL)
result = PS_NOSYM; result = PS_NOSYM;
else else
{ {
*sym_addr = core_addr_to_ps_addr (MSYMBOL_VALUE_ADDRESS (ms)); *sym_addr = core_addr_to_ps_addr (MSYMBOL_VALUE_ADDRESS (ms.minsym));
result = PS_OK; result = PS_OK;
} }

View file

@ -102,13 +102,13 @@ ravenscar_update_inferior_ptid (void)
and return its associated minimal symbol. and return its associated minimal symbol.
Return NULL if not found. */ Return NULL if not found. */
static struct minimal_symbol * static struct bound_minimal_symbol
get_running_thread_msymbol (void) get_running_thread_msymbol (void)
{ {
struct minimal_symbol *msym; struct bound_minimal_symbol msym;
msym = lookup_minimal_symbol (running_thread_name, NULL, NULL); msym = lookup_minimal_symbol (running_thread_name, NULL, NULL);
if (!msym) if (!msym.minsym)
/* Older versions of the GNAT runtime were using a different /* Older versions of the GNAT runtime were using a different
(less ideal) name for the symbol where the active thread ID (less ideal) name for the symbol where the active thread ID
is stored. If we couldn't find the symbol using the latest is stored. If we couldn't find the symbol using the latest
@ -124,17 +124,18 @@ get_running_thread_msymbol (void)
static int static int
has_ravenscar_runtime (void) has_ravenscar_runtime (void)
{ {
struct minimal_symbol *msym_ravenscar_runtime_initializer = struct bound_minimal_symbol msym_ravenscar_runtime_initializer =
lookup_minimal_symbol (ravenscar_runtime_initializer, NULL, NULL); lookup_minimal_symbol (ravenscar_runtime_initializer, NULL, NULL);
struct minimal_symbol *msym_known_tasks = struct bound_minimal_symbol msym_known_tasks =
lookup_minimal_symbol (known_tasks_name, NULL, NULL); lookup_minimal_symbol (known_tasks_name, NULL, NULL);
struct minimal_symbol *msym_first_task = struct bound_minimal_symbol msym_first_task =
lookup_minimal_symbol (first_task_name, NULL, NULL); lookup_minimal_symbol (first_task_name, NULL, NULL);
struct minimal_symbol *msym_running_thread = get_running_thread_msymbol (); struct bound_minimal_symbol msym_running_thread
= get_running_thread_msymbol ();
return (msym_ravenscar_runtime_initializer return (msym_ravenscar_runtime_initializer.minsym
&& (msym_known_tasks || msym_first_task) && (msym_known_tasks.minsym || msym_first_task.minsym)
&& msym_running_thread); && msym_running_thread.minsym);
} }
/* Return True if the Ada Ravenscar run-time can be found in the /* Return True if the Ada Ravenscar run-time can be found in the
@ -152,7 +153,7 @@ ravenscar_runtime_initialized (void)
static CORE_ADDR static CORE_ADDR
get_running_thread_id (void) get_running_thread_id (void)
{ {
const struct minimal_symbol *object_msym = get_running_thread_msymbol (); struct bound_minimal_symbol object_msym = get_running_thread_msymbol ();
int object_size; int object_size;
int buf_size; int buf_size;
gdb_byte *buf; gdb_byte *buf;
@ -160,10 +161,10 @@ get_running_thread_id (void)
struct type *builtin_type_void_data_ptr = struct type *builtin_type_void_data_ptr =
builtin_type (target_gdbarch ())->builtin_data_ptr; builtin_type (target_gdbarch ())->builtin_data_ptr;
if (!object_msym) if (!object_msym.minsym)
return 0; return 0;
object_addr = MSYMBOL_VALUE_ADDRESS (object_msym); object_addr = MSYMBOL_VALUE_ADDRESS (object_msym.minsym);
object_size = TYPE_LENGTH (builtin_type_void_data_ptr); object_size = TYPE_LENGTH (builtin_type_void_data_ptr);
buf_size = object_size; buf_size = object_size;
buf = alloca (buf_size); buf = alloca (buf_size);

View file

@ -3670,7 +3670,7 @@ remote_check_symbols (void)
{ {
struct remote_state *rs = get_remote_state (); struct remote_state *rs = get_remote_state ();
char *msg, *reply, *tmp; char *msg, *reply, *tmp;
struct minimal_symbol *sym; struct bound_minimal_symbol sym;
int end; int end;
/* The remote side has no concept of inferiors that aren't running /* The remote side has no concept of inferiors that aren't running
@ -3705,12 +3705,12 @@ remote_check_symbols (void)
end = hex2bin (tmp, (gdb_byte *) msg, strlen (tmp) / 2); end = hex2bin (tmp, (gdb_byte *) msg, strlen (tmp) / 2);
msg[end] = '\0'; msg[end] = '\0';
sym = lookup_minimal_symbol (msg, NULL, NULL); sym = lookup_minimal_symbol (msg, NULL, NULL);
if (sym == NULL) if (sym.minsym == NULL)
xsnprintf (msg, get_remote_packet_size (), "qSymbol::%s", &reply[8]); xsnprintf (msg, get_remote_packet_size (), "qSymbol::%s", &reply[8]);
else else
{ {
int addr_size = gdbarch_addr_bit (target_gdbarch ()) / 8; int addr_size = gdbarch_addr_bit (target_gdbarch ()) / 8;
CORE_ADDR sym_addr = MSYMBOL_VALUE_ADDRESS (sym); CORE_ADDR sym_addr = MSYMBOL_VALUE_ADDRESS (sym.minsym);
/* If this is a function address, return the start of code /* If this is a function address, return the start of code
instead of any data function descriptor. */ instead of any data function descriptor. */

View file

@ -762,13 +762,13 @@ ps_err_e
ps_pglobal_lookup (gdb_ps_prochandle_t ph, const char *ld_object_name, ps_pglobal_lookup (gdb_ps_prochandle_t ph, const char *ld_object_name,
const char *ld_symbol_name, gdb_ps_addr_t *ld_symbol_addr) const char *ld_symbol_name, gdb_ps_addr_t *ld_symbol_addr)
{ {
struct minimal_symbol *ms; struct bound_minimal_symbol ms;
ms = lookup_minimal_symbol (ld_symbol_name, NULL, NULL); ms = lookup_minimal_symbol (ld_symbol_name, NULL, NULL);
if (!ms) if (!ms.minsym)
return PS_NOSYM; return PS_NOSYM;
*ld_symbol_addr = SYMBOL_VALUE_ADDRESS (ms); *ld_symbol_addr = SYMBOL_VALUE_ADDRESS (ms.minsym);
return PS_OK; return PS_OK;
} }

View file

@ -27,10 +27,10 @@
CORE_ADDR CORE_ADDR
sol2_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) sol2_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
{ {
struct minimal_symbol *msym; struct bound_minimal_symbol msym;
msym = lookup_minimal_symbol("elf_bndr", NULL, NULL); msym = lookup_minimal_symbol("elf_bndr", NULL, NULL);
if (msym && MSYMBOL_VALUE_ADDRESS (msym) == pc) if (msym.minsym && MSYMBOL_VALUE_ADDRESS (msym.minsym) == pc)
return frame_unwind_caller_pc (get_current_frame ()); return frame_unwind_caller_pc (get_current_frame ());
return 0; return 0;

View file

@ -550,7 +550,7 @@ static CORE_ADDR
lm_base (void) lm_base (void)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ()); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
struct minimal_symbol *got_sym; struct bound_minimal_symbol got_sym;
CORE_ADDR addr; CORE_ADDR addr;
gdb_byte buf[TIC6X_PTR_SIZE]; gdb_byte buf[TIC6X_PTR_SIZE];
struct dsbt_info *info = get_dsbt_info (); struct dsbt_info *info = get_dsbt_info ();
@ -570,9 +570,9 @@ lm_base (void)
got_sym = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_", NULL, got_sym = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_", NULL,
symfile_objfile); symfile_objfile);
if (got_sym != 0) if (got_sym.minsym != 0)
{ {
addr = MSYMBOL_VALUE_ADDRESS (got_sym); addr = MSYMBOL_VALUE_ADDRESS (got_sym.minsym);
if (solib_dsbt_debug) if (solib_dsbt_debug)
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,
"lm_base: get addr %x by _GLOBAL_OFFSET_TABLE_.\n", "lm_base: get addr %x by _GLOBAL_OFFSET_TABLE_.\n",

View file

@ -266,7 +266,7 @@ static CORE_ADDR
lm_base (void) lm_base (void)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ()); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
struct minimal_symbol *got_sym; struct bound_minimal_symbol got_sym;
CORE_ADDR addr; CORE_ADDR addr;
gdb_byte buf[FRV_PTR_SIZE]; gdb_byte buf[FRV_PTR_SIZE];
@ -284,7 +284,7 @@ lm_base (void)
got_sym = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_", NULL, got_sym = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_", NULL,
symfile_objfile); symfile_objfile);
if (got_sym == 0) if (got_sym.minsym == 0)
{ {
if (solib_frv_debug) if (solib_frv_debug)
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,
@ -292,7 +292,7 @@ lm_base (void)
return 0; return 0;
} }
addr = MSYMBOL_VALUE_ADDRESS (got_sym) + 8; addr = MSYMBOL_VALUE_ADDRESS (got_sym.minsym) + 8;
if (solib_frv_debug) if (solib_frv_debug)
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,
@ -919,14 +919,14 @@ frv_relocate_section_addresses (struct so_list *so,
static CORE_ADDR static CORE_ADDR
main_got (void) main_got (void)
{ {
struct minimal_symbol *got_sym; struct bound_minimal_symbol got_sym;
got_sym = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_", got_sym = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_",
NULL, symfile_objfile); NULL, symfile_objfile);
if (got_sym == 0) if (got_sym.minsym == 0)
return 0; return 0;
return MSYMBOL_VALUE_ADDRESS (got_sym); return MSYMBOL_VALUE_ADDRESS (got_sym.minsym);
} }
/* Find the global pointer for the given function address ADDR. */ /* Find the global pointer for the given function address ADDR. */

View file

@ -281,13 +281,13 @@ static CORE_ADDR debug_base; /* Base of dynamic linker structures. */
static CORE_ADDR static CORE_ADDR
locate_base (void) locate_base (void)
{ {
struct minimal_symbol *msymbol; struct bound_minimal_symbol msymbol;
CORE_ADDR address = 0; CORE_ADDR address = 0;
msymbol = lookup_minimal_symbol (DEBUG_BASE, NULL, symfile_objfile); msymbol = lookup_minimal_symbol (DEBUG_BASE, NULL, symfile_objfile);
if ((msymbol != NULL) && (MSYMBOL_VALUE_ADDRESS (msymbol) != 0)) if ((msymbol.minsym != NULL) && (MSYMBOL_VALUE_ADDRESS (msymbol.minsym) != 0))
{ {
address = MSYMBOL_VALUE_ADDRESS (msymbol); address = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
} }
return (address); return (address);
} }

View file

@ -186,7 +186,7 @@ static void
som_solib_create_inferior_hook (int from_tty) som_solib_create_inferior_hook (int from_tty)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ()); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
struct minimal_symbol *msymbol; struct bound_minimal_symbol msymbol;
unsigned int dld_flags, status, have_endo; unsigned int dld_flags, status, have_endo;
asection *shlib_info; asection *shlib_info;
gdb_byte buf[4]; gdb_byte buf[4];
@ -216,10 +216,10 @@ som_solib_create_inferior_hook (int from_tty)
annoyance to users of modern systems and foul up the testsuite as annoyance to users of modern systems and foul up the testsuite as
well. As a result, the warnings have been disabled. */ well. As a result, the warnings have been disabled. */
msymbol = lookup_minimal_symbol ("__d_pid", NULL, symfile_objfile); msymbol = lookup_minimal_symbol ("__d_pid", NULL, symfile_objfile);
if (msymbol == NULL) if (msymbol.minsym == NULL)
goto keep_going; goto keep_going;
anaddr = MSYMBOL_VALUE_ADDRESS (msymbol); anaddr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
store_unsigned_integer (buf, 4, byte_order, ptid_get_pid (inferior_ptid)); store_unsigned_integer (buf, 4, byte_order, ptid_get_pid (inferior_ptid));
status = target_write_memory (anaddr, buf, 4); status = target_write_memory (anaddr, buf, 4);
if (status != 0) if (status != 0)
@ -241,9 +241,9 @@ GDB will be unable to track shl_load/shl_unload calls"));
We'll look first for the old flavor and then the new. */ We'll look first for the old flavor and then the new. */
msymbol = lookup_minimal_symbol ("_DLD_HOOK", NULL, symfile_objfile); msymbol = lookup_minimal_symbol ("_DLD_HOOK", NULL, symfile_objfile);
if (msymbol == NULL) if (msymbol.minsym == NULL)
msymbol = lookup_minimal_symbol ("__d_trap", NULL, symfile_objfile); msymbol = lookup_minimal_symbol ("__d_trap", NULL, symfile_objfile);
if (msymbol == NULL) if (msymbol.minsym == NULL)
{ {
warning (_("\ warning (_("\
Unable to find _DLD_HOOK symbol in object file.\n\ Unable to find _DLD_HOOK symbol in object file.\n\
@ -251,22 +251,23 @@ Suggest linking with /opt/langtools/lib/end.o.\n\
GDB will be unable to track shl_load/shl_unload calls")); GDB will be unable to track shl_load/shl_unload calls"));
goto keep_going; goto keep_going;
} }
anaddr = MSYMBOL_VALUE_ADDRESS (msymbol); anaddr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
dld_cache.hook.address = anaddr; dld_cache.hook.address = anaddr;
/* Grrr, this might not be an export symbol! We have to find the /* Grrr, this might not be an export symbol! We have to find the
export stub. */ export stub. */
msymbol = hppa_lookup_stub_minimal_symbol (MSYMBOL_LINKAGE_NAME (msymbol), msymbol
EXPORT); = hppa_lookup_stub_minimal_symbol (MSYMBOL_LINKAGE_NAME (msymbol.minsym),
if (msymbol != NULL) EXPORT);
if (msymbol.minsym != NULL)
{ {
anaddr = MSYMBOL_VALUE (msymbol); anaddr = MSYMBOL_VALUE (msymbol.minsym);
dld_cache.hook_stub.address = anaddr; dld_cache.hook_stub.address = anaddr;
} }
store_unsigned_integer (buf, 4, byte_order, anaddr); store_unsigned_integer (buf, 4, byte_order, anaddr);
msymbol = lookup_minimal_symbol ("__dld_hook", NULL, symfile_objfile); msymbol = lookup_minimal_symbol ("__dld_hook", NULL, symfile_objfile);
if (msymbol == NULL) if (msymbol.minsym == NULL)
{ {
warning (_("\ warning (_("\
Unable to find __dld_hook symbol in object file.\n\ Unable to find __dld_hook symbol in object file.\n\
@ -274,13 +275,13 @@ Suggest linking with /opt/langtools/lib/end.o.\n\
GDB will be unable to track shl_load/shl_unload calls")); GDB will be unable to track shl_load/shl_unload calls"));
goto keep_going; goto keep_going;
} }
anaddr = MSYMBOL_VALUE_ADDRESS (msymbol); anaddr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
status = target_write_memory (anaddr, buf, 4); status = target_write_memory (anaddr, buf, 4);
/* Now set a shlib_event breakpoint at __d_trap so we can track /* Now set a shlib_event breakpoint at __d_trap so we can track
significant shared library events. */ significant shared library events. */
msymbol = lookup_minimal_symbol ("__d_trap", NULL, symfile_objfile); msymbol = lookup_minimal_symbol ("__d_trap", NULL, symfile_objfile);
if (msymbol == NULL) if (msymbol.minsym == NULL)
{ {
warning (_("\ warning (_("\
Unable to find __dld_d_trap symbol in object file.\n\ Unable to find __dld_d_trap symbol in object file.\n\
@ -289,7 +290,7 @@ GDB will be unable to track shl_load/shl_unload calls"));
goto keep_going; goto keep_going;
} }
create_solib_event_breakpoint (target_gdbarch (), create_solib_event_breakpoint (target_gdbarch (),
MSYMBOL_VALUE_ADDRESS (msymbol)); MSYMBOL_VALUE_ADDRESS (msymbol.minsym));
/* We have all the support usually found in end.o, so we can track /* We have all the support usually found in end.o, so we can track
shl_load and shl_unload calls. */ shl_load and shl_unload calls. */
@ -300,12 +301,12 @@ keep_going:
/* Get the address of __dld_flags, if no such symbol exists, then we can /* Get the address of __dld_flags, if no such symbol exists, then we can
not debug the shared code. */ not debug the shared code. */
msymbol = lookup_minimal_symbol ("__dld_flags", NULL, NULL); msymbol = lookup_minimal_symbol ("__dld_flags", NULL, NULL);
if (msymbol == NULL) if (msymbol.minsym == NULL)
{ {
error (_("Unable to find __dld_flags symbol in object file.")); error (_("Unable to find __dld_flags symbol in object file."));
} }
anaddr = MSYMBOL_VALUE_ADDRESS (msymbol); anaddr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
/* Read the current contents. */ /* Read the current contents. */
status = target_read_memory (anaddr, buf, 4); status = target_read_memory (anaddr, buf, 4);
@ -347,10 +348,10 @@ manpage for methods to privately map shared library text."));
loaded at startup time (what a crock). */ loaded at startup time (what a crock). */
msymbol = lookup_minimal_symbol ("_start", NULL, symfile_objfile); msymbol = lookup_minimal_symbol ("_start", NULL, symfile_objfile);
if (msymbol == NULL) if (msymbol.minsym == NULL)
error (_("Unable to find _start symbol in object file.")); error (_("Unable to find _start symbol in object file."));
anaddr = MSYMBOL_VALUE_ADDRESS (msymbol); anaddr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
/* Make the breakpoint at "_start" a shared library event breakpoint. */ /* Make the breakpoint at "_start" a shared library event breakpoint. */
create_solib_event_breakpoint (target_gdbarch (), anaddr); create_solib_event_breakpoint (target_gdbarch (), anaddr);
@ -368,7 +369,7 @@ som_solib_desire_dynamic_linker_symbols (void)
{ {
struct objfile *objfile; struct objfile *objfile;
struct unwind_table_entry *u; struct unwind_table_entry *u;
struct minimal_symbol *dld_msymbol; struct bound_minimal_symbol dld_msymbol;
/* Do we already know the value of these symbols? If so, then /* Do we already know the value of these symbols? If so, then
we've no work to do. we've no work to do.
@ -382,31 +383,32 @@ som_solib_desire_dynamic_linker_symbols (void)
ALL_OBJFILES (objfile) ALL_OBJFILES (objfile)
{ {
dld_msymbol = lookup_minimal_symbol ("shl_load", NULL, objfile); dld_msymbol = lookup_minimal_symbol ("shl_load", NULL, objfile);
if (dld_msymbol != NULL) if (dld_msymbol.minsym != NULL)
{ {
dld_cache.load.address = MSYMBOL_VALUE (dld_msymbol); dld_cache.load.address = MSYMBOL_VALUE (dld_msymbol.minsym);
dld_cache.load.unwind = find_unwind_entry (dld_cache.load.address); dld_cache.load.unwind = find_unwind_entry (dld_cache.load.address);
} }
dld_msymbol = lookup_minimal_symbol_solib_trampoline ("shl_load", dld_msymbol = lookup_minimal_symbol_solib_trampoline ("shl_load",
objfile); objfile);
if (dld_msymbol != NULL) if (dld_msymbol.minsym != NULL)
{ {
if (MSYMBOL_TYPE (dld_msymbol) == mst_solib_trampoline) if (MSYMBOL_TYPE (dld_msymbol.minsym) == mst_solib_trampoline)
{ {
u = find_unwind_entry (MSYMBOL_VALUE (dld_msymbol)); u = find_unwind_entry (MSYMBOL_VALUE (dld_msymbol.minsym));
if ((u != NULL) && (u->stub_unwind.stub_type == EXPORT)) if ((u != NULL) && (u->stub_unwind.stub_type == EXPORT))
{ {
dld_cache.load_stub.address = MSYMBOL_VALUE (dld_msymbol); dld_cache.load_stub.address
= MSYMBOL_VALUE (dld_msymbol.minsym);
dld_cache.load_stub.unwind = u; dld_cache.load_stub.unwind = u;
} }
} }
} }
dld_msymbol = lookup_minimal_symbol ("shl_unload", NULL, objfile); dld_msymbol = lookup_minimal_symbol ("shl_unload", NULL, objfile);
if (dld_msymbol != NULL) if (dld_msymbol.minsym != NULL)
{ {
dld_cache.unload.address = MSYMBOL_VALUE (dld_msymbol); dld_cache.unload.address = MSYMBOL_VALUE (dld_msymbol.minsym);
dld_cache.unload.unwind = find_unwind_entry (dld_cache.unload.address); dld_cache.unload.unwind = find_unwind_entry (dld_cache.unload.address);
/* ??rehrauer: I'm not sure exactly what this is, but it appears /* ??rehrauer: I'm not sure exactly what this is, but it appears
@ -429,14 +431,15 @@ som_solib_desire_dynamic_linker_symbols (void)
dld_msymbol = lookup_minimal_symbol_solib_trampoline ("shl_unload", dld_msymbol = lookup_minimal_symbol_solib_trampoline ("shl_unload",
objfile); objfile);
if (dld_msymbol != NULL) if (dld_msymbol.minsym != NULL)
{ {
if (MSYMBOL_TYPE (dld_msymbol) == mst_solib_trampoline) if (MSYMBOL_TYPE (dld_msymbol.minsym) == mst_solib_trampoline)
{ {
u = find_unwind_entry (MSYMBOL_VALUE (dld_msymbol)); u = find_unwind_entry (MSYMBOL_VALUE (dld_msymbol.minsym));
if ((u != NULL) && (u->stub_unwind.stub_type == EXPORT)) if ((u != NULL) && (u->stub_unwind.stub_type == EXPORT))
{ {
dld_cache.unload_stub.address = MSYMBOL_VALUE (dld_msymbol); dld_cache.unload_stub.address
= MSYMBOL_VALUE (dld_msymbol.minsym);
dld_cache.unload_stub.unwind = u; dld_cache.unload_stub.unwind = u;
} }
} }
@ -526,35 +529,35 @@ static CORE_ADDR
link_map_start (void) link_map_start (void)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ()); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
struct minimal_symbol *sym; struct bound_minimal_symbol sym;
CORE_ADDR addr; CORE_ADDR addr;
gdb_byte buf[4]; gdb_byte buf[4];
unsigned int dld_flags; unsigned int dld_flags;
sym = lookup_minimal_symbol ("__dld_flags", NULL, NULL); sym = lookup_minimal_symbol ("__dld_flags", NULL, NULL);
if (!sym) if (!sym.minsym)
error (_("Unable to find __dld_flags symbol in object file.")); error (_("Unable to find __dld_flags symbol in object file."));
addr = MSYMBOL_VALUE_ADDRESS (sym); addr = MSYMBOL_VALUE_ADDRESS (sym.minsym);
read_memory (addr, buf, 4); read_memory (addr, buf, 4);
dld_flags = extract_unsigned_integer (buf, 4, byte_order); dld_flags = extract_unsigned_integer (buf, 4, byte_order);
if ((dld_flags & DLD_FLAGS_LISTVALID) == 0) if ((dld_flags & DLD_FLAGS_LISTVALID) == 0)
error (_("__dld_list is not valid according to __dld_flags.")); error (_("__dld_list is not valid according to __dld_flags."));
sym = lookup_minimal_symbol ("__dld_list", NULL, NULL); sym = lookup_minimal_symbol ("__dld_list", NULL, NULL);
if (!sym) if (!sym.minsym)
{ {
/* Older crt0.o files (hpux8) don't have __dld_list as a symbol, /* Older crt0.o files (hpux8) don't have __dld_list as a symbol,
but the data is still available if you know where to look. */ but the data is still available if you know where to look. */
sym = lookup_minimal_symbol ("__dld_flags", NULL, NULL); sym = lookup_minimal_symbol ("__dld_flags", NULL, NULL);
if (!sym) if (!sym.minsym)
{ {
error (_("Unable to find dynamic library list.")); error (_("Unable to find dynamic library list."));
return 0; return 0;
} }
addr = MSYMBOL_VALUE_ADDRESS (sym) - 8; addr = MSYMBOL_VALUE_ADDRESS (sym.minsym) - 8;
} }
else else
addr = MSYMBOL_VALUE_ADDRESS (sym); addr = MSYMBOL_VALUE_ADDRESS (sym.minsym);
read_memory (addr, buf, 4); read_memory (addr, buf, 4);
addr = extract_unsigned_integer (buf, 4, byte_order); addr = extract_unsigned_integer (buf, 4, byte_order);

View file

@ -408,7 +408,7 @@ spu_lookup_lib_symbol (const struct objfile *objfile,
static int static int
spu_enable_break (struct objfile *objfile) spu_enable_break (struct objfile *objfile)
{ {
struct minimal_symbol *spe_event_sym = NULL; struct bound_minimal_symbol spe_event_sym;
/* The libspe library will call __spe_context_update_event whenever any /* The libspe library will call __spe_context_update_event whenever any
SPE context is allocated or destroyed. */ SPE context is allocated or destroyed. */
@ -416,9 +416,9 @@ spu_enable_break (struct objfile *objfile)
NULL, objfile); NULL, objfile);
/* Place a solib_event breakpoint on the symbol. */ /* Place a solib_event breakpoint on the symbol. */
if (spe_event_sym) if (spe_event_sym.minsym)
{ {
CORE_ADDR addr = MSYMBOL_VALUE_ADDRESS (spe_event_sym); CORE_ADDR addr = MSYMBOL_VALUE_ADDRESS (spe_event_sym.minsym);
addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (), addr, addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (), addr,
&current_target); &current_target);
@ -434,8 +434,8 @@ spu_enable_break (struct objfile *objfile)
static void static void
ocl_enable_break (struct objfile *objfile) ocl_enable_break (struct objfile *objfile)
{ {
struct minimal_symbol *event_sym = NULL; struct bound_minimal_symbol event_sym;
struct minimal_symbol *addr_sym = NULL; struct bound_minimal_symbol addr_sym;
/* The OpenCL runtime on the SPU will call __opencl_program_update_event /* The OpenCL runtime on the SPU will call __opencl_program_update_event
whenever an OpenCL program is loaded. */ whenever an OpenCL program is loaded. */
@ -445,10 +445,10 @@ ocl_enable_break (struct objfile *objfile)
at opencl_elf_image_address. */ at opencl_elf_image_address. */
addr_sym = lookup_minimal_symbol ("opencl_elf_image_address", NULL, objfile); addr_sym = lookup_minimal_symbol ("opencl_elf_image_address", NULL, objfile);
if (event_sym && addr_sym) if (event_sym.minsym && addr_sym.minsym)
{ {
/* Place a solib_event breakpoint on the symbol. */ /* Place a solib_event breakpoint on the symbol. */
CORE_ADDR event_addr = MSYMBOL_VALUE_ADDRESS (event_sym); CORE_ADDR event_addr = MSYMBOL_VALUE_ADDRESS (event_sym.minsym);
create_solib_event_breakpoint (get_objfile_arch (objfile), event_addr); create_solib_event_breakpoint (get_objfile_arch (objfile), event_addr);
/* Store the address of the symbol that will point to OpenCL program /* Store the address of the symbol that will point to OpenCL program
@ -459,7 +459,7 @@ ocl_enable_break (struct objfile *objfile)
&objfile->objfile_obstack, &objfile->objfile_obstack,
objfile->sections_end - objfile->sections, objfile->sections_end - objfile->sections,
CORE_ADDR); CORE_ADDR);
*ocl_program_addr_base = MSYMBOL_VALUE_ADDRESS (addr_sym); *ocl_program_addr_base = MSYMBOL_VALUE_ADDRESS (addr_sym.minsym);
set_objfile_data (objfile, ocl_program_data_key, set_objfile_data (objfile, ocl_program_data_key,
ocl_program_addr_base); ocl_program_addr_base);
} }

View file

@ -787,7 +787,7 @@ scan_dyntag_auxv (int dyntag, CORE_ADDR *ptr)
static CORE_ADDR static CORE_ADDR
elf_locate_base (void) elf_locate_base (void)
{ {
struct minimal_symbol *msymbol; struct bound_minimal_symbol msymbol;
CORE_ADDR dyn_ptr; CORE_ADDR dyn_ptr;
/* Look for DT_MIPS_RLD_MAP first. MIPS executables use this /* Look for DT_MIPS_RLD_MAP first. MIPS executables use this
@ -816,8 +816,8 @@ elf_locate_base (void)
/* This may be a static executable. Look for the symbol /* This may be a static executable. Look for the symbol
conventionally named _r_debug, as a last resort. */ conventionally named _r_debug, as a last resort. */
msymbol = lookup_minimal_symbol ("_r_debug", NULL, symfile_objfile); msymbol = lookup_minimal_symbol ("_r_debug", NULL, symfile_objfile);
if (msymbol != NULL) if (msymbol.minsym != NULL)
return MSYMBOL_VALUE_ADDRESS (msymbol); return MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
/* DT_DEBUG entry not found. */ /* DT_DEBUG entry not found. */
return 0; return 0;
@ -2091,7 +2091,7 @@ cmp_name_and_sec_flags (asymbol *sym, void *data)
static int static int
enable_break (struct svr4_info *info, int from_tty) enable_break (struct svr4_info *info, int from_tty)
{ {
struct minimal_symbol *msymbol; struct bound_minimal_symbol msymbol;
const char * const *bkpt_namep; const char * const *bkpt_namep;
asection *interp_sect; asection *interp_sect;
char *interp_name; char *interp_name;
@ -2348,9 +2348,10 @@ enable_break (struct svr4_info *info, int from_tty)
for (bkpt_namep = solib_break_names; *bkpt_namep != NULL; bkpt_namep++) for (bkpt_namep = solib_break_names; *bkpt_namep != NULL; bkpt_namep++)
{ {
msymbol = lookup_minimal_symbol (*bkpt_namep, NULL, symfile_objfile); msymbol = lookup_minimal_symbol (*bkpt_namep, NULL, symfile_objfile);
if ((msymbol != NULL) && (MSYMBOL_VALUE_ADDRESS (msymbol) != 0)) if ((msymbol.minsym != NULL)
&& (MSYMBOL_VALUE_ADDRESS (msymbol.minsym) != 0))
{ {
sym_addr = MSYMBOL_VALUE_ADDRESS (msymbol); sym_addr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (), sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (),
sym_addr, sym_addr,
&current_target); &current_target);
@ -2364,9 +2365,10 @@ enable_break (struct svr4_info *info, int from_tty)
for (bkpt_namep = bkpt_names; *bkpt_namep != NULL; bkpt_namep++) for (bkpt_namep = bkpt_names; *bkpt_namep != NULL; bkpt_namep++)
{ {
msymbol = lookup_minimal_symbol (*bkpt_namep, NULL, symfile_objfile); msymbol = lookup_minimal_symbol (*bkpt_namep, NULL, symfile_objfile);
if ((msymbol != NULL) && (MSYMBOL_VALUE_ADDRESS (msymbol) != 0)) if ((msymbol.minsym != NULL)
&& (MSYMBOL_VALUE_ADDRESS (msymbol.minsym) != 0))
{ {
sym_addr = MSYMBOL_VALUE_ADDRESS (msymbol); sym_addr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (), sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (),
sym_addr, sym_addr,
&current_target); &current_target);

View file

@ -1747,7 +1747,7 @@ spu_get_overlay_table (struct objfile *objfile)
{ {
enum bfd_endian byte_order = bfd_big_endian (objfile->obfd)? enum bfd_endian byte_order = bfd_big_endian (objfile->obfd)?
BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE; BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE;
struct minimal_symbol *ovly_table_msym, *ovly_buf_table_msym; struct bound_minimal_symbol ovly_table_msym, ovly_buf_table_msym;
CORE_ADDR ovly_table_base, ovly_buf_table_base; CORE_ADDR ovly_table_base, ovly_buf_table_base;
unsigned ovly_table_size, ovly_buf_table_size; unsigned ovly_table_size, ovly_buf_table_size;
struct spu_overlay_table *tbl; struct spu_overlay_table *tbl;
@ -1760,19 +1760,19 @@ spu_get_overlay_table (struct objfile *objfile)
return tbl; return tbl;
ovly_table_msym = lookup_minimal_symbol ("_ovly_table", NULL, objfile); ovly_table_msym = lookup_minimal_symbol ("_ovly_table", NULL, objfile);
if (!ovly_table_msym) if (!ovly_table_msym.minsym)
return NULL; return NULL;
ovly_buf_table_msym = lookup_minimal_symbol ("_ovly_buf_table", ovly_buf_table_msym = lookup_minimal_symbol ("_ovly_buf_table",
NULL, objfile); NULL, objfile);
if (!ovly_buf_table_msym) if (!ovly_buf_table_msym.minsym)
return NULL; return NULL;
ovly_table_base = MSYMBOL_VALUE_ADDRESS (ovly_table_msym); ovly_table_base = MSYMBOL_VALUE_ADDRESS (ovly_table_msym.minsym);
ovly_table_size = MSYMBOL_SIZE (ovly_table_msym); ovly_table_size = MSYMBOL_SIZE (ovly_table_msym.minsym);
ovly_buf_table_base = MSYMBOL_VALUE_ADDRESS (ovly_buf_table_msym); ovly_buf_table_base = MSYMBOL_VALUE_ADDRESS (ovly_buf_table_msym.minsym);
ovly_buf_table_size = MSYMBOL_SIZE (ovly_buf_table_msym); ovly_buf_table_size = MSYMBOL_SIZE (ovly_buf_table_msym.minsym);
ovly_table = xmalloc (ovly_table_size); ovly_table = xmalloc (ovly_table_size);
read_memory (ovly_table_base, ovly_table, ovly_table_size); read_memory (ovly_table_base, ovly_table, ovly_table_size);
@ -1898,7 +1898,7 @@ spu_overlay_new_objfile (struct objfile *objfile)
static void static void
spu_catch_start (struct objfile *objfile) spu_catch_start (struct objfile *objfile)
{ {
struct minimal_symbol *minsym; struct bound_minimal_symbol minsym;
struct symtab *symtab; struct symtab *symtab;
CORE_ADDR pc; CORE_ADDR pc;
char buf[32]; char buf[32];
@ -1918,13 +1918,14 @@ spu_catch_start (struct objfile *objfile)
/* There can be multiple symbols named "main". Search for the /* There can be multiple symbols named "main". Search for the
"main" in *this* objfile. */ "main" in *this* objfile. */
minsym = lookup_minimal_symbol ("main", NULL, objfile); minsym = lookup_minimal_symbol ("main", NULL, objfile);
if (!minsym) if (!minsym.minsym)
return; return;
/* If we have debugging information, try to use it -- this /* If we have debugging information, try to use it -- this
will allow us to properly skip the prologue. */ will allow us to properly skip the prologue. */
pc = MSYMBOL_VALUE_ADDRESS (minsym); pc = MSYMBOL_VALUE_ADDRESS (minsym.minsym);
symtab = find_pc_sect_symtab (pc, MSYMBOL_OBJ_SECTION (objfile, minsym)); symtab = find_pc_sect_symtab (pc, MSYMBOL_OBJ_SECTION (minsym.objfile,
minsym.minsym));
if (symtab != NULL) if (symtab != NULL)
{ {
struct blockvector *bv = BLOCKVECTOR (symtab); struct blockvector *bv = BLOCKVECTOR (symtab);
@ -1981,7 +1982,7 @@ spu_objfile_from_frame (struct frame_info *frame)
static void static void
flush_ea_cache (void) flush_ea_cache (void)
{ {
struct minimal_symbol *msymbol; struct bound_minimal_symbol msymbol;
struct objfile *obj; struct objfile *obj;
if (!has_stack_frames ()) if (!has_stack_frames ())
@ -1993,7 +1994,7 @@ flush_ea_cache (void)
/* Lookup inferior function __cache_flush. */ /* Lookup inferior function __cache_flush. */
msymbol = lookup_minimal_symbol ("__cache_flush", NULL, obj); msymbol = lookup_minimal_symbol ("__cache_flush", NULL, obj);
if (msymbol != NULL) if (msymbol.minsym != NULL)
{ {
struct type *type; struct type *type;
CORE_ADDR addr; CORE_ADDR addr;
@ -2001,7 +2002,7 @@ flush_ea_cache (void)
type = objfile_type (obj)->builtin_void; type = objfile_type (obj)->builtin_void;
type = lookup_function_type (type); type = lookup_function_type (type);
type = lookup_pointer_type (type); type = lookup_pointer_type (type);
addr = MSYMBOL_VALUE_ADDRESS (msymbol); addr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
call_function_by_hand (value_from_pointer (type, addr), 0, NULL); call_function_by_hand (value_from_pointer (type, addr), 0, NULL);
} }

View file

@ -1168,17 +1168,17 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
SYMBOL_LINKAGE_NAME (sym)) SYMBOL_LINKAGE_NAME (sym))
!= SYMBOL_LINKAGE_NAME (sym)) != SYMBOL_LINKAGE_NAME (sym))
{ {
struct minimal_symbol *msym; struct bound_minimal_symbol msym;
msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym), msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym),
NULL, objfile); NULL, objfile);
if (msym != NULL) if (msym.minsym != NULL)
{ {
const char *new_name = gdbarch_static_transform_name const char *new_name = gdbarch_static_transform_name
(gdbarch, SYMBOL_LINKAGE_NAME (sym)); (gdbarch, SYMBOL_LINKAGE_NAME (sym));
SYMBOL_SET_LINKAGE_NAME (sym, new_name); SYMBOL_SET_LINKAGE_NAME (sym, new_name);
SYMBOL_VALUE_ADDRESS (sym) = MSYMBOL_VALUE_ADDRESS (msym); SYMBOL_VALUE_ADDRESS (sym) = MSYMBOL_VALUE_ADDRESS (msym.minsym);
} }
} }
SYMBOL_DOMAIN (sym) = VAR_DOMAIN; SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
@ -1360,17 +1360,17 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
SYMBOL_LINKAGE_NAME (sym)) SYMBOL_LINKAGE_NAME (sym))
!= SYMBOL_LINKAGE_NAME (sym)) != SYMBOL_LINKAGE_NAME (sym))
{ {
struct minimal_symbol *msym; struct bound_minimal_symbol msym;
msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym), msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym),
NULL, objfile); NULL, objfile);
if (msym != NULL) if (msym.minsym != NULL)
{ {
const char *new_name = gdbarch_static_transform_name const char *new_name = gdbarch_static_transform_name
(gdbarch, SYMBOL_LINKAGE_NAME (sym)); (gdbarch, SYMBOL_LINKAGE_NAME (sym));
SYMBOL_SET_LINKAGE_NAME (sym, new_name); SYMBOL_SET_LINKAGE_NAME (sym, new_name);
SYMBOL_VALUE_ADDRESS (sym) = MSYMBOL_VALUE_ADDRESS (msym); SYMBOL_VALUE_ADDRESS (sym) = MSYMBOL_VALUE_ADDRESS (msym.minsym);
} }
} }
SYMBOL_DOMAIN (sym) = VAR_DOMAIN; SYMBOL_DOMAIN (sym) = VAR_DOMAIN;

View file

@ -3532,7 +3532,7 @@ read_target_long_array (CORE_ADDR memaddr, unsigned int *myaddr,
static int static int
simple_read_overlay_table (void) simple_read_overlay_table (void)
{ {
struct minimal_symbol *novlys_msym; struct bound_minimal_symbol novlys_msym;
struct bound_minimal_symbol ovly_table_msym; struct bound_minimal_symbol ovly_table_msym;
struct gdbarch *gdbarch; struct gdbarch *gdbarch;
int word_size; int word_size;
@ -3540,7 +3540,7 @@ simple_read_overlay_table (void)
simple_free_overlay_table (); simple_free_overlay_table ();
novlys_msym = lookup_minimal_symbol ("_novlys", NULL, NULL); novlys_msym = lookup_minimal_symbol ("_novlys", NULL, NULL);
if (! novlys_msym) if (! novlys_msym.minsym)
{ {
error (_("Error reading inferior's overlay table: " error (_("Error reading inferior's overlay table: "
"couldn't find `_novlys' variable\n" "couldn't find `_novlys' variable\n"
@ -3561,8 +3561,9 @@ simple_read_overlay_table (void)
word_size = gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT; word_size = gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
byte_order = gdbarch_byte_order (gdbarch); byte_order = gdbarch_byte_order (gdbarch);
cache_novlys = read_memory_integer (MSYMBOL_VALUE_ADDRESS (novlys_msym), cache_novlys
4, byte_order); = read_memory_integer (MSYMBOL_VALUE_ADDRESS (novlys_msym.minsym),
4, byte_order);
cache_ovly_table cache_ovly_table
= (void *) xmalloc (cache_novlys * sizeof (*cache_ovly_table)); = (void *) xmalloc (cache_novlys * sizeof (*cache_ovly_table));
cache_ovly_table_base = MSYMBOL_VALUE_ADDRESS (ovly_table_msym.minsym); cache_ovly_table_base = MSYMBOL_VALUE_ADDRESS (ovly_table_msym.minsym);
@ -3633,15 +3634,15 @@ simple_overlay_update (struct obj_section *osect)
{ {
/* Does its cached location match what's currently in the /* Does its cached location match what's currently in the
symtab? */ symtab? */
struct minimal_symbol *minsym struct bound_minimal_symbol minsym
= lookup_minimal_symbol ("_ovly_table", NULL, NULL); = lookup_minimal_symbol ("_ovly_table", NULL, NULL);
if (minsym == NULL) if (minsym.minsym == NULL)
error (_("Error reading inferior's overlay table: couldn't " error (_("Error reading inferior's overlay table: couldn't "
"find `_ovly_table' array\n" "find `_ovly_table' array\n"
"in inferior. Use `overlay manual' mode.")); "in inferior. Use `overlay manual' mode."));
if (cache_ovly_table_base == MSYMBOL_VALUE_ADDRESS (minsym)) if (cache_ovly_table_base == MSYMBOL_VALUE_ADDRESS (minsym.minsym))
/* Then go ahead and try to look up this single section in /* Then go ahead and try to look up this single section in
the cache. */ the cache. */
if (simple_overlay_update_1 (osect)) if (simple_overlay_update_1 (osect))

View file

@ -2379,7 +2379,7 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
{ {
mfunsym mfunsym
= lookup_minimal_symbol_text (MSYMBOL_LINKAGE_NAME (msymbol.minsym), = lookup_minimal_symbol_text (MSYMBOL_LINKAGE_NAME (msymbol.minsym),
NULL); NULL).minsym;
if (mfunsym == NULL) if (mfunsym == NULL)
/* I eliminated this warning since it is coming out /* I eliminated this warning since it is coming out
* in the following situation: * in the following situation:

View file

@ -2701,7 +2701,7 @@ scope_info (char *args, int from_tty)
{ {
struct symtabs_and_lines sals; struct symtabs_and_lines sals;
struct symbol *sym; struct symbol *sym;
struct minimal_symbol *msym; struct bound_minimal_symbol msym;
struct block *block; struct block *block;
const char *symname; const char *symname;
char *save_args = args; char *save_args = args;
@ -2824,14 +2824,14 @@ scope_info (char *args, int from_tty)
case LOC_UNRESOLVED: case LOC_UNRESOLVED:
msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym), msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym),
NULL, NULL); NULL, NULL);
if (msym == NULL) if (msym.minsym == NULL)
printf_filtered ("Unresolved Static"); printf_filtered ("Unresolved Static");
else else
{ {
printf_filtered ("static storage at address "); printf_filtered ("static storage at address ");
printf_filtered ("%s", printf_filtered ("%s",
paddress (gdbarch, paddress (gdbarch,
MSYMBOL_VALUE_ADDRESS (msym))); MSYMBOL_VALUE_ADDRESS (msym.minsym)));
} }
break; break;
case LOC_OPTIMIZED_OUT: case LOC_OPTIMIZED_OUT:

View file

@ -339,17 +339,17 @@ tui_get_begin_asm_address (struct gdbarch **gdbarch_p, CORE_ADDR *addr_p)
if (element->addr == 0) if (element->addr == 0)
{ {
struct minimal_symbol *main_symbol; struct bound_minimal_symbol main_symbol;
/* Find address of the start of program. /* Find address of the start of program.
Note: this should be language specific. */ Note: this should be language specific. */
main_symbol = lookup_minimal_symbol ("main", NULL, NULL); main_symbol = lookup_minimal_symbol ("main", NULL, NULL);
if (main_symbol == 0) if (main_symbol.minsym == 0)
main_symbol = lookup_minimal_symbol ("MAIN", NULL, NULL); main_symbol = lookup_minimal_symbol ("MAIN", NULL, NULL);
if (main_symbol == 0) if (main_symbol.minsym == 0)
main_symbol = lookup_minimal_symbol ("_start", NULL, NULL); main_symbol = lookup_minimal_symbol ("_start", NULL, NULL);
if (main_symbol) if (main_symbol.minsym)
addr = MSYMBOL_VALUE_ADDRESS (main_symbol); addr = MSYMBOL_VALUE_ADDRESS (main_symbol.minsym);
else else
addr = 0; addr = 0;
} }

View file

@ -2750,15 +2750,15 @@ value_static_field (struct type *type, int fieldno)
{ {
/* With some compilers, e.g. HP aCC, static data members are /* With some compilers, e.g. HP aCC, static data members are
reported as non-debuggable symbols. */ reported as non-debuggable symbols. */
struct minimal_symbol *msym = lookup_minimal_symbol (phys_name, struct bound_minimal_symbol msym
NULL, NULL); = lookup_minimal_symbol (phys_name, NULL, NULL);
if (!msym) if (!msym.minsym)
return allocate_optimized_out_value (type); return allocate_optimized_out_value (type);
else else
{ {
retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno), retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno),
MSYMBOL_VALUE_ADDRESS (msym)); MSYMBOL_VALUE_ADDRESS (msym.minsym));
} }
} }
else else