int
symbol_read_needs_frame (struct symbol *sym)
{
+ if (SYMBOL_COMPUTED_OPS (sym) != NULL)
+ return SYMBOL_COMPUTED_OPS (sym)->read_needs_frame (sym);
+
switch (SYMBOL_CLASS (sym))
{
/* All cases listed explicitly so that gcc -Wall will detect it if
we failed to consider one. */
case LOC_COMPUTED:
- /* FIXME: cagney/2004-01-26: It should be possible to
- unconditionally call the SYMBOL_COMPUTED_OPS method when available.
- Unfortunately DWARF 2 stores the frame-base (instead of the
- function) location in a function's symbol. Oops! For the
- moment enable this when/where applicable. */
- return SYMBOL_COMPUTED_OPS (sym)->read_needs_frame (sym);
+ gdb_assert_not_reached (_("LOC_COMPUTED variable missing a method"));
case LOC_REGISTER:
case LOC_ARG:
if found. It should be initialized to NULL before the search
is started. */
struct 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.
gdb_assert (data->result == NULL);
data->result = lookup_minimal_symbol (data->name, NULL, objfile);
+ data->objfile = objfile;
/* The iterator should stop iff a match was found. */
return (data->result != NULL);
if (symbol_read_needs_frame (var))
gdb_assert (frame);
+ if (SYMBOL_COMPUTED_OPS (var) != NULL)
+ return SYMBOL_COMPUTED_OPS (var)->read_variable (var, frame);
+
switch (SYMBOL_CLASS (var))
{
case LOC_CONST:
{
CORE_ADDR addr
= symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var),
- SYMBOL_OBJ_SECTION (var));
+ SYMBOL_OBJ_SECTION (SYMBOL_OBJFILE (var),
+ var));
store_typed_address (value_contents_raw (v), type, addr);
}
v = allocate_value_lazy (type);
if (overlay_debugging)
addr = symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var),
- SYMBOL_OBJ_SECTION (var));
+ SYMBOL_OBJ_SECTION (SYMBOL_OBJFILE (var),
+ var));
else
addr = SYMBOL_VALUE_ADDRESS (var);
break;
v = allocate_value_lazy (type);
if (overlay_debugging)
addr = symbol_overlayed_address
- (BLOCK_START (SYMBOL_BLOCK_VALUE (var)), SYMBOL_OBJ_SECTION (var));
+ (BLOCK_START (SYMBOL_BLOCK_VALUE (var)), SYMBOL_OBJ_SECTION (SYMBOL_OBJFILE (var),
+ var));
else
addr = BLOCK_START (SYMBOL_BLOCK_VALUE (var));
break;
break;
case LOC_COMPUTED:
- /* FIXME: cagney/2004-01-26: It should be possible to
- unconditionally call the SYMBOL_COMPUTED_OPS method when available.
- Unfortunately DWARF 2 stores the frame-base (instead of the
- function) location in a function's symbol. Oops! For the
- moment enable this when/where applicable. */
- return SYMBOL_COMPUTED_OPS (var)->read_variable (var, frame);
+ gdb_assert_not_reached (_("LOC_COMPUTED variable missing a method"));
case LOC_UNRESOLVED:
{
error (_("No global symbol \"%s\"."), SYMBOL_LINKAGE_NAME (var));
if (overlay_debugging)
addr = symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (msym),
- SYMBOL_OBJ_SECTION (msym));
+ SYMBOL_OBJ_SECTION (lookup_data.objfile,
+ msym));
else
addr = SYMBOL_VALUE_ADDRESS (msym);
- obj_section = SYMBOL_OBJ_SECTION (msym);
+ obj_section = SYMBOL_OBJ_SECTION (lookup_data.objfile, msym);
if (obj_section
&& (obj_section->the_bfd_section->flags & SEC_THREAD_LOCAL) != 0)
addr = target_translate_tls_address (obj_section->objfile, addr);