summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
diff options
context:
space:
mode:
authorEugeniy Meshcheryakov <eugen@debian.org>2009-02-24 15:48:31 +0100
committerEugeniy Meshcheryakov <eugen@debian.org>2009-02-24 15:48:31 +0100
commitab421f562d14d1322b9197d9e23fcfbaf809fba3 (patch)
treea75fe2b3174ea14dd2538c075de13db898eb3fdf /tapsets.cxx
parent4176d5b1f4bf25adb8e44eaae9e6ab1de5a2c806 (diff)
parentcfba34fccd99924a47622c5082706867f0a34b12 (diff)
downloadsystemtap-steved-ab421f562d14d1322b9197d9e23fcfbaf809fba3.tar.gz
systemtap-steved-ab421f562d14d1322b9197d9e23fcfbaf809fba3.tar.xz
systemtap-steved-ab421f562d14d1322b9197d9e23fcfbaf809fba3.zip
Merge branch 'master' of git+ssh://sources.redhat.com/git/systemtap
Diffstat (limited to 'tapsets.cxx')
-rw-r--r--tapsets.cxx34
1 files changed, 20 insertions, 14 deletions
diff --git a/tapsets.cxx b/tapsets.cxx
index 959aa56b..e5efa153 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -1329,7 +1329,10 @@ struct dwflpp
const char * sym = label_val.c_str();
Dwarf_Die die;
- dwarf_child (cu, &die);
+ int res = dwarf_child (cu, &die);
+ if (res != 0)
+ return; // die without children, bail out.
+
static string function_name;
do
{
@@ -1337,13 +1340,11 @@ struct dwflpp
Dwarf_Attribute *attr = dwarf_attr (&die, DW_AT_name, &attr_mem);
int tag = dwarf_tag(&die);
const char *name = dwarf_formstring (attr);
- if (name == NULL)
- continue;
- if (tag == DW_TAG_subprogram)
+ if (tag == DW_TAG_subprogram && name != 0)
{
function_name = name;
}
- else if (tag == DW_TAG_label
+ else if (tag == DW_TAG_label && name != 0
&& ((strncmp(name, sym, strlen(sym)) == 0)
|| (name_has_wildcard (sym)
&& function_name_matches_pattern (name, sym))))
@@ -5723,7 +5724,7 @@ dwarf_builder::build(systemtap_session & sess,
}
}
- if (probe_type == probes_and_dwarf)
+ if (probe_type == probes_and_dwarf && ! sess.listing_mode)
{
Elf_Data *pdata = elf_getdata_rawchunk (elf, shdr->sh_offset, shdr->sh_size, ELF_T_BYTE);
assert (pdata != NULL);
@@ -5747,17 +5748,22 @@ dwarf_builder::build(systemtap_session & sess,
if (probe_scn_offset % (sizeof(__uint64_t)))
probe_scn_offset += sizeof(__uint64_t) - (probe_scn_offset % sizeof(__uint64_t));
probe_arg = *((__uint64_t*)((char*)pdata->d_buf + probe_scn_offset));
- if (strcmp (location->components[1]->arg->tok->content.c_str(), probe_name.c_str()) == 0)
- {
- probe_found = true;
- break;
- }
if (probe_scn_offset % (sizeof(__uint64_t)*2))
probe_scn_offset = (probe_scn_offset + sizeof(__uint64_t)*2) - (probe_scn_offset % (sizeof(__uint64_t)*2));
+ if (strcmp (location->components[1]->arg->tok->content.c_str(), probe_name.c_str()) == 0)
+ probe_found = true;
+ else
+ continue;
+ const token* sv_tok = location->components[1]->arg->tok;
+ location->components[1]->functor = TOK_STATEMENT;
+ location->components[1]->arg = new literal_number((int)probe_arg);
+ location->components[1]->arg->tok = sv_tok;
+ ((literal_map_t&)parameters)[TOK_STATEMENT] = location->components[1]->arg;
+ dwarf_query q(sess, base, location, *dw, parameters, finished_results);
+ dw->query_modules(&q);
}
- location->components[1]->functor = TOK_STATEMENT;
- location->components[1]->arg = new literal_number((int)probe_arg);
- ((literal_map_t&)parameters)[TOK_STATEMENT] = location->components[1]->arg;
+ if (probe_found)
+ return;
}
if (probe_type == dwarf_no_probes || ! probe_found)