- interp_init_ftype *init_proc;
- interp_resume_ftype *resume_proc;
- interp_suspend_ftype *suspend_proc;
- interp_exec_ftype *exec_proc;
- interp_prompt_p_ftype *prompt_proc_p;
- interp_command_loop_ftype *command_loop_proc;
+public:
+ explicit interp (const char *name);
+ virtual ~interp () = 0;
+
+ virtual void init (bool top_level)
+ {}
+
+ virtual void resume () = 0;
+ virtual void suspend () = 0;
+
+ virtual gdb_exception exec (const char *command) = 0;
+
+ /* Returns the ui_out currently used to collect results for this
+ interpreter. It can be a formatter for stdout, as is the case
+ for the console & mi outputs, or it might be a result
+ formatter. */
+ virtual ui_out *interp_ui_out () = 0;
+
+ /* Provides a hook for interpreters to do any additional
+ setup/cleanup that they might need when logging is enabled or
+ disabled. */
+ virtual void set_logging (ui_file_up logfile, bool logging_redirect,
+ bool debug_redirect) = 0;
+
+ /* Called before starting an event loop, to give the interpreter a
+ chance to e.g., print a prompt. */
+ virtual void pre_command_loop ()
+ {}
+
+ /* Returns true if this interpreter supports using the readline
+ library; false if it uses GDB's own simplified readline
+ emulation. */
+ virtual bool supports_command_editing ()
+ { return false; }
+
+ const char *name () const
+ {
+ return m_name;
+ }
+
+ /* This is the name in "-i=" and "set interpreter". */
+private:
+ char *m_name;
+
+ /* Interpreters are stored in a linked list, this is the next
+ one... */
+public:
+ struct interp *next;
+
+ /* Has the init method been run? */
+ bool inited;