From ccc358b16c106058ec5c10d8c6c04a993fd58d88 Mon Sep 17 00:00:00 2001 From: roland Date: Thu, 18 Aug 2005 03:42:24 +0000 Subject: 2005-08-17 Roland McGrath 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. --- loc2c.h | 20 ++++++++++++++------ 1 file 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, -- cgit