Skip to content

Commit 6e480e1

Browse files
sago35aykevl
authored andcommitted
gdb: support daemonization on windows
1 parent dcff8b6 commit 6e480e1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ require (
99
github.com/google/shlex v0.0.0-20181106134648-c34317bd91bf
1010
github.com/marcinbor85/gohex v0.0.0-20200531091804-343a4b548892
1111
go.bug.st/serial v1.1.2
12+
golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78
1213
golang.org/x/tools v0.0.0-20200216192241-b320d3a0f5a2
1314
tinygo.org/x/go-llvm v0.0.0-20210206225315-7fe719483a0f
1415
)

util_windows.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@ package main
44

55
import (
66
"os/exec"
7+
"syscall"
8+
9+
"golang.org/x/sys/windows"
710
)
811

912
// setCommandAsDaemon makes sure this command does not receive signals sent to
10-
// the parent. It is unimplemented on Windows.
13+
// the parent.
1114
func setCommandAsDaemon(daemon *exec.Cmd) {
12-
// Not implemented.
15+
daemon.SysProcAttr = &syscall.SysProcAttr{
16+
CreationFlags: windows.DETACHED_PROCESS,
17+
}
1318
}

0 commit comments

Comments
 (0)