https://github.com/da-viper created 
https://github.com/llvm/llvm-project/pull/137002

Based on the DAP specification.
The output categories stdout and stderr should only be used for the debuggee's 
stdout and stderr.

```jsonc
 /**
     * The output category. If not specified or if the category is not
     * understood by the client, `console` is assumed.
     * Values:
     * 'console': Show the output in the client's default message UI, e.g. a
     * 'debug console'. This category should only be used for informational
     * output from the debugger (as opposed to the debuggee).
     * 'important': A hint for the client to show the output in the client's UI
     * for important and highly visible information, e.g. as a popup
     * notification. This category should only be used for important messages
     * from the debugger (as opposed to the debuggee). Since this category value
     * is a hint, clients might ignore the hint and assume the `console`
     * category.
     * 'stdout': Show the output as normal program output from the debuggee.
     * 'stderr': Show the output as error program output from the debuggee.
     * 'telemetry': Send the output to telemetry instead of showing it to the
     * user.
     * etc.
     */
    category?: 'console' | 'important' | 'stdout' | 'stderr' | 'telemetry' | 
string;
```
What I am not sure if error should use the important category ? 

>From 2011eeca7a49bf163324b18d75a8a1334eb4c9a1 Mon Sep 17 00:00:00 2001
From: Ebuka Ezike <yerimy...@gmail.com>
Date: Wed, 23 Apr 2025 15:49:01 +0100
Subject: [PATCH] [lldb][lldb-dap] Redirect LLDB's messages to the right output
 category.

Based on the DAP specification.
The output categories stdout and stderr should only be used for the debuggee's 
stdout and stderr.

Signed-off-by: Ebuka Ezike <yerimy...@gmail.com>
---
 lldb/tools/lldb-dap/DAP.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lldb/tools/lldb-dap/DAP.cpp b/lldb/tools/lldb-dap/DAP.cpp
index 597fe3a1e323b..831075af1cd63 100644
--- a/lldb/tools/lldb-dap/DAP.cpp
+++ b/lldb/tools/lldb-dap/DAP.cpp
@@ -208,12 +208,12 @@ llvm::Error DAP::ConfigureIO(std::FILE *overrideOut, 
std::FILE *overrideErr) {
   in = lldb::SBFile(std::fopen(DEV_NULL, "r"), /*transfer_ownership=*/true);
 
   if (auto Error = out.RedirectTo(overrideOut, [this](llvm::StringRef output) {
-        SendOutput(OutputType::Stdout, output);
+        SendOutput(OutputType::Console, output);
       }))
     return Error;
 
   if (auto Error = err.RedirectTo(overrideErr, [this](llvm::StringRef output) {
-        SendOutput(OutputType::Stderr, output);
+        SendOutput(OutputType::Console, output);
       }))
     return Error;
 

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to