summaryrefslogtreecommitdiffstats
path: root/loc2c.h
diff options
context:
space:
mode:
authorroland <roland>2005-08-18 03:42:24 +0000
committerroland <roland>2005-08-18 03:42:24 +0000
commitccc358b16c106058ec5c10d8c6c04a993fd58d88 (patch)
tree7e5438d868be5e71f7f969d176ee180414160bff /loc2c.h
parente36387d7f8597e307927a8d7e1bd5d216d52e3db (diff)
downloadsystemtap-steved-ccc358b16c106058ec5c10d8c6c04a993fd58d88.tar.gz
systemtap-steved-ccc358b16c106058ec5c10d8c6c04a993fd58d88.tar.xz
systemtap-steved-ccc358b16c106058ec5c10d8c6c04a993fd58d88.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'. (c_translate_location): Take new args FAIL, FAIL_ARG. * loc2c.h: Update declaration. * 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 'loc2c.h')
-rw-r--r--loc2c.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/loc2c.h b/loc2c.h
index 324de92c..c8cfb935 100644
--- a/loc2c.h
+++ b/loc2c.h
@@ -9,12 +9,20 @@ struct location; /* Opaque */
If DW_OP_fbreg is used, it may have a subfragment computing from
the FB_ATTR location expression.
- On errors, exit and never return (XXX ?). On success, return the
- first fragment created, which is also chained onto (*INPUT)->next.
- *INPUT is then updated with the new tail of that chain.
- *USED_DEREF is set to true iff the "deref" runtime operation
- was used, otherwise it is not modified. */
-struct location *c_translate_location (struct obstack *, int indent,
+ On errors, call FAIL, which should not return. Any later errors will use
+ FAIL and FAIL_ARG from the first c_translate_location call.
+
+ On success, return the first fragment created, which is also chained
+ onto (*INPUT)->next. *INPUT is then updated with the new tail of that
+ chain. *USED_DEREF is set to true iff the "deref" runtime operation was
+ used, otherwise it is not modified. */
+struct location *c_translate_location (struct obstack *,
+ void (*fail) (void *arg,
+ const char *fmt, ...)
+ __attribute__ ((noreturn,
+ format (printf, 2, 3))),
+ void *fail_arg,
+ int indent,
Dwarf_Addr bias,
Dwarf_Attribute *loc_attr,
Dwarf_Addr address,