[Lldb-commits] [PATCH] D79726: Add terminateCommands to lldb-vscode protocol

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue May 12 01:02:34 PDT 2020

labath added a comment.

I gotta say I don't understand the difference between "exit" and "terminate" commands, as both seem to happen pretty at once. Is the difference that "exit" commands are run only when the inferior exits freely on its own, and not when we forcefully kill it? And that "terminate" cmds are run in both cases?

If you say that they are useful, then sure, I don't see a reason to not do this, though it seems to me like this will be confusing, and would be worth documenting somewhere. Maybe in that json file (I forgot where it's stored) which defines the protocol extensions used by lldb-vscode?

Comment at: lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py:250-251
         def cleanup():
-            self.vscode.request_disconnect(terminateDebuggee=True)
+            if disconnect:
+                self.vscode.request_disconnect(terminateDebuggee=True)
What's the purpose of this argument? To ensure a clean shutdown? Would it be possible to make the function smart enough to detect the right thing to do when cleaning up?

Comment at: lldb/tools/lldb-vscode/lldb-vscode.cpp:777
   auto state = process.GetState();
+  g_vsc.RunTerminateCommands();
   switch (state) {
How about moving this to line ~801 so that it is sent *after* the inferior is killed, similar to how you above perform the commands after receiving the exit event?

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list