From 246b383e71b24882db18311a748d713c57a2108e Mon Sep 17 00:00:00 2001 From: graydon Date: Wed, 31 Aug 2005 03:05:39 +0000 Subject: 2005-08-30 Graydon Hoare * tapsets.cxx (dwflpp::literal_stmt_for_local): Handle dwarf pointer-to-1-byte-means-char case (found in PR 1187) * parse.cxx (parse_symbol): Eliminate use of "." from target symbol parser, conflicting with string concatenation operator. * staptree.h (target_symbol::component_type) Eliminate comp_struct_pointer_member, since . and -> are considered the same now. * staptree.cxx (target_symbol::print): Likewise. * testsuite/buildok/seventeen.stp: Test solution on PR 1191. * testsuite/buildok/six.stp: Test working portion of PR 1155. * testsuite/semko/nineteen.stp: Unresolved portion of PR 1155. --- tapsets.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tapsets.cxx') diff --git a/tapsets.cxx b/tapsets.cxx index 0910c50d..4d44fb03 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -919,6 +919,7 @@ dwflpp Dwarf_Die pointee_typedie_mem; Dwarf_Die *pointee_typedie; Dwarf_Word pointee_encoding; + Dwarf_Word pointee_byte_size = 0; int pointee_typetag; if (dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem) == NULL) @@ -940,13 +941,18 @@ dwflpp if (dwarf_attr_integrate (pointee_typedie, DW_AT_type, &attr_mem) == NULL) throw semantic_error ("cannot get type of pointee: " + string(dwarf_errmsg (-1))); } + + if (dwarf_attr_integrate (pointee_typedie, DW_AT_byte_size, &attr_mem)) + dwarf_formudata (&attr_mem, &pointee_byte_size); dwarf_formudata (dwarf_attr_integrate (pointee_typedie, DW_AT_encoding, &attr_mem), &pointee_encoding); if (pointee_typetag == DW_TAG_base_type && (pointee_encoding == DW_ATE_signed_char - || pointee_encoding == DW_ATE_unsigned_char)) + || pointee_encoding == DW_ATE_unsigned_char + || ((pointee_encoding == DW_ATE_signed + || pointee_encoding == DW_ATE_unsigned) && pointee_byte_size == 1))) { // We have an (un)signed char* or (un)signed char[], fetch it into 'tmpc' and // then copy to the return value via something strcpy-ish. -- cgit