diff --git a/lldb/bindings/interface/SBCommandInterpreter.i b/lldb/bindings/interface/SBCommandInterpreter.i --- a/lldb/bindings/interface/SBCommandInterpreter.i +++ b/lldb/bindings/interface/SBCommandInterpreter.i @@ -125,6 +125,9 @@ bool HasAliasOptions (); + bool + IsInteractive (); + lldb::SBProcess GetProcess (); diff --git a/lldb/include/lldb/API/SBCommandInterpreter.h b/lldb/include/lldb/API/SBCommandInterpreter.h --- a/lldb/include/lldb/API/SBCommandInterpreter.h +++ b/lldb/include/lldb/API/SBCommandInterpreter.h @@ -59,6 +59,8 @@ bool HasAliasOptions(); + bool IsInteractive(); + lldb::SBProcess GetProcess(); lldb::SBDebugger GetDebugger(); diff --git a/lldb/include/lldb/Interpreter/CommandInterpreter.h b/lldb/include/lldb/Interpreter/CommandInterpreter.h --- a/lldb/include/lldb/Interpreter/CommandInterpreter.h +++ b/lldb/include/lldb/Interpreter/CommandInterpreter.h @@ -605,6 +605,8 @@ FileSpec GetCurrentSourceDir(); + bool IsInteractive(); + protected: friend class Debugger; diff --git a/lldb/source/API/SBCommandInterpreter.cpp b/lldb/source/API/SBCommandInterpreter.cpp --- a/lldb/source/API/SBCommandInterpreter.cpp +++ b/lldb/source/API/SBCommandInterpreter.cpp @@ -329,6 +329,12 @@ return (IsValid() ? m_opaque_ptr->HasAliasOptions() : false); } +bool SBCommandInterpreter::IsInteractive() { + LLDB_INSTRUMENT_VA(this); + + return (IsValid() ? m_opaque_ptr->IsInteractive() : false); +} + SBProcess SBCommandInterpreter::GetProcess() { LLDB_INSTRUMENT_VA(this); diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -3162,6 +3162,10 @@ return true; } +bool CommandInterpreter::IsInteractive() { + return (GetIOHandler() ? GetIOHandler()->GetIsInteractive() : false); +} + FileSpec CommandInterpreter::GetCurrentSourceDir() { if (m_command_source_dirs.empty()) return {};