[Lldb-commits] [lldb] 0cf86da - [Reproducer] Quit the debugger after generating a reproducer

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 11 14:30:17 PST 2019


Author: Jonas Devlieghere
Date: 2019-11-11T14:29:53-08:00
New Revision: 0cf86da1741fb1a4278dc31dfc8f1538c9186892

URL: https://github.com/llvm/llvm-project/commit/0cf86da1741fb1a4278dc31dfc8f1538c9186892
DIFF: https://github.com/llvm/llvm-project/commit/0cf86da1741fb1a4278dc31dfc8f1538c9186892.diff

LOG: [Reproducer] Quit the debugger after generating a reproducer

Currently nothing prevents you from continuing your debug session after
generating the reproducer. This can cause the reproducer to end up in an
inconsistent state. Most of the time this doesn't matter, but I want to
prevent this from causing bugs in the future.

Added: 
    

Modified: 
    lldb/source/Commands/CommandObjectReproducer.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Commands/CommandObjectReproducer.cpp b/lldb/source/Commands/CommandObjectReproducer.cpp
index dc4579c20fc2..560df25b97c6 100644
--- a/lldb/source/Commands/CommandObjectReproducer.cpp
+++ b/lldb/source/Commands/CommandObjectReproducer.cpp
@@ -78,7 +78,7 @@ class CommandObjectReproducerGenerate : public CommandObjectParsed {
             interpreter, "reproducer generate",
             "Generate reproducer on disk. When the debugger is in capture "
             "mode, this command will output the reproducer to a directory on "
-            "disk. In replay mode this command in a no-op.",
+            "disk and quit. In replay mode this command in a no-op.",
             nullptr) {}
 
   ~CommandObjectReproducerGenerate() override = default;
@@ -110,7 +110,9 @@ class CommandObjectReproducerGenerate : public CommandObjectParsed {
         << "Please have a look at the directory to assess if you're willing to "
            "share the contained information.\n";
 
-    result.SetStatus(eReturnStatusSuccessFinishResult);
+    m_interpreter.BroadcastEvent(
+        CommandInterpreter::eBroadcastBitQuitCommandReceived);
+    result.SetStatus(eReturnStatusQuit);
     return result.Succeeded();
   }
 };


        


More information about the lldb-commits mailing list