summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rwxr-xr-xconfigure32
-rw-r--r--configure.ac8
-rw-r--r--tapsets.cxx62
-rwxr-xr-xtestsuite/buildok/eighteen.stp2
5 files changed, 66 insertions, 45 deletions
diff --git a/ChangeLog b/ChangeLog
index ed779a3b..702156c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-09-06 Frank Ch. Eigler <fche@elastic.org>
+
+ * configure.ac: Require elfutils 0.115+.
+ * tapsets.cxx: Restore graydon's PR 1244 code.
+ * testsuite/buildok/eighteen.stp: Correct typing.
+ * configure: Regenerated.
+
2005-09-06 Martin Hunt <hunt@redhat.com>
* tapset/context.stp: Add function target().
diff --git a/configure b/configure
index 169e3133..5898700d 100755
--- a/configure
+++ b/configure
@@ -5075,9 +5075,9 @@ fi
save_LIBS="$LIBS"
-echo "$as_me:$LINENO: checking for dwarf_func_inline in -ldw" >&5
-echo $ECHO_N "checking for dwarf_func_inline in -ldw... $ECHO_C" >&6
-if test "${ac_cv_lib_dw_dwarf_func_inline+set}" = set; then
+echo "$as_me:$LINENO: checking for dwarf_getscopes_die in -ldw" >&5
+echo $ECHO_N "checking for dwarf_getscopes_die in -ldw... $ECHO_C" >&6
+if test "${ac_cv_lib_dw_dwarf_getscopes_die+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -5095,11 +5095,11 @@ extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char dwarf_func_inline ();
+char dwarf_getscopes_die ();
int
main ()
{
-dwarf_func_inline ();
+dwarf_getscopes_die ();
;
return 0;
}
@@ -5126,39 +5126,37 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_lib_dw_dwarf_func_inline=yes
+ ac_cv_lib_dw_dwarf_getscopes_die=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_lib_dw_dwarf_func_inline=no
+ac_cv_lib_dw_dwarf_getscopes_die=no
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dw_dwarf_func_inline" >&5
-echo "${ECHO_T}$ac_cv_lib_dw_dwarf_func_inline" >&6
-if test $ac_cv_lib_dw_dwarf_func_inline = yes; then
+echo "$as_me:$LINENO: result: $ac_cv_lib_dw_dwarf_getscopes_die" >&5
+echo "${ECHO_T}$ac_cv_lib_dw_dwarf_getscopes_die" >&6
+if test $ac_cv_lib_dw_dwarf_getscopes_die = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBDW 1
_ACEOF
LIBS="-ldw $LIBS"
+else
+
+ { { echo "$as_me:$LINENO: error: systemtap requires elfutils 0.115+" >&5
+echo "$as_me: error: systemtap requires elfutils 0.115+" >&2;}
+ { (exit 1); exit 1; }; }
fi
stap_LIBS="$LIBS"
LIBS="$SAVE_LIBS"
-if test $ac_cv_lib_dw_dwarf_func_inline != yes
-then
- { { echo "$as_me:$LINENO: error: systemtap requires elfutils 0.114+" >&5
-echo "$as_me: error: systemtap requires elfutils 0.114+" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
date=`date +%Y-%m-%d`
cat >>confdefs.h <<_ACEOF
diff --git a/configure.ac b/configure.ac
index 6730879c..410e4d3d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,16 +24,12 @@ AC_SUBST(CXXFLAGS)
dnl Need libdwfl-capable recent elfutils from Fedora
save_LIBS="$LIBS"
-AC_CHECK_LIB(dw, dwarf_func_inline)
+AC_CHECK_LIB(dw, dwarf_getscopes_die,,[
+ AC_MSG_ERROR([systemtap requires elfutils 0.115+])])
stap_LIBS="$LIBS"
LIBS="$SAVE_LIBS"
AC_SUBST(stap_LIBS)
-if test $ac_cv_lib_dw_dwarf_func_inline != yes
-then
- AC_MSG_ERROR([systemtap requires elfutils 0.114+])
-fi
-
dnl Plop in the build (configure) date
date=`date +%Y-%m-%d`
AC_DEFINE_UNQUOTED(DATE, "$date", [Configuration/build date])
diff --git a/tapsets.cxx b/tapsets.cxx
index 4f52c1f7..4b5edd18 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -725,7 +725,8 @@ dwflpp
NULL, NULL, NULL, NULL));
}
- string literal_stmt_for_local(Dwarf_Addr pc,
+ string literal_stmt_for_local(Dwarf_Die *scope_die,
+ Dwarf_Addr pc,
string const & local,
vector<pair<target_symbol::component_type,
std::string> > const & components,
@@ -735,8 +736,13 @@ 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 "
@@ -1057,6 +1063,7 @@ 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);
@@ -1341,6 +1348,7 @@ static void
query_statement (string const & func,
char const * file,
int line,
+ Dwarf_Die *scope_die,
Dwarf_Addr stmt_addr,
dwarf_query * q)
{
@@ -1351,7 +1359,8 @@ 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, stmt_addr, *q));
+ q->results.push_back(new dwarf_derived_probe(func, file, line,
+ scope_die, stmt_addr, *q));
}
catch (const semantic_error& e)
{
@@ -1361,7 +1370,7 @@ query_statement (string const & func,
static void
query_inline_instance_info (Dwarf_Addr entrypc,
- inline_instance_info const & ii,
+ inline_instance_info & ii,
dwarf_query * q)
{
if (q->has_return)
@@ -1374,13 +1383,14 @@ 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, entrypc, q);
+ query_statement (ii.name, ii.decl_file, ii.decl_line,
+ &ii.die, entrypc, q);
}
}
static void
query_func_info (Dwarf_Addr entrypc,
- func_info const & fi,
+ func_info & fi,
dwarf_query * q)
{
if (q->has_return)
@@ -1388,14 +1398,18 @@ 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, entrypc, q);
+ 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);
}
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.prologue_end, q);
+ 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);
}
}
@@ -1416,13 +1430,15 @@ 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, addr, q);
+ query_statement (i->second.name, i->second.decl_file,
+ q->line, NULL, addr, q);
else
query_func_info (i->first, i->second, q);
}
}
- for (map<Dwarf_Addr, inline_instance_info>::iterator i = q->filtered_inlines.begin();
+ for (map<Dwarf_Addr, inline_instance_info>::iterator i
+ = q->filtered_inlines.begin();
i != q->filtered_inlines.end(); ++i)
{
if (q->dw.die_has_pc (&(i->second.die), addr))
@@ -1430,7 +1446,8 @@ 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, addr, q);
+ query_statement (i->second.name, i->second.decl_file,
+ q->line, NULL, addr, q);
else
query_inline_instance_info (i->first, i->second, q);
}
@@ -1623,12 +1640,12 @@ query_cu (Dwarf_Die * cudie, void * arg)
else
{
// Otherwise, simply probe all resolved functions...
- for (map<Dwarf_Addr, func_info>::const_iterator i = q->filtered_functions.begin();
+ for (map<Dwarf_Addr, func_info>::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<Dwarf_Addr, inline_instance_info>::const_iterator i
+ for (map<Dwarf_Addr, inline_instance_info>::iterator i
= q->filtered_inlines.begin(); i != q->filtered_inlines.end(); ++i)
query_inline_instance_info (i->first, i->second, q);
@@ -1644,7 +1661,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, query_addr, q);
+ query_statement ("", "", -1, NULL, query_addr, q);
}
return DWARF_CB_OK;
}
@@ -1736,10 +1753,11 @@ 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_Addr a)
- : q(q), addr(a)
+ var_expanding_copy_visitor(dwarf_query & q, Dwarf_Die *sd, Dwarf_Addr a)
+ : q(q), scope_die(sd), addr(a)
{}
void visit_target_symbol (target_symbol* e);
};
@@ -1766,8 +1784,9 @@ 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(addr,
+ {
+ ec->code = q.dw.literal_stmt_for_local(scope_die,
+ addr,
e->base_name.substr(1),
e->components,
fdecl->type);
@@ -1794,6 +1813,7 @@ 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),
@@ -1863,7 +1883,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, addr);
+ var_expanding_copy_visitor v (q, scope_die, addr);
require <block*> (&v, &(this->body), q.base_probe->body);
this->tok = q.base_probe->tok;
}
diff --git a/testsuite/buildok/eighteen.stp b/testsuite/buildok/eighteen.stp
index 4beda31a..5ec6debc 100755
--- a/testsuite/buildok/eighteen.stp
+++ b/testsuite/buildok/eighteen.stp
@@ -7,5 +7,5 @@
probe kernel.function("audit_getname@kernel/auditsc.c")
{
- log($name);
+ log(kernel_string($name));
}