/* Manages interpreters for GDB, the GNU debugger.
- Copyright (C) 2000-2018 Free Software Foundation, Inc.
+ Copyright (C) 2000-2020 Free Software Foundation, Inc.
Written by Jim Ingham <jingham@apple.com> of Apple Computer, Inc.
struct ui_out;
struct interp;
struct ui;
+class completion_tracker;
typedef struct interp *(*interp_factory_func) (const char *name);
/* 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) = 0;
+ 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 bool supports_command_editing ()
{ return false; }
+ const char *name () const
+ {
+ return m_name;
+ }
+
/* This is the name in "-i=" and "set interpreter". */
- const char *name;
+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? */
~scoped_restore_interp ()
{
- set_interp (m_interp->name);
+ set_interp (m_interp->name ());
}
scoped_restore_interp (const scoped_restore_interp &) = delete;
interpreter should configure the output streams to send output only
to the logfile. If false, the interpreter should configure the
output streams to send output to both the current output stream
- (i.e., the terminal) and the log file. */
+ (i.e., the terminal) and the log file. DEBUG_REDIRECT is same as
+ LOGGING_REDIRECT, but for the value of "set logging debugredirect"
+ instead. */
extern void current_interp_set_logging (ui_file_up logfile,
- bool logging_redirect);
+ bool logging_redirect,
+ bool debug_redirect);
/* Returns the top-level interpreter. */
extern struct interp *top_level_interpreter (void);