[all-commits] [llvm/llvm-project] 5bb742: [lldb/interpreter] Add ability to save lldb sessio...

Med Ismail Bennani via All-commits all-commits at lists.llvm.org
Wed Jul 22 02:43:46 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 5bb742b10dafd595223172ae985687765934ebe9
      https://github.com/llvm/llvm-project/commit/5bb742b10dafd595223172ae985687765934ebe9
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2020-07-22 (Wed, 22 Jul 2020)

  Changed paths:
    M lldb/include/lldb/Interpreter/CommandInterpreter.h
    M lldb/source/Commands/CMakeLists.txt
    M lldb/source/Commands/CommandObjectQuit.cpp
    A lldb/source/Commands/CommandObjectSession.cpp
    A lldb/source/Commands/CommandObjectSession.h
    M lldb/source/Interpreter/CommandInterpreter.cpp
    M lldb/source/Interpreter/InterpreterProperties.td
    A lldb/test/API/commands/session/save/TestSessionSave.py

  Log Message:
  -----------
  [lldb/interpreter] Add ability to save lldb session to a file

This patch introduce a new feature that allows the users to save their
debugging session's transcript (commands + outputs) to a file.

It differs from the reproducers since it doesn't require to capture a
session preemptively and replay the reproducer file in lldb.
The user can choose the save its session manually using the session save
command or automatically by setting the interpreter.save-session-on-quit
on their init file.

To do so, the patch adds a Stream object to the CommandInterpreter that
will hold the input command from the IOHandler and the CommandReturnObject
output and error. This way, that stream object accumulates passively all
the interactions throughout the session and will save them to disk on demand.

The user can specify a file path where the session's transcript will be
saved. However, it is optional, and when it is not provided, lldb will
create a temporary file name according to the session date and time.

rdar://63347792

Differential Revision: https://reviews.llvm.org/D82155

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>




More information about the All-commits mailing list