[all-commits] [llvm/llvm-project] 2a7524: [lldb][Windows] Support OutputDebugString (#196395)

Nerixyz via All-commits all-commits at lists.llvm.org
Tue Jun 2 06:08:21 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2a7524b4e33c8dfd667fa28341ec7c6c529d9c50
      https://github.com/llvm/llvm-project/commit/2a7524b4e33c8dfd667fa28341ec7c6c529d9c50
  Author: Nerixyz <nerixdev at outlook.de>
  Date:   2026-06-02 (Tue, 02 Jun 2026)

  Changed paths:
    M lldb/source/Plugins/Process/Windows/Common/DebuggerThread.cpp
    M lldb/source/Plugins/Process/Windows/Common/IDebugDelegate.h
    M lldb/source/Plugins/Process/Windows/Common/LocalDebugDelegate.cpp
    M lldb/source/Plugins/Process/Windows/Common/LocalDebugDelegate.h
    M lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.h
    M lldb/source/Plugins/Process/Windows/Common/ProcessDebugger.cpp
    M lldb/source/Plugins/Process/Windows/Common/ProcessDebugger.h
    M lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
    M lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h
    A lldb/test/Shell/Process/Windows/output_debug_string.cpp
    M llvm/docs/ReleaseNotes.md

  Log Message:
  -----------
  [lldb][Windows] Support OutputDebugString (#196395)

This picks https://reviews.llvm.org/D128541 back up. It implements
support for `OutputDebugStringA/W` on Windows. It's used by some logging
systems.

The main changes since the original patch:
- Use `WaitForDebugEventEx` for getting debug events over
`WaitForDebugEvent`. According to the
[docs](https://learn.microsoft.com/en-us/windows/win32/api/debugapi/nf-debugapi-waitfordebugeventex),
the only difference is that the -Ex version correctly outputs Unicode
strings.
- Support strings longer than 64 KiB. I set an arbitrary limit of 1 MiB
for the strings we read. The debugger interface only tells us the length
modulo 64 KiB which is a bit awkward. Libraries like Qt already chunk
calls to `OutputDebugString`, so strings shouldn't be too big in
practice.
- Output to stdout instead of a log channel, so the output is always
enabled. I don't know if this should go to stdout or stderr.

Tested that it works with lldb-dap and shows up in the debug console in
all modes.

Closes #185891.

---------

Co-authored-by: Alvin Wong <alvin at alvinhc.com>



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