diff options
author | fche <fche> | 2005-05-24 15:03:16 +0000 |
---|---|---|
committer | fche <fche> | 2005-05-24 15:03:16 +0000 |
commit | bed7c0afb62154918b411c325faa619749f1c050 (patch) | |
tree | 8cfd907f91b64bb7ffa3835e636541045295cde1 | |
parent | d4f41a6f345a85e9eccd3471990f5458cc687daf (diff) | |
download | systemtap-steved-bed7c0afb62154918b411c325faa619749f1c050.tar.gz systemtap-steved-bed7c0afb62154918b411c325faa619749f1c050.tar.xz systemtap-steved-bed7c0afb62154918b411c325faa619749f1c050.zip |
2005-05-24 Frank Ch. Eigler <fche@redhat.com>
* elaborate.cxx (find_array): Support automagic tapset globals.
* testsuite/semok/nine.stp: Test it ...
* testsuite/semlib/g2.stp: ... using this global array.
* staptree.cxx (stapfile print): List globals.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | elaborate.cxx | 7 | ||||
-rw-r--r-- | staptree.cxx | 11 | ||||
-rw-r--r-- | testsuite/semlib/g2.stp | 2 | ||||
-rwxr-xr-x | testsuite/semok/nine.stp | 2 |
5 files changed, 22 insertions, 6 deletions
@@ -1,5 +1,11 @@ 2005-05-24 Frank Ch. Eigler <fche@redhat.com> + * elaborate.cxx (find_array): Support automagic tapset globals. + * testsuite/semok/nine.stp: Test it. + * staptree.cxx (stapfile print): List globals. + +2005-05-24 Frank Ch. Eigler <fche@redhat.com> + * testsuite/semlib/*: New tapset library chunks for "-I" testing. * testsuite/semok/eight.stp, nine.stp: New tests. diff --git a/elaborate.cxx b/elaborate.cxx index 0f308c68..cac773bf 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -352,9 +352,12 @@ symresolution_info::find_array (const string& name, unsigned arity) { stapfile* f = session.library_files[i]; for (unsigned j=0; j<f->globals.size(); j++) - if (f->globals[j]->name == name && - f->globals[j]->index_types.size() == arity) + if (f->globals[j]->name == name) + if ((f->globals[j]->arity == (int) arity) || + f->globals[j]->arity < 0) { + f->globals[j]->set_arity (arity); + // put library into the queue if not already there if (0) // (session.verbose_resolution) cerr << " array " << name << " " diff --git a/staptree.cxx b/staptree.cxx index 3c4fe435..b1130d94 100644 --- a/staptree.cxx +++ b/staptree.cxx @@ -193,7 +193,7 @@ void symbol::print (ostream& o) void vardecl::print (ostream& o) { o << name; - if (index_types.size() > 0) + if (arity > 0 || index_types.size() > 0) o << "[...]"; } @@ -310,7 +310,14 @@ void stapfile::print (ostream& o) { o << "# file " << name << endl; - for(unsigned i=0; i<probes.size(); i++) + for (unsigned i=0; i<globals.size(); i++) + { + o << "global "; + globals[i]->print (o); + o << endl; + } + + for (unsigned i=0; i<probes.size(); i++) { probes[i]->print (o); o << endl; diff --git a/testsuite/semlib/g2.stp b/testsuite/semlib/g2.stp index d42f70c0..c1d5768b 100644 --- a/testsuite/semlib/g2.stp +++ b/testsuite/semlib/g2.stp @@ -1,2 +1,2 @@ global g2 -probe begin { g2 = f1() } +probe begin { g2[0] = f1() } diff --git a/testsuite/semok/nine.stp b/testsuite/semok/nine.stp index 15bcf8d9..f1a48c6f 100755 --- a/testsuite/semok/nine.stp +++ b/testsuite/semok/nine.stp @@ -1,3 +1,3 @@ #! /bin/sh -./stap -p2 -I${SRCDIR}/testsuite/semlib -e 'probe begin { a = g1 }' +./stap -p2 -I${SRCDIR}/testsuite/semlib -e 'probe begin { g2[1] = 0 }' |