[Lldb-commits] [PATCH] D81200: [vscode] set default values for terminateDebuggee for the disconnect request

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 4 18:46:33 PDT 2020

clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.

So the main question is why was lldb-vscode not exiting. Do we know why? Some thread wasn't exiting I would guess, but usually as long as the main thread exits, all other threads will just be terminated.  Our main thread should be the loop that waits for packets, gets one, executes what it needs to and sends a response. When the "terminate" packet comes in, that read loop should exit and this should cause the lldb-vscode to exit. So I am questioning if this works around the issue. Does "disconnect" always get sent for both launch and attach? Then "terminate"?

The changes look good for other reasons, but I am wondering if this will fix all of the lldb-vscode binaries that we have sitting around. A quick "sample lldb-vscode" should show where these lldb-vscode binaries are stuck. Can we verify what is going on to make sure this will fix this?

Marking as needs changes due to initialization of the "VSCode::is_attach" not being done in constructor.

Comment at: lldb/test/API/tools/lldb-vscode/disconnect/main.c:10
+  int x;
+  // We wait for a signal to proceed
+  scanf("%d", &x);
This comment seems off? You can call "pause()" to wait for a signal, but that won't work on non unix based systems. Is the comment just left over?

Comment at: lldb/tools/lldb-vscode/VSCode.h:92
   bool stop_at_entry;
+  bool is_attach;
   // Keep track of the last stop thread index IDs as threads won't go away
This should be initialized in the VSCode::VSCode constructor? Surely we are initializing the other values right?

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list