+2005-07-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ * dwarf2.c (varinfo): Add addr.
+ (lookup_symbol_in_variable_table): Also check addr.
+ (scan_unit_for_symbols): Set addr for variable.
+ (comp_unit_find_line): Updated.
+
2005-07-06 Nick Clifton <nickc@redhat.com>
* coff-alpha.c (alpha_adjust_reloc_in): Issue an informative error
int line;
int tag;
char *name;
+ bfd_vma addr;
/* Where the symbol is defined */
asection *sec;
/* Is this a stack variable? */
static bfd_boolean
lookup_symbol_in_variable_table (struct comp_unit *unit,
asymbol *sym,
+ bfd_vma addr,
const char **filename_ptr,
unsigned int *linenumber_ptr)
{
for (each = unit->variable_table; each; each = each->prev_var)
if (each->stack == 0
+ && each->file != NULL
+ && each->name != NULL
+ && each->addr == addr
&& (!each->sec || each->sec == sec)
&& strcmp (name, each->name) == 0)
break;
break;
case DW_AT_location:
- if (var->stack)
+ switch (attr.form)
{
- switch (attr.form)
+ case DW_FORM_block:
+ case DW_FORM_block1:
+ case DW_FORM_block2:
+ case DW_FORM_block4:
+ if (*attr.u.blk->data == DW_OP_addr)
{
- case DW_FORM_block:
- case DW_FORM_block1:
- case DW_FORM_block2:
- case DW_FORM_block4:
- if (*attr.u.blk->data == DW_OP_addr)
- var->stack = 0;
- break;
-
- default:
- break;
+ var->stack = 0;
+ var->addr = bfd_get ((attr.u.blk->size - 1) * 8,
+ unit->abfd,
+ attr.u.blk->data + 1);
}
+ break;
+
+ default:
+ break;
}
break;
filename_ptr,
linenumber_ptr);
else
- return lookup_symbol_in_variable_table (unit, sym, filename_ptr,
+ return lookup_symbol_in_variable_table (unit, sym, addr,
+ filename_ptr,
linenumber_ptr);
}