summaryrefslogtreecommitdiffstats
path: root/dwflpp.cxx
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2009-10-05 09:11:59 +0200
committerMark Wielaard <mjw@redhat.com>2009-10-05 09:11:59 +0200
commit03ba05b65a2c555d3057006ef490d958bbf07df5 (patch)
treea4200a20794111740828617d8b1577f06c0e405a /dwflpp.cxx
parent73b5e9064aeb9d5b4862e8cf688f8048f9fce86a (diff)
downloadsystemtap-steved-03ba05b65a2c555d3057006ef490d958bbf07df5.tar.gz
systemtap-steved-03ba05b65a2c555d3057006ef490d958bbf07df5.tar.xz
systemtap-steved-03ba05b65a2c555d3057006ef490d958bbf07df5.zip
Handle DW_AT_const_value as alternative to location description.
* dwflpp.cxx (translate_location): Call c_translate_constant when attribute is DW_AT_const_value. (literal_stmt_for_local): Allow both DW_AT_location and DW_AT_const_value.
Diffstat (limited to 'dwflpp.cxx')
-rw-r--r--dwflpp.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/dwflpp.cxx b/dwflpp.cxx
index c611dbe3..3356ad78 100644
--- a/dwflpp.cxx
+++ b/dwflpp.cxx
@@ -1654,6 +1654,14 @@ dwflpp::translate_location(struct obstack *pool,
}
#endif
+ /* There is no location expression, but a constant value instead. */
+ if (dwarf_whatattr (attr) == DW_AT_const_value)
+ {
+ *tail = c_translate_constant (pool, &loc2c_error, this,
+ &loc2c_emit_address, 0, pc, attr);
+ return *tail;
+ }
+
Dwarf_Op *expr;
size_t len;
@@ -2216,7 +2224,8 @@ dwflpp::literal_stmt_for_local (vector<Dwarf_Die>& scopes,
<< "\n";
Dwarf_Attribute attr_mem;
- if (dwarf_attr_integrate (&vardie, DW_AT_location, &attr_mem) == NULL)
+ if (dwarf_attr_integrate (&vardie, DW_AT_const_value, &attr_mem) == NULL
+ && dwarf_attr_integrate (&vardie, DW_AT_location, &attr_mem) == NULL)
{
throw semantic_error("failed to retrieve location "
"attribute for local '" + local