[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
Wed Feb 16 11:45:21 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG7f3fc2eee8ff: [lldb/API] Add a way to check if the CommandInterpreter is interactive (authored by mib).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119499/new/

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
@@ -3162,6 +3162,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.409353.patch
Type: text/x-patch
Size: 2104 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220216/e7a0a2e1/attachment.bin>


More information about the lldb-commits mailing list