aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2005-07-06 13:43:21 +0000
committerH.J. Lu <hjl.tools@gmail.com>2005-07-06 13:43:21 +0000
commit5cf2e3f01e6546edc8951532cfeaebef5587fba4 (patch)
treedaabe28ca8890c9fd90541a871056132d590b566
parent0adc9281f0ab9962eb5aa72fe6e8113f9014a93b (diff)
downloadgdb-5cf2e3f01e6546edc8951532cfeaebef5587fba4.zip
gdb-5cf2e3f01e6546edc8951532cfeaebef5587fba4.tar.gz
gdb-5cf2e3f01e6546edc8951532cfeaebef5587fba4.tar.bz2
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.
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/dwarf2.c34
2 files changed, 28 insertions, 13 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index dd2e4a5..ed46c3c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+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
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index 9f65413..d65fb68 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -719,6 +719,7 @@ struct varinfo
int line;
int tag;
char *name;
+ bfd_vma addr;
/* Where the symbol is defined */
asection *sec;
/* Is this a stack variable? */
@@ -1495,6 +1496,7 @@ lookup_symbol_in_function_table (struct comp_unit *unit,
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)
{
@@ -1504,6 +1506,9 @@ lookup_symbol_in_variable_table (struct comp_unit *unit,
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;
@@ -1749,21 +1754,23 @@ scan_unit_for_symbols (struct comp_unit *unit)
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;
@@ -2073,7 +2080,8 @@ comp_unit_find_line (struct comp_unit *unit,
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);
}