summaryrefslogtreecommitdiffstats
path: root/include/lldb/Core/IOHandler.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/lldb/Core/IOHandler.h')
-rw-r--r--include/lldb/Core/IOHandler.h150
1 files changed, 65 insertions, 85 deletions
diff --git a/include/lldb/Core/IOHandler.h b/include/lldb/Core/IOHandler.h
index 02e6bde..b617d8e 100644
--- a/include/lldb/Core/IOHandler.h
+++ b/include/lldb/Core/IOHandler.h
@@ -67,18 +67,6 @@ namespace lldb_private {
virtual void
Run () = 0;
- // Hide any characters that have been displayed so far so async
- // output can be displayed. Refresh() will be called after the
- // output has been displayed.
- virtual void
- Hide () = 0;
-
- // Called when the async output has been received in order to update
- // the input reader (refresh the prompt and redisplay any current
- // line(s) that are being edited
- virtual void
- Refresh () = 0;
-
// Called when an input reader should relinquish its control so another
// can be pushed onto the IO handler stack, or so the current IO
// handler can pop itself off the stack
@@ -246,7 +234,14 @@ namespace lldb_private {
void
WaitForPop ();
-
+
+ virtual void
+ PrintAsync (Stream *stream, const char *s, size_t len)
+ {
+ stream->Write (s, len);
+ stream->Flush();
+ }
+
protected:
Debugger &m_debugger;
lldb::StreamFileSP m_input_sp;
@@ -318,7 +313,7 @@ namespace lldb_private {
}
//------------------------------------------------------------------
- /// Called when a new line is created or one of an identifed set of
+ /// Called when a new line is created or one of an identified set of
/// indentation characters is typed.
///
/// This function determines how much indentation should be added
@@ -332,7 +327,7 @@ namespace lldb_private {
/// following the line containing the cursor are not included.
///
/// @param[in] cursor_position
- /// The number of characters preceeding the cursor on the final
+ /// The number of characters preceding the cursor on the final
/// line at the time.
///
/// @return
@@ -448,17 +443,17 @@ namespace lldb_private {
{
}
- virtual ConstString
- IOHandlerGetControlSequence (char ch)
+ ConstString
+ IOHandlerGetControlSequence (char ch) override
{
if (ch == 'd')
return ConstString (m_end_line + "\n");
return ConstString();
}
- virtual bool
+ bool
IOHandlerIsInputComplete (IOHandler &io_handler,
- StringList &lines)
+ StringList &lines) override
{
// Determine whether the end of input signal has been entered
const size_t num_lines = lines.GetSize();
@@ -507,53 +502,47 @@ namespace lldb_private {
virtual
~IOHandlerEditline ();
- virtual void
- Run ();
+ void
+ Run () override;
- virtual void
- Hide ();
-
- virtual void
- Refresh ();
-
- virtual void
- Cancel ();
+ void
+ Cancel () override;
- virtual bool
- Interrupt ();
+ bool
+ Interrupt () override;
- virtual void
- GotEOF();
+ void
+ GotEOF() override;
- virtual void
- Activate ();
+ void
+ Activate () override;
- virtual void
- Deactivate ();
+ void
+ Deactivate () override;
- virtual ConstString
- GetControlSequence (char ch)
+ ConstString
+ GetControlSequence (char ch) override
{
return m_delegate.IOHandlerGetControlSequence (ch);
}
- virtual const char *
- GetCommandPrefix ()
+ const char *
+ GetCommandPrefix () override
{
return m_delegate.IOHandlerGetCommandPrefix ();
}
- virtual const char *
- GetHelpPrologue ()
+ const char *
+ GetHelpPrologue () override
{
return m_delegate.IOHandlerGetHelpPrologue ();
}
- virtual const char *
- GetPrompt ();
+ const char *
+ GetPrompt () override;
- virtual bool
- SetPrompt (const char *prompt);
+ bool
+ SetPrompt (const char *prompt) override;
const char *
GetContinuationPrompt ();
@@ -591,6 +580,9 @@ namespace lldb_private {
uint32_t
GetCurrentLineIndex () const;
+ void
+ PrintAsync (Stream *stream, const char *s, size_t len) override;
+
private:
#ifndef LLDB_DISABLE_LIBEDIT
static bool
@@ -626,6 +618,7 @@ namespace lldb_private {
bool m_multi_line;
bool m_color_prompts;
bool m_interrupt_exits;
+ bool m_editing; // Set to true when fetching a line manually (not using libedit)
};
// The order of base classes is important. Look at the constructor of IOHandlerConfirm
@@ -648,17 +641,17 @@ namespace lldb_private {
return m_user_response;
}
- virtual int
+ int
IOHandlerComplete (IOHandler &io_handler,
const char *current_line,
const char *cursor,
const char *last_char,
int skip_first_n_matches,
int max_matches,
- StringList &matches);
+ StringList &matches) override;
- virtual void
- IOHandlerInputComplete (IOHandler &io_handler, std::string &data);
+ void
+ IOHandlerInputComplete (IOHandler &io_handler, std::string &data) override;
protected:
const bool m_default_response;
@@ -671,32 +664,25 @@ namespace lldb_private {
public:
IOHandlerCursesGUI (Debugger &debugger);
- virtual
- ~IOHandlerCursesGUI ();
-
- virtual void
- Run ();
+ ~IOHandlerCursesGUI () override;
- virtual void
- Hide ();
+ void
+ Run () override;
- virtual void
- Refresh ();
-
- virtual void
- Cancel ();
+ void
+ Cancel () override;
- virtual bool
- Interrupt ();
+ bool
+ Interrupt () override;
- virtual void
- GotEOF();
+ void
+ GotEOF() override;
- virtual void
- Activate ();
+ void
+ Activate () override;
- virtual void
- Deactivate ();
+ void
+ Deactivate () override;
protected:
curses::ApplicationAP m_app_ap;
@@ -711,20 +697,11 @@ namespace lldb_private {
virtual
~IOHandlerCursesValueObjectList ();
- virtual void
- Run ();
-
- virtual void
- Hide ();
-
- virtual void
- Refresh ();
-
- virtual bool
- HandleInterrupt ();
+ void
+ Run () override;
- virtual void
- GotEOF();
+ void
+ GotEOF() override;
protected:
ValueObjectList m_valobj_list;
};
@@ -849,7 +826,10 @@ namespace lldb_private {
return NULL;
}
- protected:
+ void
+ PrintAsync (Stream *stream, const char *s, size_t len);
+
+ protected:
typedef std::vector<lldb::IOHandlerSP> collection;
collection m_stack;
OpenPOWER on IntegriCloud