mirror of
				https://github.com/go-delve/delve.git
				synced 2025-10-31 18:57:18 +08:00 
			
		
		
		
	 b6fe5aebaf
			
		
	
	b6fe5aebaf
	
	
	
		
			
			- moved target.Interface into proc as proc.Process - rename proc.IThread to proc.Thread - replaced interfaces DisassembleInfo, Continuable and EvalScopeConvertible with Process. - removed superfluous Gdbserver prefix from types in the gdbserial backend. - removed superfluous Core prefix from types in the core backend.
		
			
				
	
	
		
			49 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			49 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| // +build linux darwin
 | |
| 
 | |
| package proc_test
 | |
| 
 | |
| import (
 | |
| 	"runtime"
 | |
| 	"syscall"
 | |
| 	"testing"
 | |
| 	"time"
 | |
| 
 | |
| 	"github.com/derekparker/delve/pkg/proc"
 | |
| 	protest "github.com/derekparker/delve/pkg/proc/test"
 | |
| )
 | |
| 
 | |
| func TestIssue419(t *testing.T) {
 | |
| 	if testBackend == "lldb" && runtime.GOOS == "darwin" {
 | |
| 		// debugserver bug?
 | |
| 		return
 | |
| 	}
 | |
| 	// SIGINT directed at the inferior should be passed along not swallowed by delve
 | |
| 	withTestProcess("issue419", t, func(p proc.Process, fixture protest.Fixture) {
 | |
| 		_, err := setFunctionBreakpoint(p, "main.main")
 | |
| 		assertNoError(err, t, "SetBreakpoint()")
 | |
| 		assertNoError(proc.Continue(p), t, "Continue()")
 | |
| 		go func() {
 | |
| 			for {
 | |
| 				time.Sleep(500 * time.Millisecond)
 | |
| 				if p.Running() {
 | |
| 					time.Sleep(2 * time.Second)
 | |
| 					if p.Pid() <= 0 {
 | |
| 						// if we don't stop the inferior the test will never finish
 | |
| 						p.RequestManualStop()
 | |
| 						p.Kill()
 | |
| 						t.Fatalf("Pid is zero or negative: %d", p.Pid())
 | |
| 						return
 | |
| 					}
 | |
| 					err := syscall.Kill(p.Pid(), syscall.SIGINT)
 | |
| 					assertNoError(err, t, "syscall.Kill")
 | |
| 					return
 | |
| 				}
 | |
| 			}
 | |
| 		}()
 | |
| 		err = proc.Continue(p)
 | |
| 		if _, exited := err.(proc.ProcessExitedError); !exited {
 | |
| 			t.Fatalf("Unexpected error after Continue(): %v\n", err)
 | |
| 		}
 | |
| 	})
 | |
| }
 |