mirror of
				https://github.com/go-delve/delve.git
				synced 2025-10-31 18:57:18 +08:00 
			
		
		
		
	 cc86bde549
			
		
	
	cc86bde549
	
	
	
		
			
			Change the linux verison of proc/native and proc/gdbserial (with debugserver) so that they let the target process use the terminal when delve is launched in headless mode. Windows already worked, proc/gdbserial (with rr) already worked. I couldn't find a way to make proc/gdbserial (with lldb-server) work. No tests are added because I can't think of a way to test for foregroundness of a process. Fixes #65
		
			
				
	
	
		
			41 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| package service
 | |
| 
 | |
| import "net"
 | |
| 
 | |
| // Config provides the configuration to start a Debugger and expose it with a
 | |
| // service.
 | |
| //
 | |
| // Only one of ProcessArgs or AttachPid should be specified. If ProcessArgs is
 | |
| // provided, a new process will be launched. Otherwise, the debugger will try
 | |
| // to attach to an existing process with AttachPid.
 | |
| type Config struct {
 | |
| 	// Listener is used to serve requests.
 | |
| 	Listener net.Listener
 | |
| 	// ProcessArgs are the arguments to launch a new process.
 | |
| 	ProcessArgs []string
 | |
| 	// WorkingDir is working directory of the new process. This field is used
 | |
| 	// only when launching a new process.
 | |
| 	WorkingDir string
 | |
| 
 | |
| 	// AttachPid is the PID of an existing process to which the debugger should
 | |
| 	// attach.
 | |
| 	AttachPid int
 | |
| 	// AcceptMulti configures the server to accept multiple connection.
 | |
| 	// Note that the server API is not reentrant and clients will have to coordinate.
 | |
| 	AcceptMulti bool
 | |
| 	// APIVersion selects which version of the API to serve (default: 1).
 | |
| 	APIVersion int
 | |
| 
 | |
| 	// CoreFile specifies the path to the core dump to open.
 | |
| 	CoreFile string
 | |
| 
 | |
| 	// Selects server backend.
 | |
| 	Backend string
 | |
| 
 | |
| 	// Foreground lets target process access stdin.
 | |
| 	Foreground bool
 | |
| 
 | |
| 	// DisconnectChan will be closed by the server when the client disconnects
 | |
| 	DisconnectChan chan<- struct{}
 | |
| }
 |