summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-04-27 14:38:20 -0700
committerJosh Stone <jistone@redhat.com>2009-04-27 14:48:56 -0700
commit56eb845656c89a1a7027887c1b3e3dfb3aa866d7 (patch)
treee2974e1fbe569d4b24f964dba55850e972c28521
parent27805741410ddb1e62f451cd8a71ad5b92ed7dd8 (diff)
downloadsystemtap-steved-56eb845656c89a1a7027887c1b3e3dfb3aa866d7.tar.gz
systemtap-steved-56eb845656c89a1a7027887c1b3e3dfb3aa866d7.tar.xz
systemtap-steved-56eb845656c89a1a7027887c1b3e3dfb3aa866d7.zip
Handle more types of types in declaration_resolve
Instead of just structs and unions, we now also process typedefs, enums, and base types in iterate_over_globals, so declaration_resolve can find more variations. This especially useful to let @casts reference typedef names.
-rw-r--r--tapsets.cxx26
1 files changed, 14 insertions, 12 deletions
diff --git a/tapsets.cxx b/tapsets.cxx
index 976540ed..b040c622 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -2943,7 +2943,7 @@ dwflpp::has_single_line_record (dwarf_query * q, char const * srcfile, int linen
* only picks up top level stuff (i.e. nothing in a lower scope) */
int
dwflpp::iterate_over_globals (int (* callback)(Dwarf_Die *, void *),
- void * data)
+ void * data)
{
int rc = DWARF_CB_OK;
Dwarf_Die die;
@@ -2955,18 +2955,20 @@ dwflpp::iterate_over_globals (int (* callback)(Dwarf_Die *, void *),
if (dwarf_child(cu, &die) != 0)
return rc;
- do {
- /* We're only currently looking for structures and unions,
+ do
+ /* We're only currently looking for named types,
* although other types of declarations exist */
- if (dwarf_tag(&die) != DW_TAG_structure_type &&
- dwarf_tag(&die) != DW_TAG_union_type)
- continue;
-
- rc = (*callback)(&die, data);
- if (rc != DWARF_CB_OK)
- break;
-
- } while (dwarf_siblingof(&die, &die) == 0);
+ switch (dwarf_tag(&die))
+ {
+ case DW_TAG_base_type:
+ case DW_TAG_enumeration_type:
+ case DW_TAG_structure_type:
+ case DW_TAG_typedef:
+ case DW_TAG_union_type:
+ rc = (*callback)(&die, data);
+ break;
+ }
+ while (rc == DWARF_CB_OK && dwarf_siblingof(&die, &die) == 0);
return rc;
}