[lldb-dap] Fix core file stop reason overridden to "entry" (#195352)
# Summary:
There's a behavior change on core file stop reason
It used to report the actual crash (stop) reason:
- reason: "exception" (reflecting the actual crash signal/exception)
- description: crash signals, eg."signal SIGSEGV"
However, the stopped event now always reports:
- reason: "entry"
- The crash reason is lost
## Root Cause
1. `bd0efcaa34b1` (Oct 31, 2025) — "[lldb-dap] Correctly trigger 'entry'
stop reasons"
This commit changed CreateThreadStopped in `JSONUtils.cpp`:
Changed `body.try_emplace("reason", "entry")` to `body["reason"] =
"entry"`, and this will overwrites it unconditionally.
2. `51e5b6c6acc0` (Feb 3, 2026) — "Migrating 'stopped' event to
structured types"
Rewrote the stopped event with an if/else that completely skips the stop
reason switch when on_entry=true:
```
if (on_entry) {
body.reason = eStoppedReasonEntry; // thread stop reason never inspected
} else { ... }
```
## The Underlying Design Issue
`stop_at_entry` serves double duty in AttachRequestHandler.cpp:40-41:
```
if (!args.coreFile.empty())
dap.stop_at_entry = true;
```
This flag both (a) `prevents process.Continue()` from being called
(correct for core files) and (b) tells `SendThreadStoppedEvent` to use
reason "entry" (wrong for core files — should report the actual crash
reason).
# Test Plan:
Added DAP test to check for stop reasons
Launch a coredump debug session with local build lldb-dap and observe
the stop reason
<img width="262" height="181" alt="image"
src="https://github.com/user-attachments/assets/077dced9-2f0a-477a-825f-3b60483a69d3"
/>