Solaris 1.x to 2.x Transition Guide

ptrace() Request Values

The ptrace() facility is implemented on top of /proc. New applications should use proc(4) directly.

The ptrace() routine in Solaris 2.6 software is present solely to support applications running in BCP mode. It uses integers 1 - 9 as request values, while the SunOS release 4.x routine defines request values as symbolic constants in <sys/ptrace.h>. The following SunOS release 4.x request symbolic constants are compatible with Solaris 2.6 software.

The SunOS release 4.x PTRACE_CONT addr argument specifies where the stopped process should resume execution, unless addr = 1, in which case execution resumes from where the process had stopped. The equivalent Solaris 2.6 request 7 requires that addr always be equal to 1 and that execution always resumes from where the process stopped. Also, the Solaris 2.6 request 7 cancels all pending signals before the process resumes execution except those specified by data. The SunOS release 4.x PTRACE_CONT does not cancel all pending signals.

Table 16-2 shows SunOS release 4.x valid requests that are not supported by the Solaris 2.6 ptrace() routine.

Table 16-2 ptrace() Requests not Supported by Solaris 2.6 Software

PTRACE_ATTACH

PTRACE_GETWINDOW

PTRACE_DETACH

PTRACE_SETWINDOW

PTRACE_GETREGS

PTRACE_22

PTRACE_SETREGS

PTRACE_23

PTRACE_GETFPREGS

PTRACE_26

PTRACE_SETFPREGS

PTRACE_27

PTRACE_READDATA

PTRACE_28

PTRACE_WRITEDATA

PTRACE_SYSCALL

PTRACE_READTEXT

PTRACE_DUMPCORE

PTRACE_WRITETEXT

PTRACE_SETWRBKPT

PTRACE_GETFPAREGS

PTRACE_SETACBKPT

PTRACE_SETFPAREGS

PTRACE_CLRDR7