summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroland <roland>2005-08-18 20:26:54 +0000
committerroland <roland>2005-08-18 20:26:54 +0000
commitf0df19a2d8d85df58dd217314bf2b83238b67817 (patch)
tree1c185f3969bd57ee1b47231baddc8f6ad928dac8
parent75a163d33bf8ea239d5e6a10be1e293c5278f3c7 (diff)
downloadsystemtap-steved-f0df19a2d8d85df58dd217314bf2b83238b67817.tar.gz
systemtap-steved-f0df19a2d8d85df58dd217314bf2b83238b67817.tar.xz
systemtap-steved-f0df19a2d8d85df58dd217314bf2b83238b67817.zip
2005-08-18 Roland McGrath <roland@redhat.com>
* 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.
-rw-r--r--loc2c-test.c28
-rw-r--r--loc2c.c2
-rw-r--r--loc2c.h2
3 files changed, 24 insertions, 8 deletions
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);
diff --git a/loc2c.c b/loc2c.c
index 45c965aa..1d610aa2 100644
--- a/loc2c.c
+++ b/loc2c.c
@@ -1284,7 +1284,7 @@ void
c_translate_addressof (struct obstack *pool, int indent,
Dwarf_Addr dwbias __attribute__ ((unused)),
Dwarf_Die *die,
- Dwarf_Attribute *typeattr __attribute__ ((unused)),
+ Dwarf_Die *typedie __attribute__ ((unused)),
struct location **input, const char *target)
{
++indent;
diff --git a/loc2c.h b/loc2c.h
index a92e7bfd..329e624d 100644
--- a/loc2c.h
+++ b/loc2c.h
@@ -54,7 +54,7 @@ void c_translate_array (struct obstack *pool, int indent,
is a register or noncontiguous object. */
void c_translate_addressof (struct obstack *pool, int indent,
Dwarf_Addr dwbias, Dwarf_Die *die,
- Dwarf_Attribute *typeattr,
+ Dwarf_Die *typedie,
struct location **input, const char *target);
/* Translate a fragment to fetch the value of variable or member DIE