aboutsummaryrefslogtreecommitdiff
path: root/gdb/findvar.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/findvar.c')
-rw-r--r--gdb/findvar.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/gdb/findvar.c b/gdb/findvar.c
index 22be47a..fdce436 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -414,6 +414,9 @@ struct minsym_lookup_data
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.
@@ -429,6 +432,7 @@ minsym_lookup_iterator_cb (struct objfile *objfile, void *cb_data)
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);
@@ -475,7 +479,8 @@ default_read_var_value (struct symbol *var, struct frame_info *frame)
{
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);
}
@@ -496,7 +501,8 @@ default_read_var_value (struct symbol *var, struct frame_info *frame)
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;
@@ -541,7 +547,8 @@ default_read_var_value (struct symbol *var, struct frame_info *frame)
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;
@@ -600,11 +607,12 @@ default_read_var_value (struct symbol *var, struct frame_info *frame)
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);