This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug translator/10538] New: Handle anonymous structs and unions nicer
- From: "mjw at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sources dot redhat dot com
- Date: 19 Aug 2009 19:43:39 -0000
- Subject: [Bug translator/10538] New: Handle anonymous structs and unions nicer
- Reply-to: sourceware-bugzilla at sourceware dot org
Currently something like stap -L 'process("/lib64/libc.so.6").function("*")'
crashes when an variable references an anonymous struct or union for which there
is no dwarfdie_name(). The easiest solution to that would be:
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -5604,7 +5604,7 @@ dwarf_type_name(Dwarf_Die& type_die, string& c_type)
}
if (done)
{
- c_type.append(dwarf_diename(&type_die));
+ c_type.append(dwarf_diename(&type_die) ?: "<unknown>");
return true;
}
Also the error message that is given when trying to access fields of an
anonymous struct/union could be nicer:
semantic error: unable to find member 'nonono' for struct <unknown>
(alternatives: f ptr: operator '->' at <input>:1:81
source: probe process("/lib64/libc.so.6").function("getsecretkey") {
printf("%x\n", $fct->nonono) }
Roland suggested to go for: 'typename' (file.h:123)
where typename can be 'struct foo' or 'struct' with the decl coordinates of the
type. To make it easier for the user to go have a look at the structure/union
they are trying to inspect.
--
Summary: Handle anonymous structs and unions nicer
Product: systemtap
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: translator
AssignedTo: systemtap at sources dot redhat dot com
ReportedBy: mjw at redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=10538
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.