| 1 |
# arch-specific requests of ptrace ___________________________ |
| 2 |
# |
| 3 |
%{ |
| 4 |
// Get _stp_val_array and _stp_lookup_* definitions. |
| 5 |
#include "linux/syscalls-common.h" |
| 6 |
|
| 7 |
static const _stp_val_array _stp_arch_ptrace_request_list[] = { |
| 8 |
V(PTRACE_SINGLEBLOCK), |
| 9 |
V(PTRACE_OLD_GETSIGINFO), |
| 10 |
V(PTRACE_OLD_SETSIGINFO), |
| 11 |
V(PTRACE_GETREGS), |
| 12 |
V(PTRACE_SETREGS), |
| 13 |
V(PTRACE_OLDSETOPTIONS), |
| 14 |
{0, NULL} |
| 15 |
}; |
| 16 |
%} |
| 17 |
|
| 18 |
function __arch_ptrace_request_str:string(request:long) |
| 19 |
%{ /* pure */ |
| 20 |
_stp_lookup_str(_stp_arch_ptrace_request_list, |
| 21 |
(unsigned long)STAP_ARG_request, STAP_RETVALUE, |
| 22 |
MAXSTRINGLEN); |
| 23 |
%} |
| 24 |
|
| 25 |
function _arch_ptrace_argstr(request, pid, addr, data) |
| 26 |
{ |
| 27 |
if (request == @const("PTRACE_SINGLEBLOCK")) |
| 28 |
return sprintf("PTRACE_SINGLEBLOCK, %d, %#x, %s", pid, |
| 29 |
addr, _signal_name (data)) |
| 30 |
if (request == @const("PTRACE_GETREGS") |
| 31 |
|| request == @const("PTRACE_SETREGS") |
| 32 |
|| request == @const("PTRACE_OLD_GETSIGINFO") |
| 33 |
|| request == @const("PTRACE_OLD_SETSIGINFO")) |
| 34 |
return sprintf("%s, %d, %#x, %p", |
| 35 |
__arch_ptrace_request_str(request), pid, |
| 36 |
addr, data) |
| 37 |
if (request == @const("PTRACE_OLDSETOPTIONS")) |
| 38 |
return sprintf("PTRACE_OLDSETOPTIONS, %d, %#x, %s", pid, |
| 39 |
addr, _ptrace_options_str(data)) |
| 40 |
} |
| 41 |
|
| 42 |
function _ptrace_return_arch_prctl_addr:long(request:long, addr:long, data:long) |
| 43 |
{ |
| 44 |
return 0 |
| 45 |
} |
| 46 |
|
| 47 |
# arch-specific pipe() syscall support |
| 48 |
function _ia64_pipe0:long() %{ /* pure */ |
| 49 |
STAP_RETVALUE = CONTEXT->kregs ? CONTEXT->kregs->r8 : 0; |
| 50 |
%} |
| 51 |
function _ia64_pipe1:long() %{ /* pure */ |
| 52 |
STAP_RETVALUE = _stp_current_pt_regs()->r9; |
| 53 |
%} |