From 6e95311e6afb22fb83ed9981438ae003f3d302ea Mon Sep 17 00:00:00 2001 From: fche Date: Fri, 2 Sep 2005 17:59:12 +0000 Subject: [PATCH] 2005-09-02 Frank Ch. Eigler * tapsets.cxx: Temporarily rolled back graydon's changes. --- ChangeLog | 4 ++++ tapsets.cxx | 62 ++++++++++++++++++----------------------------------- 2 files changed, 25 insertions(+), 41 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8b812e931..309cb97c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-09-02 Frank Ch. Eigler + + * tapsets.cxx: Temporarily rolled back graydon's changes. + 2005-09-02 Frank Ch. Eigler * tapset/*.stp: Renamed several files to simplify names. diff --git a/tapsets.cxx b/tapsets.cxx index c7be52d2c..f2eeb5d19 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -700,8 +700,7 @@ dwflpp NULL, NULL, NULL, NULL)); } - string literal_stmt_for_local(Dwarf_Die *scope_die, - Dwarf_Addr pc, + string literal_stmt_for_local(Dwarf_Addr pc, string const & local, vector > const & components, @@ -711,13 +710,8 @@ dwflpp Dwarf_Die *scopes; Dwarf_Die vardie; - int nscopes = 0; - - if (scope_die) - nscopes = dwarf_getscopes_die (scope_die, &scopes); - else - nscopes = dwarf_getscopes (cu, pc, &scopes); + int nscopes = dwarf_getscopes (cu, pc, &scopes); if (nscopes == 0) { throw semantic_error ("unable to find any scopes containing " @@ -1052,7 +1046,6 @@ struct dwarf_derived_probe : public derived_probe dwarf_derived_probe (string const & funcname, char const * filename, int line, - Dwarf_Die *scope_die, Dwarf_Addr addr, dwarf_query & q); @@ -1337,7 +1330,6 @@ static void query_statement (string const & func, char const * file, int line, - Dwarf_Die *scope_die, Dwarf_Addr stmt_addr, dwarf_query * q) { @@ -1348,8 +1340,7 @@ query_statement (string const & func, throw semantic_error("incomplete: do not know how to interpret .relative", q->base_probe->tok); - q->results.push_back(new dwarf_derived_probe(func, file, line, - scope_die, stmt_addr, *q)); + q->results.push_back(new dwarf_derived_probe(func, file, line, stmt_addr, *q)); } catch (const semantic_error& e) { @@ -1359,7 +1350,7 @@ query_statement (string const & func, static void query_inline_instance_info (Dwarf_Addr entrypc, - inline_instance_info & ii, + inline_instance_info const & ii, dwarf_query * q) { if (q->has_return) @@ -1372,14 +1363,13 @@ query_inline_instance_info (Dwarf_Addr entrypc, clog << "querying entrypc " << hex << entrypc << dec << " of instance of inline '" << ii.name << "'" << endl; - query_statement (ii.name, ii.decl_file, ii.decl_line, - &ii.die, entrypc, q); + query_statement (ii.name, ii.decl_file, ii.decl_line, entrypc, q); } } static void query_func_info (Dwarf_Addr entrypc, - func_info & fi, + func_info const & fi, dwarf_query * q) { if (q->has_return) @@ -1387,18 +1377,14 @@ query_func_info (Dwarf_Addr entrypc, // NB. dwarf_derived_probe::emit_registrations will emit a // kretprobe based on the entrypc in this case. if (q->sess.verbose) - clog << "querying entrypc of function '" - << fi.name << "' for return probe" << endl; - query_statement (fi.name, fi.decl_file, fi.decl_line, - &fi.die, entrypc, q); + clog << "querying entrypc of function '" << fi.name << "' for return probe" << endl; + query_statement (fi.name, fi.decl_file, fi.decl_line, entrypc, q); } else { if (q->sess.verbose) - clog << "querying prologue-end of function '" - << fi.name << "'" << endl; - query_statement (fi.name, fi.decl_file, fi.decl_line, - &fi.die, fi.prologue_end, q); + clog << "querying prologue-end of function '" << fi.name << "'" << endl; + query_statement (fi.name, fi.decl_file, fi.decl_line, fi.prologue_end, q); } } @@ -1419,15 +1405,13 @@ query_srcfile_line (Dwarf_Line * line, void * arg) if (q->sess.verbose) clog << "function DIE lands on srcfile" << endl; if (q->has_statement_str) - query_statement (i->second.name, i->second.decl_file, - q->line, NULL, addr, q); + query_statement (i->second.name, i->second.decl_file, q->line, addr, q); else query_func_info (i->first, i->second, q); } } - for (map::iterator i - = q->filtered_inlines.begin(); + for (map::iterator i = q->filtered_inlines.begin(); i != q->filtered_inlines.end(); ++i) { if (q->dw.die_has_pc (&(i->second.die), addr)) @@ -1435,8 +1419,7 @@ query_srcfile_line (Dwarf_Line * line, void * arg) if (q->sess.verbose) clog << "inline instance DIE lands on srcfile" << endl; if (q->has_statement_str) - query_statement (i->second.name, i->second.decl_file, - q->line, NULL, addr, q); + query_statement (i->second.name, i->second.decl_file, q->line, addr, q); else query_inline_instance_info (i->first, i->second, q); } @@ -1629,12 +1612,12 @@ query_cu (Dwarf_Die * cudie, void * arg) else { // Otherwise, simply probe all resolved functions... - for (map::iterator i = q->filtered_functions.begin(); + for (map::const_iterator i = q->filtered_functions.begin(); i != q->filtered_functions.end(); ++i) query_func_info (i->first, i->second, q); // And all inline instances. - for (map::iterator i + for (map::const_iterator i = q->filtered_inlines.begin(); i != q->filtered_inlines.end(); ++i) query_inline_instance_info (i->first, i->second, q); @@ -1650,7 +1633,7 @@ query_cu (Dwarf_Die * cudie, void * arg) if (q->has_module) query_addr = q->dw.module_address_to_global(query_addr); - query_statement ("", "", -1, NULL, query_addr, q); + query_statement ("", "", -1, query_addr, q); } return DWARF_CB_OK; } @@ -1742,11 +1725,10 @@ var_expanding_copy_visitor static unsigned tick; dwarf_query & q; - Dwarf_Die *scope_die; Dwarf_Addr addr; - var_expanding_copy_visitor(dwarf_query & q, Dwarf_Die *sd, Dwarf_Addr a) - : q(q), scope_die(sd), addr(a) + var_expanding_copy_visitor(dwarf_query & q, Dwarf_Addr a) + : q(q), addr(a) {} void visit_target_symbol (target_symbol* e); }; @@ -1773,9 +1755,8 @@ var_expanding_copy_visitor::visit_target_symbol (target_symbol *e) embeddedcode *ec = new embeddedcode; ec->tok = e->tok; try - { - ec->code = q.dw.literal_stmt_for_local(scope_die, - addr, + { + ec->code = q.dw.literal_stmt_for_local(addr, e->base_name.substr(1), e->components, fdecl->type); @@ -1802,7 +1783,6 @@ var_expanding_copy_visitor::visit_target_symbol (target_symbol *e) dwarf_derived_probe::dwarf_derived_probe (string const & funcname, char const * filename, int line, - Dwarf_Die *scope_die, Dwarf_Addr addr, dwarf_query & q) : derived_probe (NULL), @@ -1872,7 +1852,7 @@ dwarf_derived_probe::dwarf_derived_probe (string const & funcname, locations.push_back(new probe_point(comps, q.base_probe->locations[0]->tok)); // Now make a local-variable-expanded copy of the probe body - var_expanding_copy_visitor v (q, scope_die, addr); + var_expanding_copy_visitor v (q, addr); require (&v, &(this->body), q.base_probe->body); this->tok = q.base_probe->tok; } -- 2.43.5