[llvm-branch-commits] [lldb] r198947 - Added back some API that Xcode needs. The SBInputReader is being deprecated and we will eventually take it all out once we get all clients off of it.

Greg Clayton gclayton at apple.com
Fri Jan 10 10:12:27 PST 2014


Author: gclayton
Date: Fri Jan 10 12:12:27 2014
New Revision: 198947

URL: http://llvm.org/viewvc/llvm-project?rev=198947&view=rev
Log:
Added back some API that Xcode needs. The SBInputReader is being deprecated and we will eventually take it all out once we get all clients off of it.


Modified:
    lldb/branches/iohandler/include/lldb/API/SBDebugger.h
    lldb/branches/iohandler/include/lldb/lldb-enumerations.h
    lldb/branches/iohandler/source/API/SBDebugger.cpp

Modified: lldb/branches/iohandler/include/lldb/API/SBDebugger.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/iohandler/include/lldb/API/SBDebugger.h?rev=198947&r1=198946&r2=198947&view=diff
==============================================================================
--- lldb/branches/iohandler/include/lldb/API/SBDebugger.h (original)
+++ lldb/branches/iohandler/include/lldb/API/SBDebugger.h Fri Jan 10 12:12:27 2014
@@ -17,6 +17,16 @@
 
 namespace lldb {
 
+    
+class SBInputReader
+{
+public:
+    SBInputReader();
+    ~SBInputReader();
+    SBError Initialize(lldb::SBDebugger&, unsigned long (*)(void*, lldb::SBInputReader*, lldb::InputReaderAction, char const*, unsigned long), void*, lldb::InputReaderGranularity, char const*, char const*, bool);
+    void SetIsDone(bool);
+    bool IsActive() const;
+};
 class SBDebugger
 {
 public:
@@ -228,6 +238,9 @@ public:
     void
     DispatchInputEndOfFile ();
     
+    void
+    PushInputReader (lldb::SBInputReader &reader);
+
     const char *
     GetInstanceName  ();
 
@@ -310,6 +323,7 @@ public:
 private:
 
     friend class SBCommandInterpreter;
+    friend class SBInputReader;
     friend class SBListener;
     friend class SBProcess;
     friend class SBSourceManager;

Modified: lldb/branches/iohandler/include/lldb/lldb-enumerations.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/iohandler/include/lldb/lldb-enumerations.h?rev=198947&r1=198946&r2=198947&view=diff
==============================================================================
--- lldb/branches/iohandler/include/lldb/lldb-enumerations.h (original)
+++ lldb/branches/iohandler/include/lldb/lldb-enumerations.h Fri Jan 10 12:12:27 2014
@@ -231,6 +231,19 @@ namespace lldb {
         eValueTypeConstResult       = 7     // constant result variables
     } ValueType;
 
+    //----------------------------------------------------------------------
+    // Token size/granularities for Input Readers
+    //----------------------------------------------------------------------
+
+    typedef enum InputReaderGranularity
+    {
+        eInputReaderGranularityInvalid = 0,
+        eInputReaderGranularityByte,
+        eInputReaderGranularityWord,
+        eInputReaderGranularityLine,
+        eInputReaderGranularityAll
+    } InputReaderGranularity;
+
     //------------------------------------------------------------------
     /// These mask bits allow a common interface for queries that can
     /// limit the amount of information that gets parsed to only the
@@ -260,6 +273,18 @@ namespace lldb {
         ePermissionsExecutable  = (1u << 2)
     } Permissions;
 
+    typedef enum InputReaderAction
+    {
+        eInputReaderActivate,   // reader is newly pushed onto the reader stack 
+        eInputReaderAsynchronousOutputWritten, // an async output event occurred; the reader may want to do something
+        eInputReaderReactivate, // reader is on top of the stack again after another reader was popped off 
+        eInputReaderDeactivate, // another reader was pushed on the stack 
+        eInputReaderGotToken,   // reader got one of its tokens (granularity)
+        eInputReaderInterrupt,  // reader received an interrupt signal (probably from a control-c)
+        eInputReaderEndOfFile,  // reader received an EOF char (probably from a control-d)
+        eInputReaderDone        // reader was just popped off the stack and is done
+    } InputReaderAction;
+
     typedef enum BreakpointEventType
     {
         eBreakpointEventTypeInvalidType         = (1u << 0),

Modified: lldb/branches/iohandler/source/API/SBDebugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/iohandler/source/API/SBDebugger.cpp?rev=198947&r1=198946&r2=198947&view=diff
==============================================================================
--- lldb/branches/iohandler/source/API/SBDebugger.cpp (original)
+++ lldb/branches/iohandler/source/API/SBDebugger.cpp Fri Jan 10 12:12:27 2014
@@ -49,6 +49,43 @@ using namespace lldb;
 using namespace lldb_private;
 
 
+SBInputReader::SBInputReader()
+{
+}
+SBInputReader::~SBInputReader()
+{
+}
+
+static lldb::thread_result_t
+RunCI (lldb::thread_arg_t baton)
+{
+    Debugger *debugger = (Debugger *)baton;
+    debugger->GetCommandInterpreter().RunCommandInterpreter(false);
+    return NULL;
+}
+
+SBError
+SBInputReader::Initialize(lldb::SBDebugger& sb_debugger, unsigned long (*)(void*, lldb::SBInputReader*, lldb::InputReaderAction, char const*, unsigned long), void*, lldb::InputReaderGranularity, char const*, char const*, bool)
+{
+    Debugger *debugger = sb_debugger.get();
+    if (debugger)
+    {
+        lldb::thread_t thread = Host::ThreadCreate("lldb.SBInputReader.command_interpreter", RunCI, debugger, NULL);
+        Host::ThreadDetach(thread, NULL);
+    }
+    return SBError();
+}
+
+void
+SBInputReader::SetIsDone(bool)
+{
+}
+bool
+SBInputReader::IsActive() const
+{
+    return false;
+}
+
 static lldb::DynamicLibrarySP
 LoadPlugin (const lldb::DebuggerSP &debugger_sp, const FileSpec& spec, Error& error)
 {
@@ -926,6 +963,11 @@ SBDebugger::DispatchInputEndOfFile ()
 }
 
 void
+SBDebugger::PushInputReader (SBInputReader &reader)
+{
+}
+
+void
 SBDebugger::RunCommandInterpreter (bool auto_handle_events)
 {
     if (m_opaque_sp)





More information about the llvm-branch-commits mailing list