[lldb/Interpreter] Fix session-save-on-quit when using ^D
authorMed Ismail Bennani <medismail.bennani@gmail.com>
Mon, 28 Jun 2021 19:27:55 +0000 (19:27 +0000)
committerMed Ismail Bennani <medismail.bennani@gmail.com>
Tue, 29 Jun 2021 08:54:29 +0000 (10:54 +0200)
commitd6b64612bd92cda8b53ef348fb578983124c600f
treed481bdb54e554ac3540016fc01585cd57353d866
parentfe1874dd2dd99c9811db515a2957e2a42f9f6868
[lldb/Interpreter] Fix session-save-on-quit when using ^D

Previously, when `interpreter.save-session-on-quit` was enabled, lldb
would save the session transcript only when running the `quit` command.

This patch changes that so the transcripts are saved when the debugger
object is destroyed if the setting is enabled.

rdar://72902650

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
lldb/source/Commands/CommandObjectQuit.cpp
lldb/source/Core/Debugger.cpp
lldb/source/Interpreter/CommandInterpreter.cpp
lldb/test/API/commands/session/save/TestSessionSave.py