[Lldb-commits] [PATCH] D50365: Add a new tool named "lldb-vscode" that implements the Visual Studio Code Debug Adaptor Protocol

Jan Korous via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 8 09:25:28 PDT 2018

jkorous added a comment.

Hi Greg, this looks interesting! I got curious about your patch since I am dealing with another protocol from the same "family" - LSP.

Comment at: tools/lldb-vscode/lldb-vscode.cpp:1424
+std::string read_json_packet(FILE *in) {
+  static std::string header("Content-Length: ");
It looks to me that since you are just logging protocol level error here they will manifest as JSON parsing errors down the road (L 4113). Is that ok?

BTW there's another implementation of HTTP-like header parsing in clangd:

Comment at: tools/lldb-vscode/lldb-vscode.cpp:4107
+  uint32_t packet_idx = 0;
+  while (true) {//!feof(g_state.in) && !ferror(g_state.in)) {
+    std::string json = read_json_packet(g_state.in);
This looks like some possible forgotten debugging artefact.


More information about the lldb-commits mailing list