From 21beacc9a00ea48763048151c370e205c5f23379 Mon Sep 17 00:00:00 2001 From: fche Date: Tue, 12 Feb 2008 21:25:42 +0000 Subject: PR4393: fix relocatable-kernel global $variable access 2008-02-12 Frank Ch. Eigler PR 4393 * tapsets.cxx (emit_address): Support relocatable kernels. (dwarf_derived_probe ctor): Hack around for missing USHRT_MAX. * elaborate.cxx (semantic_pass): Increment rc if exception caught. 2008-02-12 Frank Ch. Eigler * systemtap.pass1-4/buildok.exp: No longer kfail buildok/seventeen. --- ChangeLog | 7 +++++++ elaborate.cxx | 1 + tapsets.cxx | 16 ++++++++++++++++ testsuite/ChangeLog | 4 ++++ testsuite/systemtap.pass1-4/buildok.exp | 1 - 5 files changed, 28 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c22fcedf..4e306158 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-02-12 Frank Ch. Eigler + + PR 4393 + * tapsets.cxx (emit_address): Support relocatable kernels. + (dwarf_derived_probe ctor): Hack around for missing USHRT_MAX. + * elaborate.cxx (semantic_pass): Increment rc if exception caught. + 2008-02-12 Martin Hunt PR 5757 * tapsets.cxx, translate.cxx: Cleanup indentation a bit. diff --git a/elaborate.cxx b/elaborate.cxx index c01c3255..445c7ff0 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -1135,6 +1135,7 @@ semantic_pass (systemtap_session& s) catch (const semantic_error& e) { s.print_error (e); + rc ++; } return rc; diff --git a/tapsets.cxx b/tapsets.cxx index 540b3bc4..9fbad6bb 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -1365,6 +1365,17 @@ struct dwflpp modname, secname, address); obstack_printf (pool, "addr; })"); } + else if (n == 1 && module_name == TOK_KERNEL && secname[0] == '\0') + { + // elfutils' way of telling us that this is a relocatable kernel address, which we + // need to treat the same way here as dwarf_query::add_probe_point does: _stext. + address -= sess.sym_stext; + secname = "_stext"; + obstack_printf (pool, "({ static unsigned long addr = 0; "); + obstack_printf (pool, "if (addr==0) addr = _stp_module_relocate (\"%s\",\"%s\",%#" PRIx64 "); ", + modname, secname, address); + obstack_printf (pool, "addr; })"); + } else { throw semantic_error ("cannot relocate user-space dso (?) address"); @@ -3649,6 +3660,11 @@ dwarf_derived_probe::dwarf_derived_probe(const string& funcname, this->tok = q.base_probe->tok; + // XXX: hack for strange g++/gcc's +#ifndef USHRT_MAX +#define USHRT_MAX 32767 +#endif + // Range limit maxactive() value if (q.has_maxactive && (q.maxactive_val < 0 || q.maxactive_val > USHRT_MAX)) throw semantic_error ("maxactive value out of range [0," diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index 07af851d..da48742e 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2008-02-12 Frank Ch. Eigler + + * systemtap.pass1-4/buildok.exp: No longer kfail buildok/seventeen. + 2008-02-07 Martin Hunt * systemtap.base/debugpath.exp: Remove explicit closes. diff --git a/testsuite/systemtap.pass1-4/buildok.exp b/testsuite/systemtap.pass1-4/buildok.exp index cfa09f53..77e77181 100644 --- a/testsuite/systemtap.pass1-4/buildok.exp +++ b/testsuite/systemtap.pass1-4/buildok.exp @@ -6,7 +6,6 @@ foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] { # some tests are known to fail. switch $test { buildok/perfmon01.stp {setup_kfail 909 *-*-*} - buildok/seventeen.stp {setup_kfail 4393 *-*-*} buildok/twentysix.stp {setup_kfail 4105 *-*-*} buildok/twentyseven.stp {setup_kfail 4166 *-*-*} buildok/process_test.stp {setup_kfail 1155 *-*-*} -- cgit