Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2730)

Delta Between Two Patch Sets: program/server/ptrace.go

Issue 77140045: code review 77140045: ogle: allow multi-valued expressions such as regular ex... (Closed)
Left Patch Set: Created 10 years ago
Right Patch Set: diff -r d498f00956d1 https://code.google.com/p/ogle Created 10 years ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « program/proxyrpc/proxyrpc.go ('k') | program/server/server.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 // Copyright 2014 The Go Authors. All rights reserved. 1 // Copyright 2014 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package server 5 package server
6 6
7 // TODO: syscall.PTRACE_O_TRACECLONE shenanigans to trace multi-threaded 7 // TODO: syscall.PTRACE_O_TRACECLONE shenanigans to trace multi-threaded
8 // programs. 8 // programs.
9 9
10 import ( 10 import (
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 return <-s.ec 43 return <-s.ec
44 } 44 }
45 45
46 func (s *Server) ptraceGetRegs(pid int, regsout *syscall.PtraceRegs) (err error) { 46 func (s *Server) ptraceGetRegs(pid int, regsout *syscall.PtraceRegs) (err error) {
47 s.fc <- func() error { 47 s.fc <- func() error {
48 return syscall.PtraceGetRegs(pid, regsout) 48 return syscall.PtraceGetRegs(pid, regsout)
49 } 49 }
50 return <-s.ec 50 return <-s.ec
51 } 51 }
52 52
53 func (s *Server) ptraceSetRegs(pid int, regs *syscall.PtraceRegs) (err error) {
54 s.fc <- func() error {
55 return syscall.PtraceSetRegs(pid, regs)
56 }
57 return <-s.ec
58 }
59
53 func (s *Server) ptracePeek(pid int, addr uintptr, out []byte) (err error) { 60 func (s *Server) ptracePeek(pid int, addr uintptr, out []byte) (err error) {
54 s.fc <- func() error { 61 s.fc <- func() error {
55 n, err := syscall.PtracePeekText(pid, addr, out) 62 n, err := syscall.PtracePeekText(pid, addr, out)
56 if err != nil { 63 if err != nil {
57 return err 64 return err
58 } 65 }
59 if n != len(out) { 66 if n != len(out) {
60 return fmt.Errorf("ptracePeek: peeked %d bytes, want %d" , n, len(out)) 67 return fmt.Errorf("ptracePeek: peeked %d bytes, want %d" , n, len(out))
61 } 68 }
62 return nil 69 return nil
(...skipping 24 matching lines...) Expand all
87 94
88 func (s *Server) wait() (err error) { 95 func (s *Server) wait() (err error) {
89 var status syscall.WaitStatus 96 var status syscall.WaitStatus
90 s.fc <- func() error { 97 s.fc <- func() error {
91 _, err1 := syscall.Wait4(-1, &status, 0, nil) 98 _, err1 := syscall.Wait4(-1, &status, 0, nil)
92 return err1 99 return err1
93 } 100 }
94 // TODO: do something with status. 101 // TODO: do something with status.
95 return <-s.ec 102 return <-s.ec
96 } 103 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b