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

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

Issue 135360043: code review 135360043: ogle/program/server: allow adding and removing breakpoints (Closed)
Left Patch Set: diff -r 0418a4e17396e2de2197a47cd4d6af67a54827d0 https://code.google.com/p/ogle Created 9 years, 7 months ago
Right Patch Set: diff -r 0418a4e17396e2de2197a47cd4d6af67a54827d0 https://code.google.com/p/ogle Created 9 years, 6 months 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « program/server/ptrace.go ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 provides RPC access to a local program being debugged. 5 // Package server provides RPC access to a local program being debugged.
6 // It is the remote end of the client implementation of the Program interface. 6 // It is the remote end of the client implementation of the Program interface.
7 package server 7 package server
8 8
9 import ( 9 import (
10 "bytes" 10 "bytes"
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 } 324 }
325 325
326 for { 326 for {
327 if err := s.setBreakpoints(); err != nil { 327 if err := s.setBreakpoints(); err != nil {
328 return err 328 return err
329 } 329 }
330 if err := s.ptraceCont(s.stoppedPid, 0); err != nil { 330 if err := s.ptraceCont(s.stoppedPid, 0); err != nil {
331 return fmt.Errorf("ptraceCont: %v", err) 331 return fmt.Errorf("ptraceCont: %v", err)
332 } 332 }
333 333
334 » » stoppedPid, err := s.waitForTrap(-1, true) 334 » » wpid, err := s.waitForTrap(-1, true)
335 if err == nil { 335 if err == nil {
336 » » » s.stoppedPid = stoppedPid 336 » » » s.stoppedPid = wpid
337 break 337 break
338 } 338 }
339 bce, ok := err.(*breakpointsChangedError) 339 bce, ok := err.(*breakpointsChangedError)
340 if !ok { 340 if !ok {
341 return err 341 return err
342 } 342 }
343 343
344 if err := syscall.Kill(s.stoppedPid, syscall.SIGSTOP); err != ni l { 344 if err := syscall.Kill(s.stoppedPid, syscall.SIGSTOP); err != ni l {
345 return fmt.Errorf("kill(SIGSTOP): %v", err) 345 return fmt.Errorf("kill(SIGSTOP): %v", err)
346 } 346 }
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 // topOfStack is the out-of-process equivalent of runtimeĀ·topofstack. 669 // topOfStack is the out-of-process equivalent of runtimeĀ·topofstack.
670 func (s *Server) topOfStack(funcEntry uint64) bool { 670 func (s *Server) topOfStack(funcEntry uint64) bool {
671 return funcEntry == s.runtime.goexit || 671 return funcEntry == s.runtime.goexit ||
672 funcEntry == s.runtime.mstart || 672 funcEntry == s.runtime.mstart ||
673 funcEntry == s.runtime.mcall || 673 funcEntry == s.runtime.mcall ||
674 funcEntry == s.runtime.morestack || 674 funcEntry == s.runtime.morestack ||
675 funcEntry == s.runtime.lessstack || 675 funcEntry == s.runtime.lessstack ||
676 funcEntry == s.runtime._rt0_go || 676 funcEntry == s.runtime._rt0_go ||
677 (s.runtime.externalthreadhandlerp != 0 && funcEntry == s.runtime .externalthreadhandlerp) 677 (s.runtime.externalthreadhandlerp != 0 && funcEntry == s.runtime .externalthreadhandlerp)
678 } 678 }
LEFTRIGHT

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