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)
             self.vscode.terminate()
----------------
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?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79726



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

Reply via email to