summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
diff options
context:
space:
mode:
authorroland <roland>2005-08-18 08:51:30 +0000
committerroland <roland>2005-08-18 08:51:30 +0000
commit4b1ad75ead48645adb7f8e6115aff95b76c2f32a (patch)
tree2f019f41fcd767cc373eafb902a8b1492c4f4f6f /tapsets.cxx
parent52e9954ec3b3944aa489f514f434cdab64330979 (diff)
downloadsystemtap-steved-4b1ad75ead48645adb7f8e6115aff95b76c2f32a.tar.gz
systemtap-steved-4b1ad75ead48645adb7f8e6115aff95b76c2f32a.tar.xz
systemtap-steved-4b1ad75ead48645adb7f8e6115aff95b76c2f32a.zip
2005-08-18 Roland McGrath <roland@redhat.com>
* loc2c.c (struct location): New member `emit_address'. (alloc_location): Initialize new member from ORIGIN. (location_from_address): New argument EMIT_ADDRESS. Initialize new member. (translate): Use LOC->emit_address hook to format DW_OP_addr constant. (location_relative): Die if DW_OP_addr is used. (default_emit_address): New function. (c_translate_location): New argument EMIT_ADDRESS, pass it down. Use default_emit_address if argument is null. * loc2c.h: Update decl. * loc2c-test.c (handle_variable): Update caller. * tapsets.cxx (dwflpp::literal_stmt_for_local): Update caller. (dwflpp::loc2c_emit_address): New static method.
Diffstat (limited to 'tapsets.cxx')
-rw-r--r--tapsets.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/tapsets.cxx b/tapsets.cxx
index da16750a..88369d55 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -28,6 +28,9 @@ extern "C" {
#include <elf.h>
#include <obstack.h>
#include "loc2c.h"
+
+#define __STDC_FORMAT_MACROS
+#include <inttypes.h>
}
#include <fnmatch.h>
@@ -639,6 +642,15 @@ dwflpp
throw semantic_error (msg);
}
+ static void loc2c_emit_address (void *arg, struct obstack *pool,
+ Dwarf_Addr address)
+ {
+ dwflpp *dwfl = (dwflpp *) arg;
+ obstack_printf (pool, "%#" PRIx64 "UL /* hard-coded %s address */",
+ address, dwfl_module_info (dwfl->module, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL));
+ }
+
string literal_stmt_for_local(Dwarf_Addr pc,
string const & local,
vector<pair<target_symbol::component_type,
@@ -703,6 +715,7 @@ dwflpp
obstack_init (&pool);
struct location *tail = NULL;
struct location *head = c_translate_location (&pool, &loc2c_error, this,
+ &loc2c_emit_address,
1, module_bias,
&attr_mem, pc,
&tail, fb_attr);
@@ -780,7 +793,7 @@ dwflpp
+ " :" + string(dwarf_errmsg (-1)));
}
else
- c_translate_location (&pool, NULL, NULL, 1,
+ c_translate_location (&pool, NULL, NULL, NULL, 1,
module_bias, &attr_mem, pc,
&tail, NULL);
++i;