diff options
author | fche <fche> | 2008-02-12 21:25:42 +0000 |
---|---|---|
committer | fche <fche> | 2008-02-12 21:25:42 +0000 |
commit | 21beacc9a00ea48763048151c370e205c5f23379 (patch) | |
tree | 03ed2e7f5407cd7445154426ae212f411a928e11 | |
parent | 4c52f88eefaf2d39be9c937d00389dd123609a41 (diff) | |
download | systemtap-steved-21beacc9a00ea48763048151c370e205c5f23379.tar.gz systemtap-steved-21beacc9a00ea48763048151c370e205c5f23379.tar.xz systemtap-steved-21beacc9a00ea48763048151c370e205c5f23379.zip |
PR4393: fix relocatable-kernel global $variable access
2008-02-12 Frank Ch. Eigler <fche@elastic.org>
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 <fche@elastic.org>
* systemtap.pass1-4/buildok.exp: No longer kfail buildok/seventeen.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | elaborate.cxx | 1 | ||||
-rw-r--r-- | tapsets.cxx | 16 | ||||
-rw-r--r-- | testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | testsuite/systemtap.pass1-4/buildok.exp | 1 |
5 files changed, 28 insertions, 1 deletions
@@ -1,3 +1,10 @@ +2008-02-12 Frank Ch. Eigler <fche@elastic.org> + + 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 <hunt@redhat.com> 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 <fche@elastic.org> + + * systemtap.pass1-4/buildok.exp: No longer kfail buildok/seventeen. + 2008-02-07 Martin Hunt <hunt@redhat.com> * 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 *-*-*} |