summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
diff options
context:
space:
mode:
authorroland <roland>2005-08-18 03:41:29 +0000
committerroland <roland>2005-08-18 03:41:29 +0000
commite36387d7f8597e307927a8d7e1bd5d216d52e3db (patch)
tree67dda187433175c4b837a605541ee24c71c96194 /tapsets.cxx
parentbcde33fbb0a7991abbec44d76005c4acde723a86 (diff)
downloadsystemtap-steved-e36387d7f8597e307927a8d7e1bd5d216d52e3db.tar.gz
systemtap-steved-e36387d7f8597e307927a8d7e1bd5d216d52e3db.tar.xz
systemtap-steved-e36387d7f8597e307927a8d7e1bd5d216d52e3db.zip
2005-08-17 Roland McGrath <roland@redhat.com>
PR systemtap/1197 * loc2c.c (struct location): New members `fail', `fail_arg'. (alloc_location): New function. Initialize those members. (new_synthetic_loc, translate): Use that instead of obstack_alloc. (location_from_address, location_relative): Likewise. (FAIL): New macro. Use it everywhere in place of `error'. * loc2c-test.c (fail): New function. (handle_variable): Pass it to c_translate_location. * tapsets.cxx (dwflpp::loc2c_error): New static method. (dwflpp::literal_stmt_for_local): Pass it to to c_translate_location.
Diffstat (limited to 'tapsets.cxx')
-rw-r--r--tapsets.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/tapsets.cxx b/tapsets.cxx
index 1315cdf6..da16750a 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -19,6 +19,7 @@
#include <sstream>
#include <stdexcept>
#include <vector>
+#include <cstdarg>
extern "C" {
#include <elfutils/libdwfl.h>
@@ -628,6 +629,15 @@ dwflpp
return false;
}
+ static void loc2c_error (void *arg, const char *fmt, ...)
+ {
+ char *msg = NULL;
+ va_list ap;
+ va_start (ap, fmt);
+ vasprintf (&msg, fmt, ap);
+ va_end (ap);
+ throw semantic_error (msg);
+ }
string literal_stmt_for_local(Dwarf_Addr pc,
string const & local,
@@ -692,7 +702,8 @@ dwflpp
struct obstack pool;
obstack_init (&pool);
struct location *tail = NULL;
- struct location *head = c_translate_location (&pool, 1, module_bias,
+ struct location *head = c_translate_location (&pool, &loc2c_error, this,
+ 1, module_bias,
&attr_mem, pc,
&tail, fb_attr);
@@ -769,7 +780,8 @@ dwflpp
+ " :" + string(dwarf_errmsg (-1)));
}
else
- c_translate_location (&pool, 1, module_bias, &attr_mem, pc,
+ c_translate_location (&pool, NULL, NULL, 1,
+ module_bias, &attr_mem, pc,
&tail, NULL);
++i;
break;