diff options
author | Stan Cox <scox@redhat.com> | 2009-04-13 17:51:58 -0400 |
---|---|---|
committer | Stan Cox <scox@redhat.com> | 2009-04-13 17:51:58 -0400 |
commit | 8ca27b7dc58bf14e86cd40ae6246962fa580966d (patch) | |
tree | cd47c90e42a0956a87fee74aaa42fb9b5e90a930 /tapsets.cxx | |
parent | f5f4f6b9712d3a93e42d5c2f81d21bf229d65ab6 (diff) | |
download | systemtap-steved-8ca27b7dc58bf14e86cd40ae6246962fa580966d.tar.gz systemtap-steved-8ca27b7dc58bf14e86cd40ae6246962fa580966d.tar.xz systemtap-steved-8ca27b7dc58bf14e86cd40ae6246962fa580966d.zip |
Improve -l output for .label
* tapsets.cxx (iterate_over_cu_labels): Treat -l specially so the
output of a .label can be improved.
* labels.stp: Test -l
Diffstat (limited to 'tapsets.cxx')
-rw-r--r-- | tapsets.cxx | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/tapsets.cxx b/tapsets.cxx index 2316a777..774821c7 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -1339,8 +1339,12 @@ struct dwflpp } void - iterate_over_cu_labels (string label_val, string function, Dwarf_Die *cu, - void *data, + iterate_over_cu_labels (string label_val, + string function, + Dwarf_Die *cu, + vector<derived_probe *> & results, + probe_point *base_loc, + void *data, void (* callback)(const string &, const char *, int, @@ -1375,7 +1379,7 @@ struct dwflpp function_name = name; default: if (dwarf_haschildren (&die)) - iterate_over_cu_labels (label_val, function, &die, q, callback); + iterate_over_cu_labels (label_val, function, &die, results, base_loc, q, callback); continue; } @@ -1420,8 +1424,13 @@ struct dwflpp int nscopes = 0; nscopes = dwarf_getscopes_die (&die, &scopes); if (nscopes > 1) - callback(function_name.c_str(), file, - (int)dline, &scopes[1], stmt_addr, q); + { + callback(function_name.c_str(), file, + (int)dline, &scopes[1], stmt_addr, q); + if (sess.listing_mode) + results.back()->locations[0]->components.push_back + (new probe_point::component(TOK_LABEL, new literal_string (name))); + } } } while (dwarf_siblingof (&die, &die) == 0); @@ -4121,7 +4130,7 @@ query_cu (Dwarf_Die * cudie, void * arg) { // If we have a pattern string with target *label*, we // have to look at labels in all the matched srcfiles. - q->dw.iterate_over_cu_labels (q->label_val, q->function, q->dw.cu, q, query_statement); + q->dw.iterate_over_cu_labels (q->label_val, q->function, q->dw.cu, q->results, q->base_loc, q, query_statement); } else { |