2014-02-26 Tom Tromey <tromey@redhat.com>
+ * ada-lang.c (ada_main_name): Update.
+ (ada_add_standard_exceptions): Update.
+ * ada-tasks.c (ada_tasks_inferior_data_sniffer): Update.
+ * aix-thread.c (pdc_symbol_addrs, pd_enable): Update.
+ * arm-tdep.c (skip_prologue_function, 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.
+ * blockframe.c (get_pc_function_start)
+ (find_pc_partial_function_gnu_ifunc): Update.
+ * breakpoint.c (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-valprint.c (c_val_print): Update.
+ * coff-pe-read.c (add_pe_forwarded_sym): Update.
+ * common/agent.c (agent_look_up_symbols): Update.
+ * dbxread.c (find_stab_function_addr, end_psymtab): Update.
+ * dwarf2loc.c (call_site_to_target_addr): Update.
+ * dwarf2read.c (dw2_find_pc_sect_symtab): Update.
+ * elfread.c (elf_gnu_ifunc_record_cache)
+ (elf_gnu_ifunc_resolve_by_got): Update.
+ * findvar.c (default_read_var_value): Update.
+ * frame.c (inside_main_func): Update.
+ * frv-tdep.c (frv_frame_this_id): Update.
+ * glibc-tdep.c (glibc_skip_solib_resolver): Update.
+ * gnu-v3-abi.c (gnuv3_get_typeid, gnuv3_skip_trampoline):
+ Update.
+ * hppa-hpux-tdep.c (hppa64_hpux_search_dummy_call_sequence)
+ (hppa_hpux_find_dummy_bpaddr): Update.
+ * hppa-tdep.c (hppa_symbol_address): Update.
+ * infcmd.c (until_next_command): Update.
+ * jit.c (jit_read_descriptor, jit_breakpoint_re_set_internal):
+ Update.
+ * linespec.c (minsym_found, add_minsym): 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.
+ * maint.c (maintenance_translate_address): Update.
+ * minsyms.c (lookup_minimal_symbol_by_pc_name): Update.
+ (frob_address): New function.
+ (lookup_minimal_symbol_by_pc_section_1): Use raw addresses,
+ frob_address. Rename parameter to "pc_in".
+ (compare_minimal_symbols, compact_minimal_symbols): Use raw
+ addresses.
+ (find_solib_trampoline_target, minimal_symbol_upper_bound):
+ Update.
+ * mips-linux-tdep.c (mips_linux_skip_resolver): Update.
+ * mips-tdep.c (mips_skip_pic_trampoline_code): Update.
+ * objc-lang.c (find_objc_msgsend): Update.
+ * objfiles.c (objfile_relocate1): Update.
+ * obsd-tdep.c (obsd_skip_solib_resolver): Update.
+ * p-valprint.c (pascal_val_print): Update.
+ * parse.c (write_exp_msymbol): Update.
+ * ppc-linux-tdep.c (ppc_linux_spe_context_lookup)
+ (ppc_elfv2_skip_entrypoint): Update.
+ * ppc-sysv-tdep.c (convert_code_addr_to_desc_addr): Update.
+ * printcmd.c (build_address_symbolic, msym_info)
+ (address_info): Update.
+ * proc-service.c (ps_pglobal_lookup): Update.
+ * psymtab.c (find_pc_sect_psymtab_closer)
+ (find_pc_sect_psymtab, find_pc_sect_symtab_from_partial):
+ Change msymbol parameter to bound_minimal_symbol.
+ * ravenscar-thread.c (get_running_thread_id): Update.
+ * remote.c (remote_check_symbols): Update.
+ * sh64-tdep.c (sh64_elf_make_msymbol_special): Use raw
+ address.
+ * sol2-tdep.c (sol2_skip_solib_resolver): Update.
+ * solib-dsbt.c (lm_base): Update.
+ * solib-frv.c (lm_base, main_got): Update.
+ * solib-irix.c (locate_base): Update.
+ * solib-som.c (som_solib_create_inferior_hook)
+ (link_map_start): Update.
+ * solib-spu.c (spu_enable_break, ocl_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, scan_file_globals): Update.
+ * stack.c (find_frame_funname): Update.
+ * symfile-debug.c (debug_qf_expand_symtabs_matching)
+ (debug_qf_find_pc_sect_symtab): Update.
+ * symfile.c (simple_read_overlay_table)
+ (simple_overlay_update): Update.
+ * symfile.h (struct quick_symbol_functions)
+ <find_pc_sect_symtab>: Change type of msymbol to
+ bound_minimal_symbol.
+ * symmisc.c (dump_msymbols): Update.
+ * symtab.c (find_pc_sect_symtab_via_partial)
+ (find_pc_sect_psymtab, find_pc_sect_line, skip_prologue_sal)
+ (search_symbols, print_msymbol_info): Update.
+ * symtab.h (MSYMBOL_VALUE_RAW_ADDRESS): New macro.
+ (MSYMBOL_VALUE_ADDRESS): Redefine.
+ (BMSYMBOL_VALUE_ADDRESS): New macro.
+ * tracepoint.c (scope_info): Update.
+ * tui/tui-disasm.c (tui_find_disassembly_address)
+ (tui_get_begin_asm_address): Update.
+ * valops.c (find_function_in_inferior): Update.
+ * value.c (value_static_field, value_fn_field): Update.
+
+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.
CORE_ADDR main_program_name_addr;
int err_code;
- main_program_name_addr = MSYMBOL_VALUE_ADDRESS (msym.minsym);
+ main_program_name_addr = BMSYMBOL_VALUE_ADDRESS (msym);
if (main_program_name_addr == 0)
error (_("Invalid address for Ada main program name."));
if (msymbol.minsym != NULL)
{
struct ada_exc_info info
- = {standard_exc[i], MSYMBOL_VALUE_ADDRESS (msymbol.minsym)};
+ = {standard_exc[i], BMSYMBOL_VALUE_ADDRESS (msymbol)};
VEC_safe_push (ada_exc_info, *exceptions, &info);
}
if (msym.minsym != NULL)
{
data->known_tasks_kind = ADA_TASKS_ARRAY;
- data->known_tasks_addr = MSYMBOL_VALUE_ADDRESS (msym.minsym);
+ data->known_tasks_addr = BMSYMBOL_VALUE_ADDRESS (msym);
/* Try to get pointer type and array length from the symtab. */
sym = lookup_symbol_in_language (KNOWN_TASKS_NAME, NULL, VAR_DOMAIN,
if (msym.minsym != NULL)
{
data->known_tasks_kind = ADA_TASKS_LIST;
- data->known_tasks_addr = MSYMBOL_VALUE_ADDRESS (msym.minsym);
+ data->known_tasks_addr = BMSYMBOL_VALUE_ADDRESS (msym);
data->known_tasks_length = 1;
sym = lookup_symbol_in_language (KNOWN_TASKS_LIST, NULL, VAR_DOMAIN,
#include "ppc-tdep.h"
#include <string.h>
#include "observer.h"
+#include "objfiles.h"
#include <procinfo.h>
#include <sys/types.h>
fprintf_unfiltered (gdb_stdlog, " returning PDC_FAILURE\n");
return PDC_FAILURE;
}
- symbols[i].addr = MSYMBOL_VALUE_ADDRESS (ms.minsym);
+ symbols[i].addr = BMSYMBOL_VALUE_ADDRESS (ms);
}
if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, " symbols[%d].addr = %s\n",
ms = lookup_minimal_symbol (stub_name, NULL, NULL);
if (ms.minsym == NULL)
return;
- pd_brk_addr = MSYMBOL_VALUE_ADDRESS (ms.minsym);
+ pd_brk_addr = BMSYMBOL_VALUE_ADDRESS (ms);
if (!create_thread_event_breakpoint (target_gdbarch (), pd_brk_addr))
return;
msym = lookup_minimal_symbol_by_pc (pc);
if (msym.minsym != NULL
- && MSYMBOL_VALUE_ADDRESS (msym.minsym) == pc
+ && BMSYMBOL_VALUE_ADDRESS (msym) == pc
&& MSYMBOL_LINKAGE_NAME (msym.minsym) != NULL)
{
const char *name = MSYMBOL_LINKAGE_NAME (msym.minsym);
objfile = (sec == NULL) ? NULL : sec->objfile;
minsym = lookup_minimal_symbol (target_name, NULL, objfile);
if (minsym.minsym != NULL)
- return MSYMBOL_VALUE_ADDRESS (minsym.minsym);
+ return BMSYMBOL_VALUE_ADDRESS (minsym);
else
return 0;
}
#include "gdbcore.h"
#include "observer.h"
#include "filestuff.h"
+#include "objfiles.h"
#include "auxv.h"
#include "elf/common.h"
resides. DATA_ADDRESS is the inferior value present in
`_dl_auxv', therefore the real inferior AUXV address. */
- pointer_address = MSYMBOL_VALUE_ADDRESS (msym.minsym);
+ pointer_address = BMSYMBOL_VALUE_ADDRESS (msym);
/* 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
#include "regcache.h"
#include <string.h>
#include "dis-asm.h"
+#include "objfiles.h"
/* AVR Background:
/* Resolve offset (in words) from __prologue_saves__ symbol.
Which is a pushes count in `-mcall-prologues' mode */
- num_pushes = (AVR_MAX_PUSHES
- - (i - MSYMBOL_VALUE_ADDRESS (msymbol.minsym)) / 2);
+ num_pushes = AVR_MAX_PUSHES - (i - BMSYMBOL_VALUE_ADDRESS (msymbol)) / 2;
if (num_pushes > AVR_MAX_PUSHES)
{
#include "arch-utils.h"
#include "cli/cli-utils.h"
#include "linespec.h"
+#include "objfiles.h"
#include "valprint.h"
#include "c-lang.h"
error (_("Couldn't resolve symbol `%s'."), SYMBOL_PRINT_NAME (var));
/* Push the address of the variable. */
- ax_const_l (ax, MSYMBOL_VALUE_ADDRESS (msym.minsym));
+ ax_const_l (ax, BMSYMBOL_VALUE_ADDRESS (msym));
value->kind = axs_lvalue_memory;
}
break;
msymbol = lookup_minimal_symbol_by_pc (pc);
if (msymbol.minsym)
{
- CORE_ADDR fstart = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
+ CORE_ADDR fstart = BMSYMBOL_VALUE_ADDRESS (msymbol);
if (find_pc_section (fstart))
return fstart;
ALL_OBJFILES (objfile)
{
if (objfile->sf)
- symtab = objfile->sf->qf->find_pc_sect_symtab (objfile, msymbol.minsym,
+ symtab = objfile->sf->qf->find_pc_sect_symtab (objfile, msymbol,
mapped_pc, section, 0);
if (symtab)
break;
if (f != NULL
&& (msymbol.minsym == NULL
|| (BLOCK_START (SYMBOL_BLOCK_VALUE (f))
- >= MSYMBOL_VALUE_ADDRESS (msymbol.minsym))))
+ >= BMSYMBOL_VALUE_ADDRESS (msymbol))))
{
cache_pc_function_low = BLOCK_START (SYMBOL_BLOCK_VALUE (f));
cache_pc_function_high = BLOCK_END (SYMBOL_BLOCK_VALUE (f));
return 0;
}
- cache_pc_function_low = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
+ cache_pc_function_low = BMSYMBOL_VALUE_ADDRESS (msymbol);
cache_pc_function_name = MSYMBOL_LINKAGE_NAME (msymbol.minsym);
cache_pc_function_section = section;
cache_pc_function_is_gnu_ifunc = (MSYMBOL_TYPE (msymbol.minsym)
bp_objfile_data->overlay_msym = m;
}
- addr = MSYMBOL_VALUE_ADDRESS (bp_objfile_data->overlay_msym.minsym);
+ addr = BMSYMBOL_VALUE_ADDRESS (bp_objfile_data->overlay_msym);
b = create_internal_breakpoint (get_objfile_arch (objfile), addr,
bp_overlay_event,
&internal_breakpoint_ops);
bp_objfile_data->longjmp_msym[i] = m;
}
- addr = MSYMBOL_VALUE_ADDRESS (bp_objfile_data->longjmp_msym[i].minsym);
+ addr = BMSYMBOL_VALUE_ADDRESS (bp_objfile_data->longjmp_msym[i]);
b = create_internal_breakpoint (gdbarch, addr, bp_longjmp_master,
&internal_breakpoint_ops);
b->addr_string = xstrdup (func_name);
bp_objfile_data->terminate_msym = m;
}
- addr = MSYMBOL_VALUE_ADDRESS (bp_objfile_data->terminate_msym.minsym);
+ addr = BMSYMBOL_VALUE_ADDRESS (bp_objfile_data->terminate_msym);
b = create_internal_breakpoint (get_objfile_arch (objfile), addr,
bp_std_terminate_master,
&internal_breakpoint_ops);
bp_objfile_data->exception_msym = debug_hook;
}
- addr = MSYMBOL_VALUE_ADDRESS (bp_objfile_data->exception_msym.minsym);
+ addr = BMSYMBOL_VALUE_ADDRESS (bp_objfile_data->exception_msym);
addr = gdbarch_convert_from_func_ptr_addr (gdbarch, addr,
¤t_target);
b = create_internal_breakpoint (gdbarch, addr, bp_exception_master,
sym = lookup_minimal_symbol (name, NULL, objfile);
if (sym.minsym)
- return MSYMBOL_VALUE_ADDRESS (sym.minsym);
+ return BMSYMBOL_VALUE_ADDRESS (sym);
return 0;
}
#include "c-lang.h"
#include "cp-abi.h"
#include "target.h"
+#include "objfiles.h"
\f
/* A helper for c_textual_element_type. This checks the name of the
/* If 'symbol_print' is set, we did the work above. */
if (!options->symbol_print
&& (msymbol.minsym != NULL)
- && (vt_address == MSYMBOL_VALUE_ADDRESS (msymbol.minsym)))
+ && (vt_address == BMSYMBOL_VALUE_ADDRESS (msymbol)))
{
if (want_space)
fputs_filtered (" ", stream);
" \"%s\" in dll \"%s\", pointing to \"%s\"\n"),
sym_name, dll_name, forward_qualified_name);
- vma = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
+ vma = BMSYMBOL_VALUE_ADDRESS (msymbol);
msymtype = MSYMBOL_TYPE (msymbol.minsym);
section = MSYMBOL_SECTION (msymbol.minsym);
#include "defs.h"
#include "target.h"
#include "inferior.h" /* for non_stop */
+#include "objfiles.h"
#endif
#include <string.h>
(struct objfile *) arg);
if (sym.minsym != NULL)
- *addrp = MSYMBOL_VALUE_ADDRESS (sym.minsym);
+ *addrp = BMSYMBOL_VALUE_ADDRESS (sym);
else
#endif
{
msym = lookup_minimal_symbol (p, NULL, objfile);
}
- return msym.minsym == NULL ? 0 : MSYMBOL_VALUE_ADDRESS (msym.minsym);
+ return msym.minsym == NULL ? 0 : BMSYMBOL_VALUE_ADDRESS (msym);
}
static void
}
if (minsym.minsym)
- pst->texthigh = (MSYMBOL_VALUE_ADDRESS (minsym.minsym)
+ pst->texthigh = (BMSYMBOL_VALUE_ADDRESS (minsym)
+ MSYMBOL_SIZE (minsym.minsym));
last_function_name = NULL;
: MSYMBOL_PRINT_NAME (msym.minsym)));
}
- return MSYMBOL_VALUE_ADDRESS (msym.minsym);
+ return BMSYMBOL_VALUE_ADDRESS (msym);
}
case FIELD_LOC_KIND_PHYSADDR:
static struct symtab *
dw2_find_pc_sect_symtab (struct objfile *objfile,
- struct minimal_symbol *msymbol,
+ struct bound_minimal_symbol msymbol,
CORE_ADDR pc,
struct obj_section *section,
int warn_if_readin)
msym = lookup_minimal_symbol_by_pc (addr);
if (msym.minsym == NULL)
return 0;
- if (MSYMBOL_VALUE_ADDRESS (msym.minsym) != addr)
+ if (BMSYMBOL_VALUE_ADDRESS (msym) != addr)
return 0;
/* minimal symbols have always SYMBOL_OBJ_SECTION non-NULL. */
sect = MSYMBOL_OBJ_SECTION (msym.objfile, msym.minsym)->the_bfd_section;
continue;
if (MSYMBOL_TYPE (msym.minsym) != mst_slot_got_plt)
continue;
- pointer_address = MSYMBOL_VALUE_ADDRESS (msym.minsym);
+ pointer_address = BMSYMBOL_VALUE_ADDRESS (msym);
plt = bfd_get_section_by_name (obfd, ".plt");
if (plt == NULL)
if (msym == NULL)
error (_("No global symbol \"%s\"."), SYMBOL_LINKAGE_NAME (var));
if (overlay_debugging)
- addr = symbol_overlayed_address (MSYMBOL_VALUE_ADDRESS (msym),
+ addr = symbol_overlayed_address (BMSYMBOL_VALUE_ADDRESS (lookup_data.result),
MSYMBOL_OBJ_SECTION (lookup_data.result.objfile,
msym));
else
- addr = MSYMBOL_VALUE_ADDRESS (msym);
+ addr = BMSYMBOL_VALUE_ADDRESS (lookup_data.result);
obj_section = MSYMBOL_OBJ_SECTION (lookup_data.result.objfile, msym);
if (obj_section
/* Make certain that the code, and not descriptor, address is
returned. */
maddr = gdbarch_convert_from_func_ptr_addr (get_frame_arch (this_frame),
- MSYMBOL_VALUE_ADDRESS (msymbol.minsym),
+ BMSYMBOL_VALUE_ADDRESS (msymbol),
¤t_target);
return maddr == get_frame_func (this_frame);
}
#include "infcall.h"
#include "solib.h"
#include "frv-tdep.h"
+#include "objfiles.h"
extern void _initialize_frv_tdep (void);
/* Check if the stack is empty. */
msym_stack = lookup_minimal_symbol ("_stack", NULL, NULL);
- if (msym_stack.minsym
- && info->base == MSYMBOL_VALUE_ADDRESS (msym_stack.minsym))
+ if (msym_stack.minsym && info->base == BMSYMBOL_VALUE_ADDRESS (msym_stack))
return;
/* Hopefully the prologue analysis either correctly determined the
if (! fixup.minsym)
fixup = lookup_minimal_symbol ("fixup", NULL, resolver.objfile);
- if (fixup.minsym && MSYMBOL_VALUE_ADDRESS (fixup.minsym) == pc)
+ if (fixup.minsym && BMSYMBOL_VALUE_ADDRESS (fixup) == pc)
return frame_unwind_caller_pc (get_current_frame ());
}
if (minsym.minsym == NULL)
error (_("could not find typeinfo symbol for '%s'"), typename);
- result = value_at_lazy (typeinfo_type,
- MSYMBOL_VALUE_ADDRESS (minsym.minsym));
+ result = value_at_lazy (typeinfo_type, BMSYMBOL_VALUE_ADDRESS (minsym));
}
do_cleanups (cleanup);
if (fn_sym.minsym == NULL)
return 0;
- method_stop_pc = MSYMBOL_VALUE_ADDRESS (fn_sym.minsym);
+ method_stop_pc = BMSYMBOL_VALUE_ADDRESS (fn_sym);
/* Some targets have minimal symbols pointing to function descriptors
(powerpc 64 for example). Make sure to retrieve the address
gdb_byte buf[2 * HPPA_INSN_SIZE];
int offset;
- find_pc_partial_function (MSYMBOL_VALUE_ADDRESS (msym), &name,
+ find_pc_partial_function (MSYMBOL_VALUE_ADDRESS (obj, msym), &name,
&begin, &end);
if (name == NULL || begin == 0 || end == 0)
find_pc_partial_function (addr, NULL, &func, NULL);
ALL_OBJFILE_MSYMBOLS (sec->objfile, msym)
{
- u = find_unwind_entry (MSYMBOL_VALUE_ADDRESS (msym));
- if (func != MSYMBOL_VALUE_ADDRESS (msym)
+ u = find_unwind_entry (MSYMBOL_VALUE_ADDRESS (sec->objfile, msym));
+ if (func != MSYMBOL_VALUE_ADDRESS (sec->objfile, msym)
&& (!u || u->stub_unwind.stub_type == 0))
- return MSYMBOL_VALUE_ADDRESS (msym);
+ return MSYMBOL_VALUE_ADDRESS (sec->objfile, msym);
}
}
minsym = lookup_minimal_symbol (sym, NULL, NULL);
if (minsym.minsym)
- return MSYMBOL_VALUE_ADDRESS (minsym.minsym);
+ return BMSYMBOL_VALUE_ADDRESS (minsym);
else
return (CORE_ADDR)-1;
}
if (msymbol.minsym == NULL)
error (_("Execution is not within a known function."));
- tp->control.step_range_start = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
+ tp->control.step_range_start = BMSYMBOL_VALUE_ADDRESS (msymbol);
tp->control.step_range_end = pc;
}
else
if (jit_debug)
fprintf_unfiltered (gdb_stdlog,
"jit_read_descriptor, descriptor_addr = %s\n",
- paddress (gdbarch, MSYMBOL_VALUE_ADDRESS (objf_data->descriptor)));
+ paddress (gdbarch, MSYMBOL_VALUE_ADDRESS (ps_data->objfile,
+ objf_data->descriptor)));
/* Figure out how big the descriptor is on the remote and how to read it. */
ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
desc_buf = alloca (desc_size);
/* Read the descriptor. */
- err = target_read_memory (MSYMBOL_VALUE_ADDRESS (objf_data->descriptor),
+ err = target_read_memory (MSYMBOL_VALUE_ADDRESS (ps_data->objfile,
+ objf_data->descriptor),
desc_buf, desc_size);
if (err)
{
assume we are not attached to a JIT. */
reg_symbol = lookup_minimal_symbol_and_objfile (jit_break_name);
if (reg_symbol.minsym == NULL
- || MSYMBOL_VALUE_ADDRESS (reg_symbol.minsym) == 0)
+ || BMSYMBOL_VALUE_ADDRESS (reg_symbol) == 0)
return 1;
desc_symbol = lookup_minimal_symbol (jit_descriptor_name, NULL,
reg_symbol.objfile);
if (desc_symbol.minsym == NULL
- || MSYMBOL_VALUE_ADDRESS (desc_symbol.minsym) == 0)
+ || BMSYMBOL_VALUE_ADDRESS (desc_symbol) == 0)
return 1;
objf_data = get_jit_objfile_data (reg_symbol.objfile);
else
objf_data = get_jit_objfile_data (ps_data->objfile);
- addr = MSYMBOL_VALUE_ADDRESS (objf_data->register_code);
+ addr = MSYMBOL_VALUE_ADDRESS (ps_data->objfile, objf_data->register_code);
if (jit_debug)
fprintf_unfiltered (gdb_stdlog,
CORE_ADDR pc;
struct symtab_and_line sal;
- sal = find_pc_sect_line (MSYMBOL_VALUE_ADDRESS (msymbol),
+ sal = find_pc_sect_line (MSYMBOL_VALUE_ADDRESS (objfile, msymbol),
(struct obj_section *) 0, 0);
sal.section = MSYMBOL_OBJ_SECTION (objfile, msymbol);
struct collect_minsyms *info = d;
bound_minimal_symbol_d mo;
+ mo.minsym = minsym;
+ mo.objfile = info->objfile;
+
/* Exclude data symbols when looking for breakpoint locations. */
if (!info->list_mode)
switch (minsym->type)
before we decide to discard it. */
struct gdbarch *gdbarch = get_objfile_arch (info->objfile);
CORE_ADDR addr = gdbarch_convert_from_func_ptr_addr
- (gdbarch, MSYMBOL_VALUE_ADDRESS (minsym),
+ (gdbarch, BMSYMBOL_VALUE_ADDRESS (mo),
¤t_target);
- if (addr == MSYMBOL_VALUE_ADDRESS (minsym))
+ if (addr == BMSYMBOL_VALUE_ADDRESS (mo))
return;
}
}
- mo.minsym = minsym;
- mo.objfile = info->objfile;
VEC_safe_push (bound_minimal_symbol_d, info->msyms, &mo);
}
#include "buffer.h"
#include "target-descriptions.h"
#include "filestuff.h"
+#include "objfiles.h"
#ifndef SPUFS_MAGIC
#define SPUFS_MAGIC 0x23c9b64e
if (ms.minsym == NULL)
return 0;
- if (target_read_memory (MSYMBOL_VALUE_ADDRESS (ms.minsym),
- (gdb_byte *) &signo,
+ if (target_read_memory (BMSYMBOL_VALUE_ADDRESS (ms), (gdb_byte *) &signo,
sizeof (signo)) != 0)
return 0;
if (version_msym.minsym == NULL)
return 0;
- version_addr = MSYMBOL_VALUE_ADDRESS (version_msym.minsym);
+ version_addr = BMSYMBOL_VALUE_ADDRESS (version_msym);
got = target_read_string (version_addr, &version, 32, &err);
if (err == 0 && memchr (version, 0, got) == &version[got -1])
{
#include "reggroups.h"
#include "prologue-value.h"
#include "target.h"
+#include "objfiles.h"
\f
/* The m32c tdep structure. */
error (_("The return value is stored in memory at 'mem0', "
"but GDB cannot find\n"
"its address."));
- read_memory (MSYMBOL_VALUE_ADDRESS (mem0.minsym), readbuf,
- valtype_len);
+ read_memory (BMSYMBOL_VALUE_ADDRESS (mem0), readbuf, valtype_len);
}
}
error (_("The return value is stored in memory at 'mem0', "
"but GDB cannot find\n"
" its address."));
- write_memory (MSYMBOL_VALUE_ADDRESS (mem0.minsym), writebuf,
- valtype_len);
+ write_memory (BMSYMBOL_VALUE_ADDRESS (mem0), writebuf, valtype_len);
}
}
else
{
/* The trampoline's address is our pointer. */
- addr = MSYMBOL_VALUE_ADDRESS (tramp_msym.minsym);
+ addr = BMSYMBOL_VALUE_ADDRESS (tramp_msym);
}
}
/* If we do have such a symbol, return its value as the
function's true address. */
if (func_msym.minsym)
- ptr = MSYMBOL_VALUE_ADDRESS (func_msym.minsym);
+ ptr = BMSYMBOL_VALUE_ADDRESS (func_msym);
}
}
else
#include "regcache.h"
#include "trad-frame.h"
#include "dis-asm.h"
+#include "objfiles.h"
#include "gdb_assert.h"
/* Check if the stack is empty. */
msym_stack = lookup_minimal_symbol ("_stack", NULL, NULL);
- if (msym_stack.minsym
- && info->base == MSYMBOL_VALUE_ADDRESS (msym_stack.minsym))
+ if (msym_stack.minsym && info->base == BMSYMBOL_VALUE_ADDRESS (msym_stack))
return;
/* Hopefully the prologue analysis either correctly determined the
msymbol = lookup_minimal_symbol (name, NULL, NULL);
if (msymbol.minsym)
{
- reg->addr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
+ reg->addr = BMSYMBOL_VALUE_ADDRESS (msymbol);
reg->name = xstrdup (name);
/* Keep track of the address range for soft registers. */
return 0;
}
else
- return MSYMBOL_VALUE_ADDRESS (msym.minsym);
+ return BMSYMBOL_VALUE_ADDRESS (msym);
}
/* Add oso file OSO/ABFD as a symbol file. */
{
const char *symbol_name = MSYMBOL_PRINT_NAME (sym.minsym);
const char *symbol_offset
- = pulongest (address - MSYMBOL_VALUE_ADDRESS (sym.minsym));
+ = pulongest (address - BMSYMBOL_VALUE_ADDRESS (sym));
sect = MSYMBOL_OBJ_SECTION(sym.objfile, sym.minsym);
if (sect != NULL)
msymbol != NULL;
msymbol = msymbol->hash_next)
{
- if (MSYMBOL_VALUE_ADDRESS (msymbol) == pc
+ if (MSYMBOL_VALUE_ADDRESS (objfile, msymbol) == pc
&& strcmp (MSYMBOL_LINKAGE_NAME (msymbol), name) == 0)
return msymbol;
}
return found_symbol;
}
+/* A helper function that makes *PC section-relative. This searches
+ the sections of OBJFILE and if *PC is in a section, it subtracts
+ the section offset and returns true. Otherwise it returns
+ false. */
+
+static int
+frob_address (struct objfile *objfile, CORE_ADDR *pc)
+{
+ struct obj_section *iter;
+
+ ALL_OBJFILE_OSECTIONS (objfile, iter)
+ {
+ if (*pc >= obj_section_addr (iter) && *pc < obj_section_endaddr (iter))
+ {
+ *pc -= obj_section_offset (iter);
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
/* Search through the minimal symbol table for each objfile and find
the symbol whose address is the largest address that is still less
than or equal to PC, and matches SECTION (which is not NULL).
Otherwise prefer mst_text symbols. */
static struct bound_minimal_symbol
-lookup_minimal_symbol_by_pc_section_1 (CORE_ADDR pc,
+lookup_minimal_symbol_by_pc_section_1 (CORE_ADDR pc_in,
struct obj_section *section,
int want_trampoline)
{
objfile != NULL;
objfile = objfile_separate_debug_iterate (section->objfile, objfile))
{
+ CORE_ADDR pc = pc_in;
+
/* If this objfile has a minimal symbol table, go search it using
a binary search. Note that a minimal symbol table always consists
of at least two symbols, a "real" symbol and the terminating
Warning: this code is trickier than it would appear at first. */
- /* Should also require that pc is <= end of objfile. FIXME! */
- if (pc >= MSYMBOL_VALUE_ADDRESS (&msymbol[lo]))
+ if (frob_address (objfile, &pc)
+ && pc >= MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[lo]))
{
- while (MSYMBOL_VALUE_ADDRESS (&msymbol[hi]) > pc)
+ while (MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi]) > pc)
{
/* pc is still strictly less than highest address. */
/* Note "new" will always be >= lo. */
new = (lo + hi) / 2;
- if ((MSYMBOL_VALUE_ADDRESS (&msymbol[new]) >= pc) ||
- (lo == new))
+ if ((MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[new]) >= pc)
+ || (lo == new))
{
hi = new;
}
hi to point to the last one. That way we can find the
right symbol if it has an index greater than hi. */
while (hi < objfile->minimal_symbol_count - 1
- && (MSYMBOL_VALUE_ADDRESS (&msymbol[hi])
- == MSYMBOL_VALUE_ADDRESS (&msymbol[hi + 1])))
+ && (MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi])
+ == MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi + 1])))
hi++;
/* Skip various undesirable symbols. */
&& MSYMBOL_TYPE (&msymbol[hi - 1]) == want_type
&& (MSYMBOL_SIZE (&msymbol[hi])
== MSYMBOL_SIZE (&msymbol[hi - 1]))
- && (MSYMBOL_VALUE_ADDRESS (&msymbol[hi])
- == MSYMBOL_VALUE_ADDRESS (&msymbol[hi - 1]))
+ && (MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi])
+ == MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi - 1]))
&& (MSYMBOL_OBJ_SECTION (objfile, &msymbol[hi])
== MSYMBOL_OBJ_SECTION (objfile, &msymbol[hi - 1])))
{
the cancellable variants, but both have sizes. */
if (hi > 0
&& MSYMBOL_SIZE (&msymbol[hi]) != 0
- && pc >= (MSYMBOL_VALUE_ADDRESS (&msymbol[hi])
+ && pc >= (MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi])
+ MSYMBOL_SIZE (&msymbol[hi]))
- && pc < (MSYMBOL_VALUE_ADDRESS (&msymbol[hi - 1])
+ && pc < (MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi - 1])
+ MSYMBOL_SIZE (&msymbol[hi - 1])))
{
hi--;
if (hi >= 0
&& MSYMBOL_SIZE (&msymbol[hi]) != 0
- && pc >= (MSYMBOL_VALUE_ADDRESS (&msymbol[hi])
+ && pc >= (MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi])
+ MSYMBOL_SIZE (&msymbol[hi])))
{
if (best_zero_sized != -1)
if (hi >= 0
&& ((best_symbol == NULL) ||
- (MSYMBOL_VALUE_ADDRESS (best_symbol) <
- MSYMBOL_VALUE_ADDRESS (&msymbol[hi]))))
+ (MSYMBOL_VALUE_RAW_ADDRESS (best_symbol) <
+ MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[hi]))))
{
best_symbol = &msymbol[hi];
best_objfile = objfile;
fn1 = (const struct minimal_symbol *) fn1p;
fn2 = (const struct minimal_symbol *) fn2p;
- if (MSYMBOL_VALUE_ADDRESS (fn1) < MSYMBOL_VALUE_ADDRESS (fn2))
+ if (MSYMBOL_VALUE_RAW_ADDRESS (fn1) < MSYMBOL_VALUE_RAW_ADDRESS (fn2))
{
return (-1); /* addr 1 is less than addr 2. */
}
- else if (MSYMBOL_VALUE_ADDRESS (fn1) > MSYMBOL_VALUE_ADDRESS (fn2))
+ else if (MSYMBOL_VALUE_RAW_ADDRESS (fn1) > MSYMBOL_VALUE_RAW_ADDRESS (fn2))
{
return (1); /* addr 1 is greater than addr 2. */
}
copyfrom = copyto = msymbol;
while (copyfrom < msymbol + mcount - 1)
{
- if (MSYMBOL_VALUE_ADDRESS (copyfrom)
- == MSYMBOL_VALUE_ADDRESS ((copyfrom + 1))
+ if (MSYMBOL_VALUE_RAW_ADDRESS (copyfrom)
+ == MSYMBOL_VALUE_RAW_ADDRESS ((copyfrom + 1))
+ && MSYMBOL_SECTION (copyfrom) == MSYMBOL_SECTION (copyfrom + 1)
&& strcmp (MSYMBOL_LINKAGE_NAME (copyfrom),
MSYMBOL_LINKAGE_NAME ((copyfrom + 1))) == 0)
{
|| MSYMBOL_TYPE (msymbol) == mst_text_gnu_ifunc)
&& strcmp (MSYMBOL_LINKAGE_NAME (msymbol),
MSYMBOL_LINKAGE_NAME (tsymbol)) == 0)
- return MSYMBOL_VALUE_ADDRESS (msymbol);
+ return MSYMBOL_VALUE_ADDRESS (objfile, msymbol);
/* Also handle minimal symbols pointing to function descriptors. */
if (MSYMBOL_TYPE (msymbol) == mst_data
func = gdbarch_convert_from_func_ptr_addr
(get_objfile_arch (objfile),
- MSYMBOL_VALUE_ADDRESS (msymbol),
+ MSYMBOL_VALUE_ADDRESS (objfile, msymbol),
¤t_target);
/* Ignore data symbols that are not function descriptors. */
- if (func != MSYMBOL_VALUE_ADDRESS (msymbol))
+ if (func != MSYMBOL_VALUE_ADDRESS (objfile, msymbol))
return func;
}
}
of the section, as the end of the function. */
if (MSYMBOL_SIZE (minsym.minsym) != 0)
- return MSYMBOL_VALUE_ADDRESS (minsym.minsym) + MSYMBOL_SIZE (minsym.minsym);
+ return BMSYMBOL_VALUE_ADDRESS (minsym) + MSYMBOL_SIZE (minsym.minsym);
/* Step over other symbols at this same address, and symbols in
other sections, to find the next symbol in this section with a
section = MSYMBOL_SECTION (msymbol);
for (i = 1; MSYMBOL_LINKAGE_NAME (msymbol + i) != NULL; i++)
{
- if (MSYMBOL_VALUE_ADDRESS (msymbol + i) != MSYMBOL_VALUE_ADDRESS (msymbol)
+ if ((MSYMBOL_VALUE_RAW_ADDRESS (msymbol + i)
+ != MSYMBOL_VALUE_RAW_ADDRESS (msymbol))
&& MSYMBOL_SECTION (msymbol + i) == section)
break;
}
obj_section = MSYMBOL_OBJ_SECTION (minsym.objfile, minsym.minsym);
if (MSYMBOL_LINKAGE_NAME (msymbol + i) != NULL
- && (MSYMBOL_VALUE_ADDRESS (msymbol + i)
+ && (MSYMBOL_VALUE_ADDRESS (minsym.objfile, msymbol + i)
< obj_section_endaddr (obj_section)))
- result = MSYMBOL_VALUE_ADDRESS (msymbol + i);
+ result = MSYMBOL_VALUE_ADDRESS (minsym.objfile, msymbol + i);
else
/* We got the start address from the last msymbol in the objfile.
So the end address is the end of the section. */
resolver = lookup_minimal_symbol ("__dl_runtime_resolve", NULL, NULL);
- if (resolver.minsym && MSYMBOL_VALUE_ADDRESS (resolver.minsym) == pc)
+ if (resolver.minsym && BMSYMBOL_VALUE_ADDRESS (resolver) == pc)
return frame_unwind_caller_pc (get_current_frame ());
return glibc_skip_solib_resolver (gdbarch, pc);
which jumps to foo. */
msym = lookup_minimal_symbol_by_pc (pc);
if (msym.minsym == NULL
- || MSYMBOL_VALUE_ADDRESS (msym.minsym) != pc
+ || BMSYMBOL_VALUE_ADDRESS (msym) != pc
|| MSYMBOL_LINKAGE_NAME (msym.minsym) == NULL
|| strncmp (MSYMBOL_LINKAGE_NAME (msym.minsym), ".pic.", 5) != 0)
return 0;
continue;
}
- methcalls[i].begin = MSYMBOL_VALUE_ADDRESS (func.minsym);
+ methcalls[i].begin = BMSYMBOL_VALUE_ADDRESS (func);
methcalls[i].end = minimal_symbol_upper_bound (func);
}
}
ALL_OBJFILE_MSYMBOLS (objfile, msym)
if (MSYMBOL_SECTION (msym) >= 0)
- SET_MSYMBOL_VALUE_ADDRESS (msym, (MSYMBOL_VALUE_ADDRESS (msym)
+ SET_MSYMBOL_VALUE_ADDRESS (msym, (MSYMBOL_VALUE_ADDRESS (objfile, msym)
+ ANOFFSET (delta,
MSYMBOL_SECTION (msym))));
}
#include "defs.h"
#include "frame.h"
#include "symtab.h"
+#include "objfiles.h"
#include "obsd-tdep.h"
struct bound_minimal_symbol msym;
msym = lookup_minimal_symbol("_dl_bind", NULL, NULL);
- if (msym.minsym && MSYMBOL_VALUE_ADDRESS (msym.minsym) == pc)
+ if (msym.minsym && BMSYMBOL_VALUE_ADDRESS (msym) == pc)
return frame_unwind_caller_pc (get_current_frame ());
else
return find_solib_trampoline_target (get_current_frame (), pc);
#include "cp-abi.h"
#include "cp-support.h"
#include "exceptions.h"
+#include "objfiles.h"
\f
/* Decorations for Pascal. */
/* If 'symbol_print' is set, we did the work above. */
if (!options->symbol_print
&& (msymbol.minsym != NULL)
- && (vt_address == MSYMBOL_VALUE_ADDRESS (msymbol.minsym)))
+ && (vt_address == BMSYMBOL_VALUE_ADDRESS (msymbol)))
{
if (want_space)
fputs_filtered (" ", stream);
struct objfile *objfile = bound_msym.objfile;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
- CORE_ADDR addr = MSYMBOL_VALUE_ADDRESS (msymbol);
+ CORE_ADDR addr = BMSYMBOL_VALUE_ADDRESS (bound_msym);
struct obj_section *section = MSYMBOL_OBJ_SECTION (objfile, msymbol);
enum minimal_symbol_type type = MSYMBOL_TYPE (msymbol);
CORE_ADDR pc;
if (ifunc_msym.minsym != NULL
&& MSYMBOL_TYPE (ifunc_msym.minsym) == mst_text_gnu_ifunc
- && MSYMBOL_VALUE_ADDRESS (ifunc_msym.minsym) == pc)
+ && BMSYMBOL_VALUE_ADDRESS (ifunc_msym) == pc)
{
/* A function descriptor has been resolved but PC is still in the
STT_GNU_IFUNC resolver body (such as because inferior does not
if (MSYMBOL_TARGET_FLAG_1 (fun.minsym))
local_entry_offset = 8;
- if (MSYMBOL_VALUE_ADDRESS (fun.minsym) <= pc
- && pc < MSYMBOL_VALUE_ADDRESS (fun.minsym) + local_entry_offset)
- return MSYMBOL_VALUE_ADDRESS (fun.minsym) + local_entry_offset;
+ if (BMSYMBOL_VALUE_ADDRESS (fun) <= pc
+ && pc < BMSYMBOL_VALUE_ADDRESS (fun) + local_entry_offset)
+ return BMSYMBOL_VALUE_ADDRESS (fun) + local_entry_offset;
return pc;
}
{
spe_context_objfile = objfile;
spe_context_lm_addr = svr4_fetch_objfile_link_map (objfile);
- spe_context_offset = MSYMBOL_VALUE_ADDRESS (sym.minsym);
+ spe_context_offset = BMSYMBOL_VALUE_ADDRESS (sym);
spe_context_cache_ptid = minus_one_ptid;
spe_context_cache_address = 0;
return;
if (fn.minsym == NULL)
return 0;
/* Found a descriptor. */
- (*desc_addr) = MSYMBOL_VALUE_ADDRESS (fn.minsym);
+ (*desc_addr) = BMSYMBOL_VALUE_ADDRESS (fn);
return 1;
}
int *line, /* OUT */
int *unmapped) /* OUT */
{
- struct minimal_symbol *msymbol;
+ struct bound_minimal_symbol msymbol;
struct symbol *symbol;
CORE_ADDR name_location = 0;
struct obj_section *section = NULL;
save some memory, but for many debug format--ELF/DWARF or
anything/stabs--it would be inconvenient to eliminate those minimal
symbols anyway). */
- msymbol = lookup_minimal_symbol_by_pc_section (addr, section).minsym;
+ msymbol = lookup_minimal_symbol_by_pc_section (addr, section);
symbol = find_pc_sect_function (addr, section);
if (symbol)
name_temp = SYMBOL_LINKAGE_NAME (symbol);
}
- if (msymbol != NULL
- && MSYMBOL_HAS_SIZE (msymbol)
- && MSYMBOL_SIZE (msymbol) == 0
- && MSYMBOL_TYPE (msymbol) != mst_text
- && MSYMBOL_TYPE (msymbol) != mst_text_gnu_ifunc
- && MSYMBOL_TYPE (msymbol) != mst_file_text)
- msymbol = NULL;
+ if (msymbol.minsym != NULL
+ && MSYMBOL_HAS_SIZE (msymbol.minsym)
+ && MSYMBOL_SIZE (msymbol.minsym) == 0
+ && MSYMBOL_TYPE (msymbol.minsym) != mst_text
+ && MSYMBOL_TYPE (msymbol.minsym) != mst_text_gnu_ifunc
+ && MSYMBOL_TYPE (msymbol.minsym) != mst_file_text)
+ msymbol.minsym = NULL;
- if (msymbol != NULL)
+ if (msymbol.minsym != NULL)
{
- if (MSYMBOL_VALUE_ADDRESS (msymbol) > name_location || symbol == NULL)
+ if (BMSYMBOL_VALUE_ADDRESS (msymbol) > name_location || symbol == NULL)
{
/* If this is a function (i.e. a code address), strip out any
non-address bits. For instance, display a pointer to the
first instruction of a Thumb function as <function>; the
second instruction will be <function+2>, even though the
pointer is <function+3>. This matches the ISA behavior. */
- if (MSYMBOL_TYPE (msymbol) == mst_text
- || MSYMBOL_TYPE (msymbol) == mst_text_gnu_ifunc
- || MSYMBOL_TYPE (msymbol) == mst_file_text
- || MSYMBOL_TYPE (msymbol) == mst_solib_trampoline)
+ if (MSYMBOL_TYPE (msymbol.minsym) == mst_text
+ || MSYMBOL_TYPE (msymbol.minsym) == mst_text_gnu_ifunc
+ || MSYMBOL_TYPE (msymbol.minsym) == mst_file_text
+ || MSYMBOL_TYPE (msymbol.minsym) == mst_solib_trampoline)
addr = gdbarch_addr_bits_remove (gdbarch, addr);
/* The msymbol is closer to the address than the symbol;
use the msymbol instead. */
symbol = 0;
- name_location = MSYMBOL_VALUE_ADDRESS (msymbol);
+ name_location = BMSYMBOL_VALUE_ADDRESS (msymbol);
if (do_demangle || asm_demangle)
- name_temp = MSYMBOL_PRINT_NAME (msymbol);
+ name_temp = MSYMBOL_PRINT_NAME (msymbol.minsym);
else
- name_temp = MSYMBOL_LINKAGE_NAME (msymbol);
+ name_temp = MSYMBOL_LINKAGE_NAME (msymbol.minsym);
}
}
- if (symbol == NULL && msymbol == NULL)
+ if (symbol == NULL && msymbol.minsym == NULL)
return 1;
/* If the nearest symbol is too far away, don't print anything symbolic. */
struct cleanup *old_chain;
matches = 1;
- offset = sect_addr - MSYMBOL_VALUE_ADDRESS (msymbol);
+ offset = sect_addr - MSYMBOL_VALUE_ADDRESS (objfile, msymbol);
mapped = section_is_mapped (osect) ? _("mapped") : _("unmapped");
sec_name = osect->the_bfd_section->name;
msym_name = MSYMBOL_PRINT_NAME (msymbol);
struct objfile *objfile = msymbol.objfile;
gdbarch = get_objfile_arch (objfile);
- load_addr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
+ load_addr = BMSYMBOL_VALUE_ADDRESS (msymbol);
printf_filtered ("Symbol \"");
fprintf_symbol_filtered (gdb_stdout, exp,
else
{
section = MSYMBOL_OBJ_SECTION (msym.objfile, msym.minsym);
- load_addr = MSYMBOL_VALUE_ADDRESS (msym.minsym);
+ load_addr = BMSYMBOL_VALUE_ADDRESS (msym);
if (section
&& (section->the_bfd_section->flags & SEC_THREAD_LOCAL) != 0)
#include "symtab.h"
#include "target.h"
#include "regcache.h"
+#include "objfiles.h"
#include "gdb_proc_service.h"
result = PS_NOSYM;
else
{
- *sym_addr = core_addr_to_ps_addr (MSYMBOL_VALUE_ADDRESS (ms.minsym));
+ *sym_addr = core_addr_to_ps_addr (BMSYMBOL_VALUE_ADDRESS (ms));
result = PS_OK;
}
find_pc_sect_psymtab_closer (struct objfile *objfile,
CORE_ADDR pc, struct obj_section *section,
struct partial_symtab *pst,
- struct minimal_symbol *msymbol)
+ struct bound_minimal_symbol msymbol)
{
struct partial_symtab *tpst;
struct partial_symtab *best_pst = pst;
section == 0) /* Can't validate section this way. */
return pst;
- if (msymbol == NULL)
+ if (msymbol.minsym == NULL)
return (pst);
/* The code range of partial symtabs sometimes overlap, so, in
p = find_pc_sect_psymbol (objfile, tpst, pc, section);
if (p != NULL
&& SYMBOL_VALUE_ADDRESS (p)
- == MSYMBOL_VALUE_ADDRESS (msymbol))
+ == BMSYMBOL_VALUE_ADDRESS (msymbol))
return tpst;
/* Also accept the textlow value of a psymtab as a
static struct partial_symtab *
find_pc_sect_psymtab (struct objfile *objfile, CORE_ADDR pc,
struct obj_section *section,
- struct minimal_symbol *msymbol)
+ struct bound_minimal_symbol msymbol)
{
struct partial_symtab *pst;
/* FIXME: addrmaps currently do not handle overlayed sections,
so fall back to the non-addrmap case if we're debugging
overlays and the addrmap returned the wrong section. */
- if (overlay_debugging && msymbol && section)
+ if (overlay_debugging && msymbol.minsym && section)
{
struct partial_symbol *p;
p = find_pc_sect_psymbol (objfile, pst, pc, section);
if (!p
|| SYMBOL_VALUE_ADDRESS (p)
- != MSYMBOL_VALUE_ADDRESS (msymbol))
+ != BMSYMBOL_VALUE_ADDRESS (msymbol))
goto next;
}
static struct symtab *
find_pc_sect_symtab_from_partial (struct objfile *objfile,
- struct minimal_symbol *msymbol,
+ struct bound_minimal_symbol msymbol,
CORE_ADDR pc, struct obj_section *section,
int warn_if_readin)
{
#include "gdbcmd.h"
#include "top.h"
#include "regcache.h"
+#include "objfiles.h"
/* If non-null, ravenscar task support is enabled. */
static int ravenscar_task_support = 1;
if (!object_msym.minsym)
return 0;
- object_addr = MSYMBOL_VALUE_ADDRESS (object_msym.minsym);
+ object_addr = BMSYMBOL_VALUE_ADDRESS (object_msym);
object_size = TYPE_LENGTH (builtin_type_void_data_ptr);
buf_size = object_size;
buf = alloca (buf_size);
while (strncmp (reply, "qSymbol:", 8) == 0)
{
+ struct bound_minimal_symbol sym;
+
tmp = &reply[8];
end = hex2bin (tmp, (gdb_byte *) msg, strlen (tmp) / 2);
msg[end] = '\0';
else
{
int addr_size = gdbarch_addr_bit (target_gdbarch ()) / 8;
- CORE_ADDR sym_addr = MSYMBOL_VALUE_ADDRESS (sym.minsym);
+ CORE_ADDR sym_addr = BMSYMBOL_VALUE_ADDRESS (sym);
/* If this is a function address, return the start of code
instead of any data function descriptor. */
if (((elf_symbol_type *)(sym))->internal_elf_sym.st_other == STO_SH5_ISA32)
{
MSYMBOL_TARGET_FLAG_1 (msym) = 1;
- SET_MSYMBOL_VALUE_ADDRESS (msym, MSYMBOL_VALUE_ADDRESS (msym) | 1);
+ SET_MSYMBOL_VALUE_ADDRESS (msym, MSYMBOL_VALUE_RAW_ADDRESS (msym) | 1);
}
}
#include "frame.h"
#include "symtab.h"
#include "inferior.h"
+#include "objfiles.h"
#include "sol2-tdep.h"
struct bound_minimal_symbol msym;
msym = lookup_minimal_symbol("elf_bndr", NULL, NULL);
- if (msym.minsym && MSYMBOL_VALUE_ADDRESS (msym.minsym) == pc)
+ if (msym.minsym && BMSYMBOL_VALUE_ADDRESS (msym) == pc)
return frame_unwind_caller_pc (get_current_frame ());
return 0;
if (got_sym.minsym != 0)
{
- addr = MSYMBOL_VALUE_ADDRESS (got_sym.minsym);
+ addr = BMSYMBOL_VALUE_ADDRESS (got_sym);
if (solib_dsbt_debug)
fprintf_unfiltered (gdb_stdlog,
"lm_base: get addr %x by _GLOBAL_OFFSET_TABLE_.\n",
return 0;
}
- addr = MSYMBOL_VALUE_ADDRESS (got_sym.minsym) + 8;
+ addr = BMSYMBOL_VALUE_ADDRESS (got_sym) + 8;
if (solib_frv_debug)
fprintf_unfiltered (gdb_stdlog,
if (got_sym.minsym == 0)
return 0;
- return MSYMBOL_VALUE_ADDRESS (got_sym.minsym);
+ return BMSYMBOL_VALUE_ADDRESS (got_sym);
}
/* Find the global pointer for the given function address ADDR. */
CORE_ADDR address = 0;
msymbol = lookup_minimal_symbol (DEBUG_BASE, NULL, symfile_objfile);
- if ((msymbol.minsym != NULL) && (MSYMBOL_VALUE_ADDRESS (msymbol.minsym) != 0))
+ if ((msymbol.minsym != NULL) && (BMSYMBOL_VALUE_ADDRESS (msymbol) != 0))
{
- address = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
+ address = BMSYMBOL_VALUE_ADDRESS (msymbol);
}
return (address);
}
if (msymbol.minsym == NULL)
goto keep_going;
- anaddr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
+ anaddr = BMSYMBOL_VALUE_ADDRESS (msymbol);
store_unsigned_integer (buf, 4, byte_order, ptid_get_pid (inferior_ptid));
status = target_write_memory (anaddr, buf, 4);
if (status != 0)
GDB will be unable to track shl_load/shl_unload calls"));
goto keep_going;
}
- anaddr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
+ anaddr = BMSYMBOL_VALUE_ADDRESS (msymbol);
dld_cache.hook.address = anaddr;
/* Grrr, this might not be an export symbol! We have to find the
GDB will be unable to track shl_load/shl_unload calls"));
goto keep_going;
}
- anaddr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
+ anaddr = BMSYMBOL_VALUE_ADDRESS (msymbol);
status = target_write_memory (anaddr, buf, 4);
/* Now set a shlib_event breakpoint at __d_trap so we can track
goto keep_going;
}
create_solib_event_breakpoint (target_gdbarch (),
- MSYMBOL_VALUE_ADDRESS (msymbol.minsym));
+ BMSYMBOL_VALUE_ADDRESS (msymbol));
/* We have all the support usually found in end.o, so we can track
shl_load and shl_unload calls. */
error (_("Unable to find __dld_flags symbol in object file."));
}
- anaddr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
+ anaddr = BMSYMBOL_VALUE_ADDRESS (msymbol);
/* Read the current contents. */
status = target_read_memory (anaddr, buf, 4);
if (msymbol.minsym == NULL)
error (_("Unable to find _start symbol in object file."));
- anaddr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
+ anaddr = BMSYMBOL_VALUE_ADDRESS (msymbol);
/* Make the breakpoint at "_start" a shared library event breakpoint. */
create_solib_event_breakpoint (target_gdbarch (), anaddr);
sym = lookup_minimal_symbol ("__dld_flags", NULL, NULL);
if (!sym.minsym)
error (_("Unable to find __dld_flags symbol in object file."));
- addr = MSYMBOL_VALUE_ADDRESS (sym.minsym);
+ addr = BMSYMBOL_VALUE_ADDRESS (sym);
read_memory (addr, buf, 4);
dld_flags = extract_unsigned_integer (buf, 4, byte_order);
if ((dld_flags & DLD_FLAGS_LISTVALID) == 0)
error (_("Unable to find dynamic library list."));
return 0;
}
- addr = MSYMBOL_VALUE_ADDRESS (sym.minsym) - 8;
+ addr = BMSYMBOL_VALUE_ADDRESS (sym) - 8;
}
else
- addr = MSYMBOL_VALUE_ADDRESS (sym.minsym);
+ addr = BMSYMBOL_VALUE_ADDRESS (sym);
read_memory (addr, buf, 4);
addr = extract_unsigned_integer (buf, 4, byte_order);
/* Place a solib_event breakpoint on the symbol. */
if (spe_event_sym.minsym)
{
- CORE_ADDR addr = MSYMBOL_VALUE_ADDRESS (spe_event_sym.minsym);
+ CORE_ADDR addr = BMSYMBOL_VALUE_ADDRESS (spe_event_sym);
addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (), addr,
¤t_target);
if (event_sym.minsym && addr_sym.minsym)
{
/* Place a solib_event breakpoint on the symbol. */
- CORE_ADDR event_addr = MSYMBOL_VALUE_ADDRESS (event_sym.minsym);
+ CORE_ADDR event_addr = BMSYMBOL_VALUE_ADDRESS (event_sym);
create_solib_event_breakpoint (get_objfile_arch (objfile), event_addr);
/* Store the address of the symbol that will point to OpenCL program
&objfile->objfile_obstack,
objfile->sections_end - objfile->sections,
CORE_ADDR);
- *ocl_program_addr_base = MSYMBOL_VALUE_ADDRESS (addr_sym.minsym);
+ *ocl_program_addr_base = BMSYMBOL_VALUE_ADDRESS (addr_sym);
set_objfile_data (objfile, ocl_program_data_key,
ocl_program_addr_base);
}
conventionally named _r_debug, as a last resort. */
msymbol = lookup_minimal_symbol ("_r_debug", NULL, symfile_objfile);
if (msymbol.minsym != NULL)
- return MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
+ return BMSYMBOL_VALUE_ADDRESS (msymbol);
/* DT_DEBUG entry not found. */
return 0;
{
msymbol = lookup_minimal_symbol (*bkpt_namep, NULL, symfile_objfile);
if ((msymbol.minsym != NULL)
- && (MSYMBOL_VALUE_ADDRESS (msymbol.minsym) != 0))
+ && (BMSYMBOL_VALUE_ADDRESS (msymbol) != 0))
{
- sym_addr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
+ sym_addr = BMSYMBOL_VALUE_ADDRESS (msymbol);
sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (),
sym_addr,
¤t_target);
{
msymbol = lookup_minimal_symbol (*bkpt_namep, NULL, symfile_objfile);
if ((msymbol.minsym != NULL)
- && (MSYMBOL_VALUE_ADDRESS (msymbol.minsym) != 0))
+ && (BMSYMBOL_VALUE_ADDRESS (msymbol) != 0))
{
- sym_addr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
+ sym_addr = BMSYMBOL_VALUE_ADDRESS (msymbol);
sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (),
sym_addr,
¤t_target);
if (!ovly_buf_table_msym.minsym)
return NULL;
- ovly_table_base = MSYMBOL_VALUE_ADDRESS (ovly_table_msym.minsym);
+ ovly_table_base = BMSYMBOL_VALUE_ADDRESS (ovly_table_msym);
ovly_table_size = MSYMBOL_SIZE (ovly_table_msym.minsym);
- ovly_buf_table_base = MSYMBOL_VALUE_ADDRESS (ovly_buf_table_msym.minsym);
+ ovly_buf_table_base = BMSYMBOL_VALUE_ADDRESS (ovly_buf_table_msym);
ovly_buf_table_size = MSYMBOL_SIZE (ovly_buf_table_msym.minsym);
ovly_table = xmalloc (ovly_table_size);
/* If we have debugging information, try to use it -- this
will allow us to properly skip the prologue. */
- pc = MSYMBOL_VALUE_ADDRESS (minsym.minsym);
+ pc = BMSYMBOL_VALUE_ADDRESS (minsym);
symtab = find_pc_sect_symtab (pc, MSYMBOL_OBJ_SECTION (minsym.objfile,
minsym.minsym));
if (symtab != NULL)
type = objfile_type (obj)->builtin_void;
type = lookup_function_type (type);
type = lookup_pointer_type (type);
- addr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
+ addr = BMSYMBOL_VALUE_ADDRESS (msymbol);
call_function_by_hand (value_from_pointer (type, addr), 0, NULL);
}
(gdbarch, SYMBOL_LINKAGE_NAME (sym));
SYMBOL_SET_LINKAGE_NAME (sym, new_name);
- SYMBOL_VALUE_ADDRESS (sym) = MSYMBOL_VALUE_ADDRESS (msym.minsym);
+ SYMBOL_VALUE_ADDRESS (sym) = BMSYMBOL_VALUE_ADDRESS (msym);
}
}
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
(gdbarch, SYMBOL_LINKAGE_NAME (sym));
SYMBOL_SET_LINKAGE_NAME (sym, new_name);
- SYMBOL_VALUE_ADDRESS (sym) = MSYMBOL_VALUE_ADDRESS (msym.minsym);
+ SYMBOL_VALUE_ADDRESS (sym) = BMSYMBOL_VALUE_ADDRESS (msym);
}
}
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
if (SYMBOL_CLASS (sym) == LOC_BLOCK)
{
fix_common_block (sym,
- MSYMBOL_VALUE_ADDRESS (msymbol));
+ MSYMBOL_VALUE_ADDRESS (resolve_objfile,
+ msymbol));
}
else
{
SYMBOL_VALUE_ADDRESS (sym)
- = MSYMBOL_VALUE_ADDRESS (msymbol);
+ = MSYMBOL_VALUE_ADDRESS (resolve_objfile, msymbol);
}
SYMBOL_SECTION (sym) = MSYMBOL_SECTION (msymbol);
}
#include "inline-frame.h"
#include "linespec.h"
#include "cli/cli-utils.h"
+#include "objfiles.h"
#include "gdb_assert.h"
#include <ctype.h>
memset (&msymbol, 0, sizeof (msymbol));
if (msymbol.minsym != NULL
- && (MSYMBOL_VALUE_ADDRESS (msymbol.minsym)
+ && (BMSYMBOL_VALUE_ADDRESS (msymbol)
> BLOCK_START (SYMBOL_BLOCK_VALUE (func))))
{
/* We also don't know anything about the function besides
static struct symtab *
debug_qf_find_pc_sect_symtab (struct objfile *objfile,
- struct minimal_symbol *msymbol,
+ struct bound_minimal_symbol msymbol,
CORE_ADDR pc,
struct obj_section *section,
int warn_if_readin)
fprintf_filtered (gdb_stdlog,
"qf->find_pc_sect_symtab (%s, %s, %s, %s, %d)\n",
debug_objfile_name (objfile),
- host_address_to_string (msymbol),
+ host_address_to_string (msymbol.minsym),
hex_string (pc),
host_address_to_string (section),
warn_if_readin);
word_size = gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
byte_order = gdbarch_byte_order (gdbarch);
- cache_novlys
- = read_memory_integer (MSYMBOL_VALUE_ADDRESS (novlys_msym.minsym),
- 4, byte_order);
+ cache_novlys = read_memory_integer (BMSYMBOL_VALUE_ADDRESS (novlys_msym),
+ 4, byte_order);
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 = BMSYMBOL_VALUE_ADDRESS (ovly_table_msym);
read_target_long_array (cache_ovly_table_base,
(unsigned int *) cache_ovly_table,
cache_novlys * 4, word_size, byte_order);
"find `_ovly_table' array\n"
"in inferior. Use `overlay manual' mode."));
- if (cache_ovly_table_base == MSYMBOL_VALUE_ADDRESS (minsym.minsym))
+ if (cache_ovly_table_base == BMSYMBOL_VALUE_ADDRESS (minsym))
/* Then go ahead and try to look up this single section in
the cache. */
if (simple_overlay_update_1 (osect))
symbol table that contains a symbol whose address is closest to
PC. */
struct symtab *(*find_pc_sect_symtab) (struct objfile *objfile,
- struct minimal_symbol *msymbol,
+ struct bound_minimal_symbol msymbol,
CORE_ADDR pc,
struct obj_section *section,
int warn_if_readin);
break;
}
fprintf_filtered (outfile, "[%2d] %c ", index, ms_type);
- fputs_filtered (paddress (gdbarch, MSYMBOL_VALUE_ADDRESS (msymbol)),
+ fputs_filtered (paddress (gdbarch, MSYMBOL_VALUE_ADDRESS (objfile,
+ msymbol)),
outfile);
fprintf_filtered (outfile, " %s", MSYMBOL_LINKAGE_NAME (msymbol));
if (section)
find_pc_sect_symtab_via_partial (CORE_ADDR pc, struct obj_section *section)
{
struct objfile *objfile;
- struct minimal_symbol *msymbol;
+ struct bound_minimal_symbol msymbol;
/* If we know that this is not a text address, return failure. This is
necessary because we loop based on texthigh and textlow, which do
not include the data ranges. */
- msymbol = lookup_minimal_symbol_by_pc_section (pc, section).minsym;
- if (msymbol
- && (MSYMBOL_TYPE (msymbol) == mst_data
- || MSYMBOL_TYPE (msymbol) == mst_bss
- || MSYMBOL_TYPE (msymbol) == mst_abs
- || MSYMBOL_TYPE (msymbol) == mst_file_data
- || MSYMBOL_TYPE (msymbol) == mst_file_bss))
+ msymbol = lookup_minimal_symbol_by_pc_section (pc, section);
+ if (msymbol.minsym
+ && (MSYMBOL_TYPE (msymbol.minsym) == mst_data
+ || MSYMBOL_TYPE (msymbol.minsym) == mst_bss
+ || MSYMBOL_TYPE (msymbol.minsym) == mst_abs
+ || MSYMBOL_TYPE (msymbol.minsym) == mst_file_data
+ || MSYMBOL_TYPE (msymbol.minsym) == mst_file_bss))
return NULL;
ALL_OBJFILES (objfile)
struct symtab *best_s = NULL;
struct objfile *objfile;
CORE_ADDR distance = 0;
- struct minimal_symbol *msymbol;
+ struct bound_minimal_symbol msymbol;
/* If we know that this is not a text address, return failure. This is
necessary because we loop based on the block's high and low code
addresses, which do not include the data ranges, and because
we call find_pc_sect_psymtab which has a similar restriction based
on the partial_symtab's texthigh and textlow. */
- msymbol = lookup_minimal_symbol_by_pc_section (pc, section).minsym;
- if (msymbol
- && (MSYMBOL_TYPE (msymbol) == mst_data
- || MSYMBOL_TYPE (msymbol) == mst_bss
- || MSYMBOL_TYPE (msymbol) == mst_abs
- || MSYMBOL_TYPE (msymbol) == mst_file_data
- || MSYMBOL_TYPE (msymbol) == mst_file_bss))
+ msymbol = lookup_minimal_symbol_by_pc_section (pc, section);
+ if (msymbol.minsym
+ && (MSYMBOL_TYPE (msymbol.minsym) == mst_data
+ || MSYMBOL_TYPE (msymbol.minsym) == mst_bss
+ || MSYMBOL_TYPE (msymbol.minsym) == mst_abs
+ || MSYMBOL_TYPE (msymbol.minsym) == mst_file_data
+ || MSYMBOL_TYPE (msymbol.minsym) == mst_file_bss))
return NULL;
/* Search all symtabs for the one whose file contains our address, and which
struct symtab_and_line val;
struct blockvector *bv;
struct bound_minimal_symbol msymbol;
- struct minimal_symbol *mfunsym;
struct objfile *objfile;
/* Info on best line seen so far, and where it starts, and its file. */
if (msymbol.minsym != NULL)
if (MSYMBOL_TYPE (msymbol.minsym) == mst_solib_trampoline)
{
- mfunsym
+ struct bound_minimal_symbol mfunsym
= lookup_minimal_symbol_text (MSYMBOL_LINKAGE_NAME (msymbol.minsym),
- NULL).minsym;
- if (mfunsym == NULL)
+ NULL);
+
+ if (mfunsym.minsym == NULL)
/* I eliminated this warning since it is coming out
* in the following situation:
* gdb shmain // test program with shared libraries
SYMBOL_LINKAGE_NAME (msymbol)); */
;
/* fall through */
- else if (MSYMBOL_VALUE_ADDRESS (mfunsym)
- == MSYMBOL_VALUE_ADDRESS (msymbol.minsym))
+ else if (BMSYMBOL_VALUE_ADDRESS (mfunsym)
+ == BMSYMBOL_VALUE_ADDRESS (msymbol))
/* Avoid infinite recursion */
/* See above comment about why warning is commented out. */
/* warning ("In stub for %s; unable to find real function/line info",
;
/* fall through */
else
- return find_pc_line (MSYMBOL_VALUE_ADDRESS (mfunsym), 0);
+ return find_pc_line (BMSYMBOL_VALUE_ADDRESS (mfunsym), 0);
}
}
objfile = msymbol.objfile;
- pc = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
+ pc = BMSYMBOL_VALUE_ADDRESS (msymbol);
section = MSYMBOL_OBJ_SECTION (objfile, msymbol.minsym);
name = MSYMBOL_LINKAGE_NAME (msymbol.minsym);
}
is to expand the symbol table if msymbol is found, for the
benefit of the next loop on ALL_PRIMARY_SYMTABS. */
if (kind == FUNCTIONS_DOMAIN
- ? find_pc_symtab (MSYMBOL_VALUE_ADDRESS (msymbol)) == NULL
+ ? find_pc_symtab (MSYMBOL_VALUE_ADDRESS (objfile,
+ msymbol)) == NULL
: (lookup_symbol_in_objfile_from_linkage_name
(objfile, MSYMBOL_LINKAGE_NAME (msymbol), VAR_DOMAIN)
== NULL))
/* For functions we can do a quick check of whether the
symbol might be found via find_pc_symtab. */
if (kind != FUNCTIONS_DOMAIN
- || find_pc_symtab (MSYMBOL_VALUE_ADDRESS (msymbol)) == NULL)
+ || find_pc_symtab (MSYMBOL_VALUE_ADDRESS (objfile,
+ msymbol)) == NULL)
{
if (lookup_symbol_in_objfile_from_linkage_name
(objfile, MSYMBOL_LINKAGE_NAME (msymbol), VAR_DOMAIN)
char *tmp;
if (gdbarch_addr_bit (gdbarch) <= 32)
- tmp = hex_string_custom (MSYMBOL_VALUE_ADDRESS (msymbol.minsym)
+ tmp = hex_string_custom (BMSYMBOL_VALUE_ADDRESS (msymbol)
& (CORE_ADDR) 0xffffffff,
8);
else
- tmp = hex_string_custom (MSYMBOL_VALUE_ADDRESS (msymbol.minsym),
+ tmp = hex_string_custom (BMSYMBOL_VALUE_ADDRESS (msymbol),
16);
printf_filtered ("%s %s\n",
tmp, MSYMBOL_PRINT_NAME (msymbol.minsym));
#define MSYMBOL_TYPE(msymbol) (msymbol)->type
#define MSYMBOL_VALUE(symbol) (symbol)->mginfo.value.ivalue
-#define MSYMBOL_VALUE_ADDRESS(symbol) ((symbol)->mginfo.value.address + 0)
-#define SET_MSYMBOL_VALUE_ADDRESS(symbol, new_value) \
+/* The unrelocated address of the minimal symbol. */
+#define MSYMBOL_VALUE_RAW_ADDRESS(symbol) ((symbol)->mginfo.value.address + 0)
+/* This weird definition lets us syntax-check without affecting the
+ results. It is a temporary measure until a later patch. */
+#define MSYMBOL_VALUE_ADDRESS(objfile, symbol) \
+ ((symbol)->mginfo.value.address \
+ + (0 \
+ * ANOFFSET ((objfile)->section_offsets, ((symbol)->mginfo.section))))
+/* For a bound minsym, we can easily compute the address directly. */
+#define BMSYMBOL_VALUE_ADDRESS(symbol) \
+ MSYMBOL_VALUE_ADDRESS ((symbol).objfile, (symbol).minsym)
+#define SET_MSYMBOL_VALUE_ADDRESS(symbol, new_value) \
((symbol)->mginfo.value.address = (new_value))
#define MSYMBOL_VALUE_BYTES(symbol) (symbol)->mginfo.value.bytes
#define MSYMBOL_BLOCK_VALUE(symbol) (symbol)->mginfo.value.block
printf_filtered ("static storage at address ");
printf_filtered ("%s",
paddress (gdbarch,
- MSYMBOL_VALUE_ADDRESS (msym.minsym)));
+ BMSYMBOL_VALUE_ADDRESS (msym)));
}
break;
case LOC_OPTIMIZED_OUT:
#include "tui/tui-file.h"
#include "tui/tui-disasm.h"
#include "progspace.h"
+#include "objfiles.h"
#include "gdb_curses.h"
{
CORE_ADDR last_addr;
int pos;
- struct minimal_symbol *msymbol;
+ struct bound_minimal_symbol msymbol;
/* Find backward an address which is a symbol and for which
disassembling from that address will fill completely the
pos = max_lines - 1;
do {
new_low -= 1 * max_lines;
- msymbol = lookup_minimal_symbol_by_pc_section (new_low, 0).minsym;
+ msymbol = lookup_minimal_symbol_by_pc_section (new_low, 0);
- if (msymbol)
- new_low = MSYMBOL_VALUE_ADDRESS (msymbol);
+ if (msymbol.minsym)
+ new_low = BMSYMBOL_VALUE_ADDRESS (msymbol);
else
new_low += 1 * max_lines;
tui_disassemble (gdbarch, asm_lines, new_low, max_lines);
last_addr = asm_lines[pos].addr;
- } while (last_addr > pc && msymbol);
+ } while (last_addr > pc && msymbol.minsym);
/* Scan forward disassembling one instruction at a time until
the last visible instruction of the window matches the pc.
if (main_symbol.minsym == 0)
main_symbol = lookup_minimal_symbol ("_start", NULL, NULL);
if (main_symbol.minsym)
- addr = MSYMBOL_VALUE_ADDRESS (main_symbol.minsym);
+ addr = BMSYMBOL_VALUE_ADDRESS (main_symbol);
else
addr = 0;
}
type = lookup_pointer_type (builtin_type (gdbarch)->builtin_char);
type = lookup_function_type (type);
type = lookup_pointer_type (type);
- maddr = MSYMBOL_VALUE_ADDRESS (msymbol.minsym);
+ maddr = BMSYMBOL_VALUE_ADDRESS (msymbol);
if (objf_p)
*objf_p = objfile;
else
{
retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno),
- MSYMBOL_VALUE_ADDRESS (msym.minsym));
+ BMSYMBOL_VALUE_ADDRESS (msym));
}
}
else
set_value_address (v,
gdbarch_convert_from_func_ptr_addr
- (gdbarch, MSYMBOL_VALUE_ADDRESS (msym.minsym), ¤t_target));
+ (gdbarch, BMSYMBOL_VALUE_ADDRESS (msym), ¤t_target));
}
if (arg1p)