[Lldb-commits] [PATCH] D82155: [lldb/interpreter] Add ability to save lldb session to a file

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 22 01:09:33 PDT 2020


labath marked an inline comment as done.
labath added inline comments.


================
Comment at: lldb/source/Commands/CommandObjectQuit.cpp:75-80
+  if (m_interpreter.GetSaveSessionOnQuit()) {
+    if (!m_interpreter.SaveTranscript(result)) {
+      result.SetStatus(eReturnStatusFailed);
+      return false;
+    }
+  }
----------------
I think this should be done only after we have done all the validation and decided that we actually want to quit (i.e. line ~109).

I am also not sure that a failure to save the transcript should abort the quit. Maybe it just print an error message but quit nonetheless?


================
Comment at: lldb/source/Interpreter/CommandInterpreter.cpp:506-519
   m_command_dict["register"] =
       CommandObjectSP(new CommandObjectRegister(*this));
   m_command_dict["reproducer"] =
       CommandObjectSP(new CommandObjectReproducer(*this));
   m_command_dict["script"] =
       CommandObjectSP(new CommandObjectScript(*this, script_language));
+  m_command_dict["session"] = CommandObjectSP(new CommandObjectSession(*this));
----------------
/me wonders how this file escaped Jonas's make_shared-ification.


================
Comment at: lldb/test/API/commands/session/save/TestSessionSave.py:16-18
+      configuration.settings.append(("interpreter.echo-commands", "true"))
+      configuration.settings.append(("interpreter.echo-comment-commands", "true"))
+      configuration.settings.append(("interpreter.stop-command-source-on-error", "false"))
----------------
This will modify the global configuration object. Best just set the relevant settings manually...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82155





More information about the lldb-commits mailing list