proc/gdbserial: disable lldb backend on windows (#819)

Lldb-server does not currently support windows/amd64 (it's in
development). And delve's native backend seems to work well on windows.
Disable the lldb backend on windows for now.

Fixes #817
This commit is contained in:
Alessandro Arzilli 2017-05-04 19:43:53 +02:00 committed by Derek Parker
parent dcf51a5032
commit 76ce11cffb

@ -292,14 +292,21 @@ func unusedPort() string {
const debugserverExecutable = "/Library/Developer/CommandLineTools/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/debugserver"
var ErrUnsupportedOS = errors.New("lldb backend not supported on windows")
// LLDBLaunch starts an instance of lldb-server and connects to it, asking
// it to launch the specified target program with the specified arguments
// (cmd) on the specified directory wd.
func LLDBLaunch(cmd []string, wd string) (*Process, error) {
switch runtime.GOOS {
case "windows":
return nil, ErrUnsupportedOS
default:
// check that the argument to Launch is an executable file
if fi, staterr := os.Stat(cmd[0]); staterr == nil && (fi.Mode()&0111) == 0 {
return nil, proc.NotExecutableErr
}
}
port := unusedPort()
isDebugserver := false
@ -354,6 +361,10 @@ func LLDBLaunch(cmd []string, wd string) (*Process, error) {
// for some stubs that do not provide an automated way of determining it
// (for example debugserver).
func LLDBAttach(pid int, path string) (*Process, error) {
if runtime.GOOS == "windows" {
return nil, ErrUnsupportedOS
}
port := unusedPort()
isDebugserver := false
var proc *exec.Cmd
@ -921,8 +932,8 @@ func (t *Thread) Blocked() bool {
func (p *Process) loadGInstr() []byte {
switch p.bi.GOOS {
case "windows":
//TODO(aarzilli): implement
panic("not implemented")
// mov rcx, QWORD PTR gs:0x28
return []byte{0x65, 0x48, 0x8b, 0x0c, 0x25, 0x28, 0x00, 0x00, 0x00}
case "linux":
switch p.bi.Arch.GStructOffset() {
case 0xfffffffffffffff8, 0x0: