Repository: go-delve/delve
Pull request #2574 (2021-07-07 22:19:34)

service/dap: handle unexpected debugger termination (EOF) error
Using [issue419.go](https://github.com/go-delve/delve/blob/master/_fixtures/issue419.go), I observed that the continue command fails with an error when debugger receives and forwards an interrupt. In spite of the stopped event, vscode still shows the state as RUNNING because the threads request is unable to retrieve any threads, but at least one dummy thread is always expected.

**Before**

```
./dlv dap --listen=:54321 --log --log-output=dap,debugger --headless=true
... 
Start
^CReceive signal interrupt 
End
2021-07-07T13:53:23-07:00 debug layer=dap "continue" command stopped - reason "exited", location ?:-1
2021-07-07T13:53:23-07:00 error layer=dap runtime error: EOF
2021-07-07T13:53:23-07:00 debug layer=dap [-> to client]{"seq":0,"type":"event","event":"stopped","body":{"reason":"exception","description":"runtime error","text":"EOF","allThreadsStopped":true}}
2021-07-07T13:53:23-07:00 debug layer=dap [<- from client]{"seq":9,"type":"request","command":"threads"}
2021-07-07T13:53:23-07:00 debug layer=dap Unable to display threads: EOF
2021-07-07T13:53:23-07:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":9,"success":false,"command":"threads","message":"Unable to display threads","body":{"error":{"id":2003,"format":"Unable to display threads: EOF"}}}
2021-07-07T13:53:57-07:00 debug layer=dap [<- from client]{"seq":10,"type":"request","command":"disconnect","arguments":{"terminateDebuggee":true}}
2021-07-07T13:53:57-07:00 debug layer=debugger halting
2021-07-07T13:53:57-07:00 debug layer=dap [-> to client]{"seq":0,"type":"event","event":"output","body":{"category":"console","output":"Detaching and terminating target process\n","source":{}}}
2021-07-07T13:53:57-07:00 debug layer=debugger detaching
2021-07-07T13:53:57-07:00 error layer=dap detach returned error: write tcp 127.0.0.1:50794->127.0.0.1:50796: write: broken pipe
2021-07-07T13:53:57-07:00 debug layer=dap Error while disconnecting: write tcp 127.0.0.1:50794->127.0.0.1:50796: write: broken pipe
2021-07-07T13:53:57-07:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":10,"success":false,"command":"disconnect","message":"Error while disconnecting","body":{"error":{"id":5000,"format":"Error while disconnecting: write tcp 127.0.0.1:50794-\u003e127.0.0.1:50796: write: broken pipe"}}}
2021-07-07T13:53:57-07:00 debug layer=dap DAP server stopping...
2021-07-07T13:53:57-07:00 debug layer=dap DAP server stopped
```

**After**
```
^CReceive signal interrupt 
End
2021-07-12T01:50:19-07:00 debug layer=dap "continue" command stopped - reason "exited", location ?:-1
2021-07-12T01:50:19-07:00 error layer=dap command failure: EOF
2021-07-12T01:50:19-07:00 debug layer=dap [-> to client]{"seq":0,"type":"event","event":"stopped","body":{"reason":"exception","description":"command failure","text":"EOF","allThreadsStopped":true}}
2021-07-12T01:50:19-07:00 debug layer=dap [<- from client]{"seq":9,"type":"request","command":"threads"}
2021-07-12T01:50:19-07:00 debug layer=dap [-> to client]{"seq":0,"type":"event","event":"output","body":{"category":"stderr","output":"Unable to retrieve goroutines: EOF\n","source":{}}}
2021-07-12T01:50:19-07:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":9,"success":true,"command":"threads","body":{"threads":[{"id":1,"name":"Dummy"}]}}
2021-07-12T01:50:19-07:00 debug layer=dap [<- from client]{"seq":10,"type":"request","command":"stackTrace","arguments":{"threadId":1,"levels":20,"format":{}}}
2021-07-12T01:50:19-07:00 debug layer=dap Unable to produce stack trace: write tcp 127.0.0.1:57150->127.0.0.1:57151: write: broken pipe
2021-07-12T01:50:19-07:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":10,"success":false,"command":"stackTrace","message":"Unable to produce stack trace","body":{"error":{"id":2004,"format":"Unable to produce stack trace: write tcp 127.0.0.1:57150-\u003e127.0.0.1:57151: write: broken pipe"}}}
```

![image](https://user-images.githubusercontent.com/51177946/125259204-f1484200-e2b3-11eb-8ee2-e748ce325293.png)
	

Unfortunately, I am unable to reproduce this programmatically from the unittest.

aarzilli: I don't see it with the command line client:

```
2021-07-08T14:09:54+02:00 debug layer=rpc (async 7) <- RPCServer.Command(api.DebuggerCommand{"name":"continue","ReturnInfoLoadConfig":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1}})
Start
^CReceive signal interrupt 
End
2021-07-08T14:09:55+02:00 debug layer=rpc (async 7) -> rpc2.CommandOut{"State":{"Pid":1344277,"Running":false,"Recording":false,"CoreDumping":false,"Threads":null,"NextInProgress":false,"exited":true,"exitStatus":0,"When":""}} error: ""
```
polinasok: I am seeing this:
```
2021-07-08T10:25:52-07:00 debug layer=rpc (async 7) <- RPCServer.Command(api.DebuggerCommand{"name":"continue","ReturnInfoLoadConfig":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1}})
2021-07-08T10:25:52-07:00 debug layer=debugger continuing
Start
^CReceive signal interrupt 
End
2021-07-08T10:25:57-07:00 debug layer=rpc (async 7) -> <nil>null error: "EOF"
2021-07-08T10:25:57-07:00 debug layer=rpc (async 8) <- RPCServer.State(rpc2.StateIn{"NonBlocking":false})
2021-07-08T10:25:57-07:00 debug layer=rpc (async 8) -> rpc2.StateOut{"State":{"Pid":0,"Running":false,"Recording":false,"CoreDumping":false,"currentThread":{"id":9689981,"pc":211865600,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false},"Threads":[{"id":9689981,"pc":211865600,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false}],"NextInProgress":false,"exited":false,"exitStatus":0,"When":""}} error: ""
```
I am on MacOS Big Sur. dlv at master.
polinasok: This is where EOF error is coming from:
https://github.com/go-delve/delve/blob/f0a32c8e1b6571c8c1cd4ed89dcb9c784481f422/pkg/proc/gdbserial/gdbserver_conn.go#L1185
aarzilli: `--log-output=gdbwire`?
polinasok: Should this be checking for EOF and other things to set exited?
https://github.com/go-delve/delve/blob/f0a32c8e1b6571c8c1cd4ed89dcb9c784481f422/pkg/proc/gdbserial/gdbserver.go#L816-L820?
polinasok: > --log-output=gdbwire
```
$ ./dlv debug --listen=:54321 --log --log-output=gdbwire --headless=true _fixtures/issue419.go
API server listening at: [::]:54321
2021-07-08T11:17:02-07:00 debug layer=gdbconn executing /Library/Developer/CommandLineTools/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/debugserver [--stdin-path /dev/stdin --stdout-path /dev/stdout --stderr-path /dev/stderr -F -R 127.0.0.1:53259 -- /Users/polina/delve/__debug_bin]
debugserver-@(#)PROGRAM:LLDB  PROJECT:lldb-1205.0.27
 for x86_64.
Got a connection, launched process /Users/polina/delve/__debug_bin (pid = 9119).
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- +
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $QStartNoAckMode#b0
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> +
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $OK#9a
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- +
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $QThreadSuffixSupported#e4
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $OK#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qSupported:swbreak+;hwbreak+;no-resumed+;xmlRegisters=i386#c5
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $qXfer:features:read+;PacketSize=20000;qEcho+#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo0#72
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:rax;bitsize:64;offset:0;encoding:uint;format:hex;set:General Purpose Registers;ehframe:0;dwarf:0;invalidate-regs:0...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo1#73
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:rbx;bitsize:64;offset:8;encoding:uint;format:hex;set:General Purpose Registers;ehframe:3;dwarf:3;invalidate-regs:1...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo2#74
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:rcx;alt-name:arg4;bitsize:64;offset:16;encoding:uint;format:hex;set:General Purpose Registers;ehframe:2;dwarf:2;ge...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo3#75
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:rdx;alt-name:arg3;bitsize:64;offset:24;encoding:uint;format:hex;set:General Purpose Registers;ehframe:1;dwarf:1;ge...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo4#76
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:rdi;alt-name:arg1;bitsize:64;offset:32;encoding:uint;format:hex;set:General Purpose Registers;ehframe:5;dwarf:5;ge...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo5#77
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:rsi;alt-name:arg2;bitsize:64;offset:40;encoding:uint;format:hex;set:General Purpose Registers;ehframe:4;dwarf:4;ge...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo6#78
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:rbp;alt-name:fp;bitsize:64;offset:48;encoding:uint;format:hex;set:General Purpose Registers;ehframe:6;dwarf:6;gene...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo7#79
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:rsp;alt-name:sp;bitsize:64;offset:56;encoding:uint;format:hex;set:General Purpose Registers;ehframe:7;dwarf:7;gene...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo8#7a
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r8;alt-name:arg5;bitsize:64;offset:64;encoding:uint;format:hex;set:General Purpose Registers;ehframe:8;dwarf:8;gen...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo9#7b
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r9;alt-name:arg6;bitsize:64;offset:72;encoding:uint;format:hex;set:General Purpose Registers;ehframe:9;dwarf:9;gen...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfoa#a3
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r10;bitsize:64;offset:80;encoding:uint;format:hex;set:General Purpose Registers;ehframe:10;dwarf:10;invalidate-reg...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfob#a4
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r11;bitsize:64;offset:88;encoding:uint;format:hex;set:General Purpose Registers;ehframe:11;dwarf:11;invalidate-reg...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfoc#a5
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r12;bitsize:64;offset:96;encoding:uint;format:hex;set:General Purpose Registers;ehframe:12;dwarf:12;invalidate-reg...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfod#a6
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r13;bitsize:64;offset:104;encoding:uint;format:hex;set:General Purpose Registers;ehframe:13;dwarf:13;invalidate-re...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfoe#a7
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r14;bitsize:64;offset:112;encoding:uint;format:hex;set:General Purpose Registers;ehframe:14;dwarf:14;invalidate-re...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfof#a8
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r15;bitsize:64;offset:120;encoding:uint;format:hex;set:General Purpose Registers;ehframe:15;dwarf:15;invalidate-re...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo10#a3
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:rip;alt-name:pc;bitsize:64;offset:128;encoding:uint;format:hex;set:General Purpose Registers;ehframe:16;dwarf:16;g...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo11#a4
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:rflags;alt-name:flags;bitsize:64;offset:136;encoding:uint;format:hex;set:General Purpose Registers;generic:flags;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo12#a5
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:cs;bitsize:64;offset:144;encoding:uint;format:hex;set:General Purpose Registers;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo13#a6
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:fs;bitsize:64;offset:152;encoding:uint;format:hex;set:General Purpose Registers;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo14#a7
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:gs;bitsize:64;offset:160;encoding:uint;format:hex;set:General Purpose Registers;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo15#a8
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:eax;bitsize:32;offset:0;encoding:uint;format:hex;set:General Purpose Registers;container-regs:0;invalidate-regs:0,...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo16#a9
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:ebx;bitsize:32;offset:8;encoding:uint;format:hex;set:General Purpose Registers;container-regs:1;invalidate-regs:1,...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo17#aa
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:ecx;bitsize:32;offset:16;encoding:uint;format:hex;set:General Purpose Registers;container-regs:2;invalidate-regs:2...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo18#ab
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:edx;bitsize:32;offset:24;encoding:uint;format:hex;set:General Purpose Registers;container-regs:3;invalidate-regs:3...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo19#ac
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:edi;bitsize:32;offset:32;encoding:uint;format:hex;set:General Purpose Registers;container-regs:4;invalidate-regs:4...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo1a#d4
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:esi;bitsize:32;offset:40;encoding:uint;format:hex;set:General Purpose Registers;container-regs:5;invalidate-regs:5...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo1b#d5
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:ebp;bitsize:32;offset:48;encoding:uint;format:hex;set:General Purpose Registers;container-regs:6;invalidate-regs:6...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo1c#d6
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:esp;bitsize:32;offset:56;encoding:uint;format:hex;set:General Purpose Registers;container-regs:7;invalidate-regs:7...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo1d#d7
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r8d;bitsize:32;offset:64;encoding:uint;format:hex;set:General Purpose Registers;container-regs:8;invalidate-regs:8...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo1e#d8
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r9d;bitsize:32;offset:72;encoding:uint;format:hex;set:General Purpose Registers;container-regs:9;invalidate-regs:9...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo1f#d9
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r10d;bitsize:32;offset:80;encoding:uint;format:hex;set:General Purpose Registers;container-regs:a;invalidate-regs:...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo20#a4
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r11d;bitsize:32;offset:88;encoding:uint;format:hex;set:General Purpose Registers;container-regs:b;invalidate-regs:...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo21#a5
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r12d;bitsize:32;offset:96;encoding:uint;format:hex;set:General Purpose Registers;container-regs:c;invalidate-regs:...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo22#a6
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r13d;bitsize:32;offset:104;encoding:uint;format:hex;set:General Purpose Registers;container-regs:d;invalidate-regs...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo23#a7
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r14d;bitsize:32;offset:112;encoding:uint;format:hex;set:General Purpose Registers;container-regs:e;invalidate-regs...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo24#a8
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r15d;bitsize:32;offset:120;encoding:uint;format:hex;set:General Purpose Registers;container-regs:f;invalidate-regs...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo25#a9
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:ax;bitsize:16;offset:0;encoding:uint;format:hex;set:General Purpose Registers;container-regs:0;invalidate-regs:0,1...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo26#aa
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:bx;bitsize:16;offset:8;encoding:uint;format:hex;set:General Purpose Registers;container-regs:1;invalidate-regs:1,1...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo27#ab
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:cx;bitsize:16;offset:16;encoding:uint;format:hex;set:General Purpose Registers;container-regs:2;invalidate-regs:2,...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo28#ac
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:dx;bitsize:16;offset:24;encoding:uint;format:hex;set:General Purpose Registers;container-regs:3;invalidate-regs:3,...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo29#ad
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:di;bitsize:16;offset:32;encoding:uint;format:hex;set:General Purpose Registers;container-regs:4;invalidate-regs:4,...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo2a#d5
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:si;bitsize:16;offset:40;encoding:uint;format:hex;set:General Purpose Registers;container-regs:5;invalidate-regs:5,...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo2b#d6
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:bp;bitsize:16;offset:48;encoding:uint;format:hex;set:General Purpose Registers;container-regs:6;invalidate-regs:6,...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo2c#d7
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:sp;bitsize:16;offset:56;encoding:uint;format:hex;set:General Purpose Registers;container-regs:7;invalidate-regs:7,...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo2d#d8
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r8w;bitsize:16;offset:64;encoding:uint;format:hex;set:General Purpose Registers;container-regs:8;invalidate-regs:8...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo2e#d9
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r9w;bitsize:16;offset:72;encoding:uint;format:hex;set:General Purpose Registers;container-regs:9;invalidate-regs:9...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo2f#da
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r10w;bitsize:16;offset:80;encoding:uint;format:hex;set:General Purpose Registers;container-regs:a;invalidate-regs:...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo30#a5
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r11w;bitsize:16;offset:88;encoding:uint;format:hex;set:General Purpose Registers;container-regs:b;invalidate-regs:...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo31#a6
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r12w;bitsize:16;offset:96;encoding:uint;format:hex;set:General Purpose Registers;container-regs:c;invalidate-regs:...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo32#a7
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r13w;bitsize:16;offset:104;encoding:uint;format:hex;set:General Purpose Registers;container-regs:d;invalidate-regs...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo33#a8
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r14w;bitsize:16;offset:112;encoding:uint;format:hex;set:General Purpose Registers;container-regs:e;invalidate-regs...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo34#a9
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r15w;bitsize:16;offset:120;encoding:uint;format:hex;set:General Purpose Registers;container-regs:f;invalidate-regs...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo35#aa
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:ah;bitsize:8;offset:1;encoding:uint;format:hex;set:General Purpose Registers;container-regs:0;invalidate-regs:0,15...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo36#ab
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:bh;bitsize:8;offset:9;encoding:uint;format:hex;set:General Purpose Registers;container-regs:1;invalidate-regs:1,16...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo37#ac
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:ch;bitsize:8;offset:17;encoding:uint;format:hex;set:General Purpose Registers;container-regs:2;invalidate-regs:2,1...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo38#ad
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:dh;bitsize:8;offset:25;encoding:uint;format:hex;set:General Purpose Registers;container-regs:3;invalidate-regs:3,1...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo39#ae
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:al;bitsize:8;offset:0;encoding:uint;format:hex;set:General Purpose Registers;container-regs:0;invalidate-regs:0,15...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo3a#d6
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:bl;bitsize:8;offset:8;encoding:uint;format:hex;set:General Purpose Registers;container-regs:1;invalidate-regs:1,16...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo3b#d7
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:cl;bitsize:8;offset:16;encoding:uint;format:hex;set:General Purpose Registers;container-regs:2;invalidate-regs:2,1...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo3c#d8
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:dl;bitsize:8;offset:24;encoding:uint;format:hex;set:General Purpose Registers;container-regs:3;invalidate-regs:3,1...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo3d#d9
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:dil;bitsize:8;offset:32;encoding:uint;format:hex;set:General Purpose Registers;container-regs:4;invalidate-regs:4,...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo3e#da
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:sil;bitsize:8;offset:40;encoding:uint;format:hex;set:General Purpose Registers;container-regs:5;invalidate-regs:5,...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo3f#db
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:bpl;bitsize:8;offset:48;encoding:uint;format:hex;set:General Purpose Registers;container-regs:6;invalidate-regs:6,...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo40#a6
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:spl;bitsize:8;offset:56;encoding:uint;format:hex;set:General Purpose Registers;container-regs:7;invalidate-regs:7,...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo41#a7
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r8l;bitsize:8;offset:64;encoding:uint;format:hex;set:General Purpose Registers;container-regs:8;invalidate-regs:8,...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo42#a8
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r9l;bitsize:8;offset:72;encoding:uint;format:hex;set:General Purpose Registers;container-regs:9;invalidate-regs:9,...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo43#a9
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r10l;bitsize:8;offset:80;encoding:uint;format:hex;set:General Purpose Registers;container-regs:a;invalidate-regs:a...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo44#aa
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r11l;bitsize:8;offset:88;encoding:uint;format:hex;set:General Purpose Registers;container-regs:b;invalidate-regs:b...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo45#ab
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r12l;bitsize:8;offset:96;encoding:uint;format:hex;set:General Purpose Registers;container-regs:c;invalidate-regs:c...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo46#ac
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r13l;bitsize:8;offset:104;encoding:uint;format:hex;set:General Purpose Registers;container-regs:d;invalidate-regs:...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo47#ad
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r14l;bitsize:8;offset:112;encoding:uint;format:hex;set:General Purpose Registers;container-regs:e;invalidate-regs:...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo48#ae
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:r15l;bitsize:8;offset:120;encoding:uint;format:hex;set:General Purpose Registers;container-regs:f;invalidate-regs:...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo49#af
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:fctrl;bitsize:16;offset:168;encoding:uint;format:hex;set:Floating Point Registers;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo4a#d7
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:fstat;bitsize:16;offset:170;encoding:uint;format:hex;set:Floating Point Registers;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo4b#d8
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:ftag;bitsize:16;offset:172;encoding:uint;format:hex;set:Floating Point Registers;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo4c#d9
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:fop;bitsize:16;offset:174;encoding:uint;format:hex;set:Floating Point Registers;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo4d#da
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:fioff;bitsize:32;offset:176;encoding:uint;format:hex;set:Floating Point Registers;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo4e#db
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:fiseg;bitsize:16;offset:180;encoding:uint;format:hex;set:Floating Point Registers;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo4f#dc
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:fooff;bitsize:32;offset:182;encoding:uint;format:hex;set:Floating Point Registers;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo50#a7
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:foseg;bitsize:16;offset:186;encoding:uint;format:hex;set:Floating Point Registers;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo51#a8
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:mxcsr;bitsize:32;offset:188;encoding:uint;format:hex;set:Floating Point Registers;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo52#a9
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:mxcsrmask;bitsize:32;offset:192;encoding:uint;format:hex;set:Floating Point Registers;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo53#aa
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:stmm0;bitsize:80;offset:196;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:33;dwarf:33;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo54#ab
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:stmm1;bitsize:80;offset:206;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:34;dwarf:34;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo55#ac
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:stmm2;bitsize:80;offset:216;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:35;dwarf:35;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo56#ad
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:stmm3;bitsize:80;offset:226;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:36;dwarf:36;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo57#ae
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:stmm4;bitsize:80;offset:236;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:37;dwarf:37;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo58#af
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:stmm5;bitsize:80;offset:246;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:38;dwarf:38;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo59#b0
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:stmm6;bitsize:80;offset:256;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:39;dwarf:39;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo5a#d8
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:stmm7;bitsize:80;offset:266;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:40;dwarf:40;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo5b#d9
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:ymm0;bitsize:256;offset:276;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:17;dwarf:17;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo5c#da
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:ymm1;bitsize:256;offset:308;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:18;dwarf:18;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo5d#db
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:ymm2;bitsize:256;offset:340;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:19;dwarf:19;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo5e#dc
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:ymm3;bitsize:256;offset:372;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:20;dwarf:20;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo5f#dd
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:ymm4;bitsize:256;offset:404;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:21;dwarf:21;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo60#a8
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:ymm5;bitsize:256;offset:436;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:22;dwarf:22;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo61#a9
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:ymm6;bitsize:256;offset:468;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:23;dwarf:23;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo62#aa
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:ymm7;bitsize:256;offset:500;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:24;dwarf:24;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo63#ab
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:ymm8;bitsize:256;offset:532;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:25;dwarf:25;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo64#ac
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:ymm9;bitsize:256;offset:564;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:26;dwarf:26;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo65#ad
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:ymm10;bitsize:256;offset:596;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:27;dwarf:27;...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo66#ae
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:ymm11;bitsize:256;offset:628;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:28;dwarf:28;...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo67#af
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:ymm12;bitsize:256;offset:660;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:29;dwarf:29;...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo68#b0
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:ymm13;bitsize:256;offset:692;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:30;dwarf:30;...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo69#b1
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:ymm14;bitsize:256;offset:724;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:31;dwarf:31;...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo6a#d9
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:ymm15;bitsize:256;offset:756;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:32;dwarf:32;...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo6b#da
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:xmm0;bitsize:128;offset:276;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:17;dwarf:17;c...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo6c#db
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:xmm1;bitsize:128;offset:308;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:18;dwarf:18;c...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo6d#dc
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:xmm2;bitsize:128;offset:340;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:19;dwarf:19;c...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo6e#dd
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:xmm3;bitsize:128;offset:372;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:20;dwarf:20;c...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo6f#de
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:xmm4;bitsize:128;offset:404;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:21;dwarf:21;c...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo70#a9
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:xmm5;bitsize:128;offset:436;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:22;dwarf:22;c...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo71#aa
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:xmm6;bitsize:128;offset:468;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:23;dwarf:23;c...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo72#ab
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:xmm7;bitsize:128;offset:500;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:24;dwarf:24;c...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo73#ac
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:xmm8;bitsize:128;offset:532;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:25;dwarf:25;c...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo74#ad
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:xmm9;bitsize:128;offset:564;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:26;dwarf:26;c...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo75#ae
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:xmm10;bitsize:128;offset:596;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:27;dwarf:27;...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo76#af
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:xmm11;bitsize:128;offset:628;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:28;dwarf:28;...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo77#b0
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:xmm12;bitsize:128;offset:660;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:29;dwarf:29;...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo78#b1
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:xmm13;bitsize:128;offset:692;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:30;dwarf:30;...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo79#b2
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:xmm14;bitsize:128;offset:724;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:31;dwarf:31;...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo7a#da
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:xmm15;bitsize:128;offset:756;encoding:vector;format:vector-uint8;set:Floating Point Registers;ehframe:32;dwarf:32;...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo7b#db
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:trapno;bitsize:32;offset:788;encoding:uint;format:hex;set:Exception State Registers;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo7c#dc
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:err;bitsize:32;offset:792;encoding:uint;format:hex;set:Exception State Registers;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo7d#dd
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $name:faultvaddr;bitsize:64;offset:796;encoding:uint;format:hex;set:Exception State Registers;#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qRegisterInfo7e#de
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $E45#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $QListThreadsInStopReply#21
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $OK#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $x0,0#04
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $OK#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qfThreadInfo#bb
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $m94b851#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qsThreadInfo#c8
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $l#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qThreadStopInfo94b851#68
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $T11thread:94b851;threads:94b851;thread-pcs:cef0000;00:0000000000000000;01:0000000000000000;02:0000000000000000;03:00000...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qProcessInfo#dc
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $pid:239f;parent-pid:239e;real-uid:1e3f;real-gid:15f53;effective-uid:1e3f;effective-gid:15f53;cputype:1000007;cpusubtype...
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $qXfer:auxv:read::0,fff#dc
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> "$#"00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p0;thread:94b851;#35
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p1;thread:94b851;#36
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p2;thread:94b851;#37
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p3;thread:94b851;#38
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p4;thread:94b851;#39
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p5;thread:94b851;#3a
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p6;thread:94b851;#3b
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p7;thread:94b851;#3c
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $38fabfeffe7f0000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p8;thread:94b851;#3d
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p9;thread:94b851;#3e
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $pa;thread:94b851;#66
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $pb;thread:94b851;#67
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $pc;thread:94b851;#68
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $pd;thread:94b851;#69
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $pe;thread:94b851;#6a
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $pf;thread:94b851;#6b
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p10;thread:94b851;#66
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000ef0c00000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p11;thread:94b851;#67
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0002000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p12;thread:94b851;#68
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $2b00000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p13;thread:94b851;#69
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p14;thread:94b851;#6a
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p49;thread:94b851;#72
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $7f03#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p4a;thread:94b851;#9a
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p4b;thread:94b851;#9b
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p4c;thread:94b851;#9c
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p4d;thread:94b851;#9d
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $00000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p4e;thread:94b851;#9e
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p4f;thread:94b851;#9f
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $00000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p50;thread:94b851;#6a
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p51;thread:94b851;#6b
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $801f0000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p52;thread:94b851;#6c
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $ffff0000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p53;thread:94b851;#6d
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000ffff#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p54;thread:94b851;#6e
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $00000000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p55;thread:94b851;#6f
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $00000000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p56;thread:94b851;#70
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $00000000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p57;thread:94b851;#71
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $00000000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p58;thread:94b851;#72
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000ffff#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p59;thread:94b851;#73
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $1733330100000000ffff#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p5a;thread:94b851;#9b
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $d0f3ffff00000000ffff#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p5b;thread:94b851;#9c
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000000000000000000000000000000000000000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p5c;thread:94b851;#9d
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000000000000000000000000000000000000000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p5d;thread:94b851;#9e
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000000000000000000000000000000000000000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p5e;thread:94b851;#9f
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000000000000000000000000000000000000000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p5f;thread:94b851;#a0
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000000000000000000000000000000000000000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p60;thread:94b851;#6b
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000000000000000000000000000000000000000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p61;thread:94b851;#6c
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000000000000000000000000000000000000000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p62;thread:94b851;#6d
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000000000000000000000000000000000000000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p63;thread:94b851;#6e
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000000000000000000000000000000000000000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p64;thread:94b851;#6f
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000000000000000000000000000000000000000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p65;thread:94b851;#70
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000000000000000000000000000000000000000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p66;thread:94b851;#71
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000000000000000000000000000000000000000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p67;thread:94b851;#72
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000000000000000000000000000000000000000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p68;thread:94b851;#73
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000000000000000000000000000000000000000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p69;thread:94b851;#74
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000000000000000000000000000000000000000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p6a;thread:94b851;#9c
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000000000000000000000000000000000000000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p7b;thread:94b851;#9e
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $00000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p7c;thread:94b851;#9f
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $00000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $p7d;thread:94b851;#a0
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $0000000000000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $Z0,1033fb0,1#d2
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $OK#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $Z0,1033f40,1#a4
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $OK#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $m11cf344,4#93
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $00000000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $M11cf344,4:01000000#2e
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $OK#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $_M100,rwx#ca
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $11f5000#00
2021-07-08T11:17:02-07:00 debug layer=gdbconn <- $M11f5000,9:65488b0c2530000000#67
2021-07-08T11:17:02-07:00 debug layer=gdbconn -> $OK#00
2021-07-08T11:17:09-07:00 debug layer=gdbconn <- $vCont;c#a8
Start
^CReceive signal interrupt 
End
2021-07-08T11:17:47-07:00 debug layer=gdbconn <- $k#6b
$ 
```

aarzilli: > Should this be checking for EOF and other things to set exited?

I would say no. If debugserver terminates without returning then it is an error and the target process state is unknown. I think what's happening is that debugserver receives the ^C and dies, instead of letting the target process receive it. I don't know if there is a way to avoid this (I don't see it). If that's the case then it is correct that exited is set to false and the EOF error should be surfaced instead. I'm not sure what's setting the stop reason to StopExited, that's probably the bug.
polinasok: > > Should this be checking for EOF and other things to set exited?
> 
> I would say no. If debugserver terminates without returning then it is an error and the target process state is unknown. I think what's happening is that debugserver receives the ^C and dies, instead of letting the target process receive it. I don't know if there is a way to avoid this (I don't see it). If that's the case then it is correct that exited is set to false and the EOF error should be surfaced instead. I'm not sure what's setting the stop reason to StopExited, that's probably the bug.

But the target process unblocks waiting for signal and prints messages afterwards, so doesn't that mean that it received the signal? Of course, the debugserver might still be disconnecting even if that happens, so it would not know either way what the target was doing.

I guess this StopExited should be StopUnknown then.
aarzilli: > But the target process unblocks waiting for signal and prints messages afterwards, so doesn't that mean that it received the signal? Of course, the debugserver might still be disconnecting even if that happens, so it would not know either way what the target was doing.

I think both received it because both are in the same process group.

> I guess this StopExited should be StopUnknown then.

Yes, we should only return StopExited in that `if` when we set p.exited to true. The way it is now is an error.
polinasok: > > I guess this StopExited should be StopUnknown then.
> 
> Yes, we should only return StopExited in that `if` when we set p.exited to true. The way it is now is an error.

Like this? https://github.com/go-delve/delve/pull/2577
aarzilli: > Like this? #2577

Yes.
polinasok: I have modified this PR not to treat this case as Exited. There was a issue in how we handled the error handling that resulted in the UI not changing from RUNNING to PAUSED, so this PR is now focusing on handling such errors correctly.
polinasok: @aarzilli Does EOF always mean dead debug server?
I am wondering if we should be explicitly detecting when the backend is not longer usable and sending a [TerminatedEvent](https://microsoft.github.io/debug-adapter-protocol/specification#Events_Terminated) to indicate that "debugging of the debuggee has terminated" and set off the shutdown sequence. Or if it is better to just express this as a stop with details and let the user disconnect?
@suzmue 
aarzilli: > @aarzilli Does EOF always mean dead debug server?

I think so. 

> I am wondering if we should be explicitly detecting when the backend is not longer usable and sending a TerminatedEvent to indicate that "debugging of the debuggee has terminated" and set off the shutdown sequence

I wouldn't make it look like the target process terminated, because that might not be the case.
polinasok: > > @aarzilli Does EOF always mean dead debug server?
> 
> I think so.
> 
> > I am wondering if we should be explicitly detecting when the backend is no longer usable and sending a TerminatedEvent to indicate that "debugging of the debuggee has terminated" and set off the shutdown sequence
> 
> I wouldn't make it look like the target process terminated, because that might not be the case.

From the spec: [TerminatedEvent](https://microsoft.github.io/debug-adapter-protocol/specification#Events_Terminated) means "debugging of the debuggee has terminated. This does *not* mean that the debuggee itself has exited". This would just be a shortcut for disconnecting after an unrecoverable error, so the user doesn't have to click on the disconnect button manually. 

We have two options:
(1) Stopped event with reason "error" (or "unrecoverable error") showing up under Call Stack with hover text with more details and/or additional details printed to the Debug Console. Then the user has to click disconnect.
(2) Terminated event, which triggers automatic debug session disconnect. Call Stack pane will be cleared of any information. But we can still print error details to the Debug Console.

@hyangah 


Patch:
diff --git a/service/dap/server.go b/service/dap/server.go
index 34c8a579..4a5d5b68 100644
--- a/service/dap/server.go
+++ b/service/dap/server.go
@@ -772,11 +772,9 @@ func (s *Server) onLaunchRequest(request *dap.LaunchRequest) {
 		return
 	}
 
-
 	if mode == "replay" {
 		traceDirPath, _ := request.Arguments["traceDirPath"].(string)
 
-
 		// Validate trace directory
 		if traceDirPath == "" {
 			s.sendErrorResponse(request.Request,
@@ -785,10 +783,6 @@ func (s *Server) onLaunchRequest(request *dap.LaunchRequest) {
 			return
 		}
 
-
-
-
-
 		// Assign the rr trace directory path to debugger configuration
 		s.config.Debugger.CoreFile = traceDirPath
 		s.config.Debugger.Backend = "rr"
@@ -797,7 +791,6 @@ func (s *Server) onLaunchRequest(request *dap.LaunchRequest) {
 	if mode == "core" {
 		coreFilePath, _ := request.Arguments["coreFilePath"].(string)
 
-
 		// Validate core dump path
 		if coreFilePath == "" {
 
@@ -807,7 +800,6 @@ func (s *Server) onLaunchRequest(request *dap.LaunchRequest) {
 			return
 		}
 
-
 		// Assign the non-empty core file path to debugger configuration. This will
 		// trigger a native core file replay instead of an rr trace replay
 		s.config.Debugger.CoreFile = coreFilePath
@@ -815,7 +807,7 @@ func (s *Server) onLaunchRequest(request *dap.LaunchRequest) {
 	}
 
 	s.log.Debugf("debug backend is '%s'", s.config.Debugger.Backend)
-	
+
 	// Prepare the debug executable filename, build flags and build it
 	if mode == "debug" || mode == "test" {
 		output, ok := request.Arguments["output"].(string)
@@ -970,7 +962,7 @@ func (s *Server) onLaunchRequest(request *dap.LaunchRequest) {
 	}
 	// Enable StepBack controls on supported backends
 	if s.config.Debugger.Backend == "rr" {
-		s.send(&dap.CapabilitiesEvent{ Event: *newEvent("capabilities"), Body: dap.CapabilitiesEventBody{Capabilities: dap.Capabilities{ SupportsStepBack: true }}})
+		s.send(&dap.CapabilitiesEvent{Event: *newEvent("capabilities"), Body: dap.CapabilitiesEventBody{Capabilities: dap.Capabilities{SupportsStepBack: true}}})
 	}
 
 	// Notify the client that the debugger is ready to start accepting
@@ -1126,7 +1118,7 @@ func (s *Server) stopDebugSession(killProcess bool) error {
 			s.logToConsole(exited.Error())
 			err = nil
 		default:
-			s.log.Error(err)
+			s.log.Error("detach returned error: ", err)
 		}
 	}
 	return err
@@ -1452,49 +1444,53 @@ func fnPackageName(loc *proc.Location) string {
 // onThreadsRequest handles 'threads' request.
 // This is a mandatory request to support.
 // It is sent in response to configurationDone response and stopped events.
+// Depending on the debug session stage, goroutines information
+// might not be available. However, the DAP spec states that
+// "even if a debug adapter does not support multiple threads,
+// it must implement the threads request and return a single
+// (dummy) thread". Therefore, this handler never returns
+// an error response. If the dummy thread is returned in its place,
+// the next waterfall request for its stackTrace will return the error.
 func (s *Server) onThreadsRequest(request *dap.ThreadsRequest) {
-	if s.debugger == nil {
-		s.sendErrorResponse(request.Request, UnableToDisplayThreads, "Unable to display threads", "debugger is nil")
-		return
+	var err error
+	var gs []*proc.G
+	var next int
+	if s.debugger != nil {
+		gs, next, err = s.debugger.Goroutines(0, maxGoroutines)
 	}
+	threads := make([]dap.Thread, len(gs))
 
-	gs, next, err := s.debugger.Goroutines(0, maxGoroutines)
 	if err != nil {
 		switch err.(type) {
 		case proc.ErrProcessExited:
 			// If the program exits very quickly, the initial threads request will complete after it has exited.
 			// A TerminatedEvent has already been sent. Ignore the err returned in this case.
-			s.send(&dap.ThreadsResponse{Response: *newResponse(request.Request)})
+			s.log.Debug(err)
 		default:
-			s.sendErrorResponse(request.Request, UnableToDisplayThreads, "Unable to display threads", err.Error())
+			s.send(&dap.OutputEvent{
+				Event: *newEvent("output"),
+				Body: dap.OutputEventBody{
+					Output:   fmt.Sprintf("Unable to retrieve goroutines: %s\n", err.Error()),
+					Category: "stderr",
+				}})
 		}
-		return
-	}
-
-	if next >= 0 {
-		s.logToConsole(fmt.Sprintf("too many goroutines, only loaded %d", len(gs)))
-	}
-
-	threads := make([]dap.Thread, len(gs))
-	if len(threads) == 0 {
-		// Depending on the debug session stage, goroutines information
-		// might not be available. However, the DAP spec states that
-		// "even if a debug adapter does not support multiple threads,
-		// it must implement the threads request and return a single
-		// (dummy) thread".
+		threads = []dap.Thread{{Id: 1, Name: "Dummy"}}
+	} else if len(threads) == 0 {
 		threads = []dap.Thread{{Id: 1, Name: "Dummy"}}
 	} else {
+		if next >= 0 {
+			s.logToConsole(fmt.Sprintf("too many goroutines, only loaded %d", len(gs)))
+		}
 		state, err := s.debugger.State( /*nowait*/ true)
 		if err != nil {
-			s.sendErrorResponse(request.Request, UnableToDisplayThreads, "Unable to display threads", err.Error())
-			return
+			s.log.Debug("Unable to get debugger state: ", err)
 		}
 		s.debugger.LockTarget()
 		defer s.debugger.UnlockTarget()
 
 		for i, g := range gs {
 			selected := ""
-			if state.SelectedGoroutine != nil && g.ID == state.SelectedGoroutine.ID {
+			if state != nil && state.SelectedGoroutine != nil && g.ID == state.SelectedGoroutine.ID {
 				selected = "* "
 			}
 			thread := ""
@@ -1674,6 +1670,11 @@ type stackFrame struct {
 // As per DAP spec, this request only gets triggered as a follow-up
 // to a successful threads request as part of the "request waterfall".
 func (s *Server) onStackTraceRequest(request *dap.StackTraceRequest) {
+	if s.debugger == nil {
+		s.sendErrorResponse(request.Request, UnableToProduceStackTrace, "Unable to produce stack trace", "debugger is nil")
+		return
+	}
+
 	goroutineID := request.Arguments.ThreadId
 	frames, err := s.debugger.Stacktrace(goroutineID, s.args.stackTraceDepth, 0)
 	if err != nil {
@@ -2392,7 +2393,7 @@ func (s *Server) doCall(goid, frame int, expr string) (*api.DebuggerState, []*pr
 		UnsafeCall:           false,
 		GoroutineID:          goid,
 	}, nil)
-	if _, isexited := err.(proc.ErrProcessExited); isexited || err == nil && state.Exited {
+	if processExited(state, err) {
 		e := &dap.TerminatedEvent{Event: *newEvent("terminated")}
 		s.send(e)
 		return nil, nil, errors.New("terminated")
@@ -2825,6 +2826,11 @@ func (s *Server) resetHandlesForStoppedEvent() {
 	s.exceptionErr = nil
 }
 
+func processExited(state *api.DebuggerState, err error) bool {
+	_, isexited := err.(proc.ErrProcessExited)
+	return isexited || err == nil && state.Exited
+}
+
 // doRunCommand runs a debugger command until it stops on
 // termination, error, breakpoint, etc, when an appropriate
 // event needs to be sent to the client. asyncSetupDone is
@@ -2837,7 +2843,7 @@ func (s *Server) doRunCommand(command string, asyncSetupDone chan struct{}) {
 	// So we should always close it ourselves just in case.
 	defer s.asyncCommandDone(asyncSetupDone)
 	state, err := s.debugger.Command(&api.DebuggerCommand{Name: command}, asyncSetupDone)
-	if _, isexited := err.(proc.ErrProcessExited); isexited || err == nil && state.Exited {
+	if processExited(state, err) {
 		s.send(&dap.TerminatedEvent{Event: *newEvent("terminated")})
 		return
 	}
@@ -2929,4 +2935,4 @@ func (s *Server) toServerPath(path string) string {
 		s.log.Debugf("client path=%s converted to server path=%s\n", path, serverPath)
 	}
 	return serverPath
-}
\ No newline at end of file
+}


Test patch:
diff --git a/service/dap/server_test.go b/service/dap/server_test.go
index e1c0d93b..63422f38 100644
--- a/service/dap/server_test.go
+++ b/service/dap/server_test.go
@@ -438,8 +438,11 @@ func TestContinueOnEntry(t *testing.T) {
 		// 7 >> threads, << threads
 		client.ThreadsRequest()
 		tResp := client.ExpectThreadsResponse(t)
-		if tResp.Seq != 0 || tResp.RequestSeq != 7 || len(tResp.Body.Threads) != 0 {
-			t.Errorf("\ngot %#v\nwant Seq=0, RequestSeq=7 len(Threads)=0", tResp)
+		if tResp.Seq != 0 || tResp.RequestSeq != 7 || len(tResp.Body.Threads) != 1 {
+			t.Errorf("\ngot %#v\nwant Seq=0, RequestSeq=7 len(Threads)=1", tResp)
+		}
+		if tResp.Body.Threads[0].Id != 1 || tResp.Body.Threads[0].Name != "Dummy" {
+			t.Errorf("\ngot %#v\nwant Id=1, Name=\"Dummy\"", tResp)
 		}
 
 		// 8 >> disconnect, << disconnect