Debugger: DAP debugging threads request segfault
I am trying to set up cmake dap debugging in qt-creator. I faced one problem with that. When I tried to request a threads list after I'd got a "thread" event with reason "exited" I was getting the crash.
event: {"body":{"reason":"exited","threadId":1},"event":"thread","seq":14,"type":"event"})
request: "Content-Length: 47\r\n\r\n{\"command\":\"threads\",\"seq\":59,\"type\":\"request\"}"
And after that, I'm getting a crash.
The reason in the file cmake-3.27.0-rc3/Source/cmDebuggerAdapter.cxx:171 Probable solution wrap it into
if (DefaultThread) {
thread.id = DefaultThread->GetId();
thread.name = DefaultThread->GetName();
response.threads.push_back(thread);
}
Edited by Brad King