]> Cypherpunks repositories - gostls13.git/commitdiff
Regenerate Linux 386 syscall bindings to add ptrace.
authorAustin Clements <aclements@csail.mit.edu>
Tue, 14 Jul 2009 18:59:19 +0000 (11:59 -0700)
committerAustin Clements <aclements@csail.mit.edu>
Tue, 14 Jul 2009 18:59:19 +0000 (11:59 -0700)
R=rsc
APPROVED=rsc
DELTA=82  (80 added, 2 deleted, 0 changed)
OCL=31610
CL=31612

src/pkg/syscall/zsyscall_linux_386.go
src/pkg/syscall/ztypes_linux_386.go

index 07629aa6a7dc076db0ae4296f487fc77022a6310..11d08d2c7a061ec5623717e1add96d926530ef77 100644 (file)
@@ -42,6 +42,12 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err
        return;
 }
 
+func ptrace(request int, pid int, addr uintptr, data uintptr) (errno int) {
+       r0, r1, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0);
+       errno = int(e1);
+       return;
+}
+
 func Access(path string, mode int) (errno int) {
        r0, r1, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0);
        errno = int(e1);
index 9d4190133eaea5dfbc0c3e1a5409b48b3602d7f6..a3b1e6b79adbbddb4b450488b339e5472712761d 100644 (file)
@@ -49,6 +49,9 @@ const (
        WSTOPPED = 0x2;
        WCONTINUED = 0x8;
        WNOWAIT = 0x1000000;
+       WCLONE = 0x80000000;
+       WALL = 0x40000000;
+       WNOTHREAD = 0x20000000;
        AF_UNIX = 0x1;
        AF_INET = 0x2;
        AF_INET6 = 0xa;
@@ -74,6 +77,43 @@ const (
        SizeofSockaddrInet6 = 0x1c;
        SizeofSockaddrAny = 0x1c;
        SizeofSockaddrUnix = 0x6e;
+       _PTRACE_TRACEME = 0;
+       _PTRACE_PEEKTEXT = 0x1;
+       _PTRACE_PEEKDATA = 0x2;
+       _PTRACE_PEEKUSER = 0x3;
+       _PTRACE_POKETEXT = 0x4;
+       _PTRACE_POKEDATA = 0x5;
+       _PTRACE_POKEUSER = 0x6;
+       _PTRACE_CONT = 0x7;
+       _PTRACE_KILL = 0x8;
+       _PTRACE_SINGLESTEP = 0x9;
+       _PTRACE_GETREGS = 0xc;
+       _PTRACE_SETREGS = 0xd;
+       _PTRACE_GETFPREGS = 0xe;
+       _PTRACE_SETFPREGS = 0xf;
+       _PTRACE_ATTACH = 0x10;
+       _PTRACE_DETACH = 0x11;
+       _PTRACE_GETFPXREGS = 0x12;
+       _PTRACE_SETFPXREGS = 0x13;
+       _PTRACE_SYSCALL = 0x18;
+       _PTRACE_SETOPTIONS = 0x4200;
+       _PTRACE_GETEVENTMSG = 0x4201;
+       _PTRACE_GETSIGINFO = 0x4202;
+       _PTRACE_SETSIGINFO = 0x4203;
+       PTRACE_O_TRACESYSGOOD = 0x1;
+       PTRACE_O_TRACEFORK = 0x2;
+       PTRACE_O_TRACEVFORK = 0x4;
+       PTRACE_O_TRACECLONE = 0x8;
+       PTRACE_O_TRACEEXEC = 0x10;
+       PTRACE_O_TRACEVFORKDONE = 0x20;
+       PTRACE_O_TRACEEXIT = 0x40;
+       PTRACE_O_MASK = 0x7f;
+       PTRACE_EVENT_FORK = 0x1;
+       PTRACE_EVENT_VFORK = 0x2;
+       PTRACE_EVENT_CLONE = 0x3;
+       PTRACE_EVENT_EXEC = 0x4;
+       PTRACE_EVENT_VFORK_DONE = 0x5;
+       PTRACE_EVENT_EXIT = 0x6;
        EPOLLIN = 0x1;
        EPOLLRDHUP = 0x2000;
        EPOLLOUT = 0x4;
@@ -85,6 +125,14 @@ const (
 
 // Types
 
+type _C_short int16
+
+type _C_int int32
+
+type _C_long int32
+
+type _C_long_long int64
+
 type Timespec struct {
        Sec int32;
        Nsec int32;
@@ -167,8 +215,6 @@ type Rlimit struct {
        Max uint64;
 }
 
-type _C_int int32
-
 type _Gid_t uint32
 
 type Stat_t struct {
@@ -252,6 +298,32 @@ type Linger struct {
        Linger int32;
 }
 
+type PtraceRegs struct {
+       Ebx int32;
+       Ecx int32;
+       Edx int32;
+       Esi int32;
+       Edi int32;
+       Ebp int32;
+       Eax int32;
+       Ds uint16;
+       __ds uint16;
+       Es uint16;
+       __es uint16;
+       Fs uint16;
+       __fs uint16;
+       Gs uint16;
+       __gs uint16;
+       Eax int32;
+       Eip int32;
+       Cs uint16;
+       __cs uint16;
+       Eflags int32;
+       Esp int32;
+       Ss uint16;
+       __ss uint16;
+}
+
 type FdSet struct {
        Bits [32]int32;
 }