summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2013-12-09 16:33:26 +0100
committerMark Wielaard <[email protected]>2013-12-13 14:23:02 +0100
commit3951f2ec0aaca021c77a2c7a464dcf43433261c3 (patch)
treeae53cf11004fbb40596d7ccde179100b52f3fa20 /tests
parent8b10aaa3dd3db1981aee29cf8f88411707172295 (diff)
libdw: Handle empty location expression for (indirect) DIE locations.
When dwarf_getlocation_implicit_pointer and dwarf_getlocation_attr refer to a DIE that doesn't contain a DW_AT_location then don't generate an error, but return an empty location expression to signal the actual value pointed to is not available. This isn't invalid DWARF. Also make sure that __libdw_intern_expression handles empty location expressions. Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog5
-rw-r--r--tests/varlocs.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 9e4cd9af..31638d3c 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,8 @@
+2013-12-09 Mark Wielaard <[email protected]>
+
+ * varlocs.c (print_expr): Update comment to explain empty location
+ associated with DW_OP_GNU_implicit_pointer.
+
2013-12-05 Jan Kratochvil <[email protected]>
Fix test FAIL with -O2.
diff --git a/tests/varlocs.c b/tests/varlocs.c
index 6f4d4901..04f17ff2 100644
--- a/tests/varlocs.c
+++ b/tests/varlocs.c
@@ -404,7 +404,7 @@ print_expr (Dwarf_Attribute *attr, Dwarf_Op *expr, Dwarf_Addr addr)
int locs = dwarf_getlocation_addr (&attrval, addr,
&exprval, &exprval_len, 1);
if (locs == 0)
- printf ("<no location>"); // XXX should that be flagged?
+ printf ("<no location>"); // This means "optimized out".
else if (locs == 1)
print_expr_block (&attrval, exprval, exprval_len, addr);
else