From f0df19a2d8d85df58dd217314bf2b83238b67817 Mon Sep 17 00:00:00 2001 From: roland Date: Thu, 18 Aug 2005 20:26:54 +0000 Subject: 2005-08-18 Roland McGrath * loc2c.c (c_translate_addressof): Take TYPEDIE instead of TYPEATTR. * loc2c.h: Update decl. * loc2c-test.c (handle_variable): Handle DW_TAG_pointer_type target for fetch. --- loc2c-test.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'loc2c-test.c') diff --git a/loc2c-test.c b/loc2c-test.c index 26734096..ed4769ec 100644 --- a/loc2c-test.c +++ b/loc2c-test.c @@ -222,13 +222,29 @@ handle_variable (Dwarf_Die *scopes, int nscopes, int out, error (2, 0, _("cannot get type of field: %s"), dwarf_errmsg (-1)); } - if (typetag != DW_TAG_base_type) - error (2, 0, _("fetch or store supported only for base type")); + switch (typetag) + { + case DW_TAG_base_type: + if (store) + c_translate_store (&pool, 1, cubias, die, typedie, &tail, "value"); + else + c_translate_fetch (&pool, 1, cubias, die, typedie, &tail, "value"); + break; - if (store) - c_translate_store (&pool, 1, cubias, die, typedie, &tail, "value"); - else - c_translate_fetch (&pool, 1, cubias, die, typedie, &tail, "value"); + case DW_TAG_pointer_type: + if (store) + error (2, 0, _("store not supported for pointer type")); + c_translate_pointer (&pool, 1, cubias, typedie, &tail); + c_translate_addressof (&pool, 1, cubias, die, typedie, &tail, "value"); + break; + + default: + if (store) + error (2, 0, _("store supported only for base type")); + else + error (2, 0, _("fetch supported only for base type or pointer")); + break; + } printf ("#define PROBEADDR %#" PRIx64 "ULL\n", pc); -- cgit