[Lldb-commits] [PATCH] D94997: [lldb][lldb-vscode] Updated implementation of 'launch' and 'attach' requests to not create auxiliary target in case "launchCommands" and "attachCommands" are provided.

walter erquinigo via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 13 22:32:03 PDT 2021


wallace added inline comments.


================
Comment at: lldb/tools/lldb-vscode/lldb-vscode.cpp:627-628
+               "incompatible with 'attachCommands'.\n", arg.str().c_str());
+      }
+    }
+    // Run any pre run LLDB commands the user specified in the launch.json
----------------
clayborg wrote:
> We can't print to stderr or stdout since this is where the VS code DAP packets get delivered. 
> 
> We have two options here IMHO:
> - deliver the warning/error stirng to the debugger console
> - return an error with this string as the reason and fail the attach as long as the error string get displayed to the user in the IDE
> 
> We can deliver this to the "Debugger Console" using:
> ```
>   std::string str;
>   llvm::raw_string_ostream strm(str);
>   strm << ...;
>   g_vsc.SendOutput(OutputType::Console, strm.str());
> ```
> 
>  
do as Greg says and besides that terminate the debug session. This might be an indication of an erroneous configuration


================
Comment at: lldb/tools/lldb-vscode/lldb-vscode.cpp:1696-1697
+               "incompatible with 'launchCommands'.\n", arg.str().c_str());
+      }
+    }
+    g_vsc.RunPreRunCommands();
----------------
clayborg wrote:
> use g_vsc.SendOutput(OutputType::Console, ...) as mentioned above or return an error. We will discuss the merits of message vs error in this comments.
> 
same here, just terminate the session


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94997/new/

https://reviews.llvm.org/D94997



More information about the lldb-commits mailing list