From e7a012f0b1eea7e225b4097edf03ae27d0815fba Mon Sep 17 00:00:00 2001 From: graydon Date: Thu, 1 Sep 2005 02:53:53 +0000 Subject: 2005-08-31 Graydon Hoare PR systemtap/1258 * tapsets.cxx (dwflpp::literal_stmt_for_local): Support DW_TAG_enumeration_type tag as synonymous with DW_TAG_base_type. * loc2c.c (base_byte_size): Likewise. * testsuite/buildok/seven.stp: Adjust to work on UP kernels. --- ChangeLog | 9 +++++++++ loc2c.c | 3 ++- tapsets.cxx | 1 + testsuite/buildok/seven.stp | 26 +++++++++++++++++++++----- 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6370dbae..dd54c337 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-08-31 Graydon Hoare + + PR systemtap/1258 + * tapsets.cxx (dwflpp::literal_stmt_for_local): + Support DW_TAG_enumeration_type tag as synonymous with + DW_TAG_base_type. + * loc2c.c (base_byte_size): Likewise. + * testsuite/buildok/seven.stp: Adjust to work on UP kernels. + 2005-08-31 Graydon Hoare * tapsets.cxx (dwflpp::iterate_over_srcfile_lines): Correct segv diff --git a/loc2c.c b/loc2c.c index 1d610aa2..a6b4d8da 100644 --- a/loc2c.c +++ b/loc2c.c @@ -1129,7 +1129,8 @@ c_translate_pointer (struct obstack *pool, int indent, static Dwarf_Word base_byte_size (Dwarf_Die *typedie, struct location *origin) { - assert (dwarf_tag (typedie) == DW_TAG_base_type); + assert (dwarf_tag (typedie) == DW_TAG_base_type || + dwarf_tag (typedie) == DW_TAG_enumeration_type); Dwarf_Attribute attr_mem; Dwarf_Word size; diff --git a/tapsets.cxx b/tapsets.cxx index ec168ae9..f2eeb5d1 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -915,6 +915,7 @@ dwflpp + lex_cast(typetag)); break; + case DW_TAG_enumeration_type: case DW_TAG_base_type: ty = pe_long; c_translate_fetch (&pool, 1, module_bias, die, typedie, &tail, diff --git a/testsuite/buildok/seven.stp b/testsuite/buildok/seven.stp index 778e483d..2ac6bcd7 100755 --- a/testsuite/buildok/seven.stp +++ b/testsuite/buildok/seven.stp @@ -1,8 +1,24 @@ #! stap -p4 -probe kernel.function("rebalance_tick") { - log ("rebalance_tick (" . string ($this_cpu) . ", " . - string ($this_rq) . ", " . - string ($idle) . - ")") +# this tests whether integers, pointers, and enums can be +# logged (PR 1258) + + +# first: enums and ints + +probe kernel.function("find_pid") +{ + log ("find_pid (" . string($type) . "," + . string($nr) . ")") } + +# second: opaque pointers and enums + +probe kernel.function("detach_pid") +{ + log ("detach_pid (" . hexstring($task) . "," + . string($type) . ")") +} + + + -- cgit