HomePhabricator

[lldb/interpreter] Add ability to save lldb session to a file

Authored by mib on Jul 21 2020, 7:29 AM.

Description

[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@gmail.com>

Details

Committed
mibJul 22 2020, 2:43 AM
Differential Revision
D82155: [lldb/interpreter] Add ability to save lldb session to a file
Parents
rGa4bbc3b76360: [ARM] Predicated binary operation tests. NFC
Branches
Unknown
Tags
Unknown