This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[PATCH] Fix compilation error related to DW_OP_* using old elfutils
- From: Wenji Huang <wenji dot huang at oracle dot com>
- To: SystemTAP <systemtap at sources dot redhat dot com>
- Date: Fri, 18 Sep 2009 11:34:23 +0800
- Subject: [PATCH] Fix compilation error related to DW_OP_* using old elfutils
- Reply-to: wenji dot huang at oracle dot com
Hi,
There will be compilation error in latest source repository since
some codes those may be specific to high elfutils were merged.
The proposed patch can fix them and works fine on elfutils 0.141/0.142.
Please take a look at it.
diff --git a/dwflpp.cxx b/dwflpp.cxx
index f3015fc..512460c 100644
--- a/dwflpp.cxx
+++ b/dwflpp.cxx
@@ -1737,7 +1737,7 @@ dwflpp::translate_location(struct obstack *pool,
if (dwarf_formudata (attr, &offset_loc.number) == 0)
return c_translate_location (pool, &loc2c_error, this,
&loc2c_emit_address, 1, 0, pc,
- &offset_loc, 1, NULL, NULL, NULL);
+ attr, &offset_loc, 1, NULL, NULL,
NULL);
}
#endif
diff --git a/loc2c.c b/loc2c.c
index ce5979b..e6ac58d 100644
--- a/loc2c.c
+++ b/loc2c.c
@@ -152,7 +152,8 @@ lose (struct location *loc,
static const char *
translate (struct obstack *pool, int indent, Dwarf_Addr addrbias,
- Dwarf_Attribute *attr, const Dwarf_Op *expr, const size_t len,
+ Dwarf_Attribute *attr __attribute__ ((unused)), const
Dwarf_Op *expr,
+ const size_t len,
struct location *input,
bool *need_fb, size_t *loser,
struct location *loc)
@@ -558,6 +559,7 @@ translate (struct obstack *pool, int indent,
Dwarf_Addr addrbias,
}
break;
+#if _ELFUTILS_PREREQ (0, 142)
case DW_OP_stack_value:
if (stack_depth > 1)
DIE ("DW_OP_stack_value left multiple values on stack");
@@ -593,6 +595,7 @@ translate (struct obstack *pool, int indent,
Dwarf_Addr addrbias,
DIE ("DW_OP_implicit_value not supported");
break;
+#endif
case DW_OP_call_frame_cfa:
// We pick this out when processing DW_AT_frame_base in