[all-commits] [llvm/llvm-project] 7a7efa: [lldb-dap] Fix core file stop reason overridden to...

Wanyi via All-commits all-commits at lists.llvm.org
Mon May 4 11:30:24 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7a7efa27f315e78ed9cadf3e967b1fc576b34b95
      https://github.com/llvm/llvm-project/commit/7a7efa27f315e78ed9cadf3e967b1fc576b34b95
  Author: Wanyi <wanyi at meta.com>
  Date:   2026-05-04 (Mon, 04 May 2026)

  Changed paths:
    M lldb/test/API/tools/lldb-dap/coreFile/TestDAP_coreFile.py
    M lldb/tools/lldb-dap/DAP.h
    M lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp
    M lldb/tools/lldb-dap/Handler/ConfigurationDoneRequestHandler.cpp

  Log Message:
  -----------
  [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"
/>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list