[all-commits] [llvm/llvm-project] c2e967: [lldb-dap] Ensure we do not print the close sentin...

John Harrison via All-commits all-commits at lists.llvm.org
Thu Feb 13 10:36:13 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c2e96778e04197dd266f7c540bf174b6ec28a434
      https://github.com/llvm/llvm-project/commit/c2e96778e04197dd266f7c540bf174b6ec28a434
  Author: John Harrison <harjohn at google.com>
  Date:   2025-02-13 (Thu, 13 Feb 2025)

  Changed paths:
    M lldb/test/API/tools/lldb-dap/output/TestDAP_output.py
    M lldb/test/API/tools/lldb-dap/output/main.c
    M lldb/tools/lldb-dap/OutputRedirector.cpp
    M lldb/tools/lldb-dap/OutputRedirector.h

  Log Message:
  -----------
  [lldb-dap] Ensure we do not print the close sentinel when closing stdout. (#126833)

If you have an lldb-dap log file you'll almost always see a final
message like:

```
<-- 
Content-Length: 94

{
  "body": {
    "category": "stdout",
    "output": "\u0000\u0000"
  },
  "event": "output",
  "seq": 0,
  "type": "event"
}
<-- 
Content-Length: 94

{
  "body": {
    "category": "stderr",
    "output": "\u0000\u0000"
  },
  "event": "output",
  "seq": 0,
  "type": "event"
}
```

The OutputRedirect is always writing the `"\0"` byte as a final stdout
message during shutdown. Instead, I adjusted this to detect the sentinel
value and break out of the read loop as if we detected EOF.

---------

Co-authored-by: Pavel Labath <pavel at labath.sk>



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