]> Cypherpunks repositories - gostls13.git/commitdiff
Fix uninstalling of breakpoints when a process exits. Process
authorAustin Clements <aclements@csail.mit.edu>
Thu, 3 Sep 2009 17:55:20 +0000 (10:55 -0700)
committerAustin Clements <aclements@csail.mit.edu>
Thu, 3 Sep 2009 17:55:20 +0000 (10:55 -0700)
exit is still handled poorly.

R=rsc
APPROVED=rsc
DELTA=6  (6 added, 0 deleted, 0 changed)
OCL=34288
CL=34315

src/pkg/debug/proc/proc_linux.go
usr/austin/ptrace/ptrace_linux.go

index 87d3bf1ef751599f974b02d7c8e24e1b20694889..913b212a0318e90169fac5517664238d0db4aeac 100644 (file)
@@ -386,6 +386,9 @@ func (p *process) installBreakpoints() os.Error {
 //
 // Must be called from the monitor thread.
 func (p *process) uninstallBreakpoints() os.Error {
+       if len(p.threads) == 0 {
+               return nil;
+       }
        n := 0;
        main := p.someStoppedThread();
        for _, b := range p.breakpoints {
index 115a29e5f2aa794c41fb28073bc48d84d794390e..06c02808f269dc01382d02591fc95cad213afce0 100644 (file)
@@ -384,6 +384,9 @@ func (p *process) installBreakpoints() os.Error {
 //
 // Must be called from the monitor thread.
 func (p *process) uninstallBreakpoints() os.Error {
+       if len(p.threads) == 0 {
+               return nil;
+       }
        n := 0;
        main := p.someStoppedThread();
        for _, b := range p.breakpoints {