This allows an interpreter to override internal calls to
gdb_do_one_event in case the former needs to handle alternate event
sources.
The default action is to call gdb_do_one_event and this is not overriden
in current internal interpreters. However this feature allows to easily
embed Tcl/Tk in insight that needs to concurrently handle Tcl events for
GUI handling.
In all cases, an interpreter event servicing method must call
gdb_do_one_event at some point.
All internal event servicing calls from gdb now direct to the
interpreter-specific method rather than gdb_do_one_event itself.
#define GDB_INTERPS_H
#include "gdbsupport/intrusive_list.h"
+#include "gdbsupport/event-loop.h"
struct bpstat;
struct ui_out;
virtual void pre_command_loop ()
{}
+ /* Service one event.
+ This gives the interpreter a chance to handle its own private
+ events that cannot be fed into the gdb event mechanism.
+ In all cases, this should call gdb_do_one_event at some point. */
+ virtual int do_one_event (int mstimeout = -1)
+ { return gdb_do_one_event (mstimeout); }
+
/* Returns true if this interpreter supports using the readline
library; false if it uses GDB's own simplified readline
emulation. */
try
{
- result = gdb_do_one_event ();
+ result = current_interpreter ()->do_one_event ();
}
catch (const gdb_exception_forced_quit &ex)
{
point. */
scoped_enable_commit_resumed enable ("sync wait");
- while (gdb_do_one_event () >= 0)
+ while (current_interpreter ()->do_one_event () >= 0)
if (ui->prompt_state != PROMPT_BLOCKED)
break;
}
(*after_char_processing_hook) ();
gdb_assert (after_char_processing_hook == NULL);
- while (gdb_do_one_event () >= 0)
+ while (current_interpreter ()->do_one_event () >= 0)
if (gdb_readline_wrapper_done)
break;