diff --git a/cmd/dlv/main.go b/cmd/dlv/main.go index 5a785632..cebe98ae 100644 --- a/cmd/dlv/main.go +++ b/cmd/dlv/main.go @@ -25,12 +25,14 @@ type term struct { const historyFile string = ".dbg_history" -func main() { +func init() { // We must ensure here that we are running on the same thread during // the execution of dbg. This is due to the fact that ptrace(2) expects // all commands after PTRACE_ATTACH to come from the same thread. runtime.LockOSThread() +} +func main() { var ( pid int run bool