[Lldb-commits] [PATCH] D119499: [lldb/API] Add a way to check if the CommandInterpreter is interactive
Med Ismail Bennani via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu Feb 10 16:12:19 PST 2022
mib created this revision.
mib added reviewers: JDevlieghere, jingham.
mib added a project: LLDB.
mib requested review of this revision.
Herald added a subscriber: lldb-commits.
This patch adds the ability for the user to check if the command
interpreter's IOHandler is interactive.
Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D119499
Files:
lldb/bindings/interface/SBCommandInterpreter.i
lldb/include/lldb/API/SBCommandInterpreter.h
lldb/include/lldb/Interpreter/CommandInterpreter.h
lldb/source/API/SBCommandInterpreter.cpp
lldb/source/Interpreter/CommandInterpreter.cpp
Index: lldb/source/Interpreter/CommandInterpreter.cpp
===================================================================
--- lldb/source/Interpreter/CommandInterpreter.cpp
+++ lldb/source/Interpreter/CommandInterpreter.cpp
@@ -3157,6 +3157,10 @@
return true;
}
+bool CommandInterpreter::IsInteractive() {
+ return (GetIOHandler() ? GetIOHandler()->GetIsInteractive() : false);
+}
+
FileSpec CommandInterpreter::GetCurrentSourceDir() {
if (m_command_source_dirs.empty())
return {};
Index: lldb/source/API/SBCommandInterpreter.cpp
===================================================================
--- lldb/source/API/SBCommandInterpreter.cpp
+++ 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);
Index: lldb/include/lldb/Interpreter/CommandInterpreter.h
===================================================================
--- lldb/include/lldb/Interpreter/CommandInterpreter.h
+++ lldb/include/lldb/Interpreter/CommandInterpreter.h
@@ -605,6 +605,8 @@
FileSpec GetCurrentSourceDir();
+ bool IsInteractive();
+
protected:
friend class Debugger;
Index: lldb/include/lldb/API/SBCommandInterpreter.h
===================================================================
--- lldb/include/lldb/API/SBCommandInterpreter.h
+++ lldb/include/lldb/API/SBCommandInterpreter.h
@@ -59,6 +59,8 @@
bool HasAliasOptions();
+ bool IsInteractive();
+
lldb::SBProcess GetProcess();
lldb::SBDebugger GetDebugger();
Index: lldb/bindings/interface/SBCommandInterpreter.i
===================================================================
--- lldb/bindings/interface/SBCommandInterpreter.i
+++ lldb/bindings/interface/SBCommandInterpreter.i
@@ -125,6 +125,9 @@
bool
HasAliasOptions ();
+ bool
+ IsInteractive ();
+
lldb::SBProcess
GetProcess ();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119499.407717.patch
Type: text/x-patch
Size: 2104 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220211/70b70035/attachment-0001.bin>
More information about the lldb-commits
mailing list