diff options
author | David Smith <dsmith@redhat.com> | 2008-06-09 14:50:18 -0500 |
---|---|---|
committer | David Smith <dsmith@redhat.com> | 2008-06-09 14:55:05 -0500 |
commit | cdf6ed559ae01a88691849b1f5690cac15c8d3ae (patch) | |
tree | ed82ae958d63723555150be4cfcc9037d9d92be8 | |
parent | 46f7b6be8fcb252def4d0f7d5ea88f8c82fa647b (diff) | |
download | systemtap-steved-cdf6ed559ae01a88691849b1f5690cac15c8d3ae.tar.gz systemtap-steved-cdf6ed559ae01a88691849b1f5690cac15c8d3ae.tar.xz systemtap-steved-cdf6ed559ae01a88691849b1f5690cac15c8d3ae.zip |
Fixed utrace probe '$syscall' handling.
2008-06-09 David Smith <dsmith@redhat.com>
* tapsets.cxx
(utrace_var_expanding_copy_visitor::visit_target_symbol): Calls
'syscall_nr' to get the value of '$syscall'.
2008-06-09 David Smith <dsmith@redhat.com>
* x86_64/registers.stp (syscall_nr): Added syscall_nr function.
* i686/registers.stp (syscall_nr): Ditto.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | tapset/ChangeLog | 5 | ||||
-rw-r--r-- | tapset/i686/registers.stp | 4 | ||||
-rw-r--r-- | tapset/x86_64/registers.stp | 4 | ||||
-rw-r--r-- | tapsets.cxx | 19 |
5 files changed, 20 insertions, 16 deletions
@@ -11,6 +11,10 @@ 2008-06-09 David Smith <dsmith@redhat.com> + * tapsets.cxx + (utrace_var_expanding_copy_visitor::visit_target_symbol): Calls + 'syscall_nr' to get the value of '$syscall'. + * tapsets.cxx (utrace_derived_probe::join_group): Removed generated inclusion of tracehook.h. (utrace_var_expanding_copy_visitor::visit_target_symbol): Uses diff --git a/tapset/ChangeLog b/tapset/ChangeLog index 54f52aff..7a7fa183 100644 --- a/tapset/ChangeLog +++ b/tapset/ChangeLog @@ -1,3 +1,8 @@ +2008-06-09 David Smith <dsmith@redhat.com> + + * x86_64/registers.stp (syscall_nr): Added syscall_nr function. + * i686/registers.stp (syscall_nr): Ditto. + 2008-06-04 Zhaolei <zhaolei@cn.fujitsu.com> * syscalls2.stp: Add sys_unshare. diff --git a/tapset/i686/registers.stp b/tapset/i686/registers.stp index 72114dc9..f7437ebb 100644 --- a/tapset/i686/registers.stp +++ b/tapset/i686/registers.stp @@ -206,3 +206,7 @@ function regparm(n:long) %{ } else CONTEXT->regparm = _STP_REGPARM | (int) THIS->n; %} + +function syscall_nr:long() { + return register("orig_ax") +} diff --git a/tapset/x86_64/registers.stp b/tapset/x86_64/registers.stp index c9728de9..35c8ce49 100644 --- a/tapset/x86_64/registers.stp +++ b/tapset/x86_64/registers.stp @@ -245,3 +245,7 @@ function regparm(n:long) %{ } else CONTEXT->regparm = _STP_REGPARM | (int) THIS->n; %} + +function syscall_nr:long() { + return _stp_register("orig_ax", 1) +} diff --git a/tapsets.cxx b/tapsets.cxx index 1afe4267..8496e80a 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -5311,24 +5311,11 @@ utrace_var_expanding_copy_visitor::visit_target_symbol (target_symbol* e) // Remember that we've seen a target variable. target_symbol_seen = true; - // We're going to substitute '_stp_arg(0)' for the '$syscall' - // reference. - - // First, synthesize the '0' argument. We can't use 'e->tok' as the - // token, since the token's type gets checked during pass 3. So, - // we'll synthesize a new token. - literal_number* arg = new literal_number(0); - token* arg_tok = new token; - arg_tok->type = tok_number; - arg_tok->location = e->tok->location; - arg_tok->content = e->tok->content; - arg->tok = arg_tok; - - // Synthesize a functioncall with our argument. + // We're going to substitute a synthesized 'syscall_nr' function + // call for the '$syscall' reference. functioncall* n = new functioncall; n->tok = e->tok; - n->function = "_stp_arg"; - n->args.push_back(arg); + n->function = "syscall_nr"; n->referent = 0; // NB: must not resolve yet, to ensure inclusion in session provide <functioncall*> (this, n); |