diff options
author | Eli Zaretskii <eliz@gnu.org> | 2012-05-08 18:49:42 +0000 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2012-05-08 18:49:42 +0000 |
commit | c41535fdc41896a2e881e1386eb3be9dff6ca6c4 (patch) | |
tree | 27748eeb952799924a6f232d7d48398c331fc846 /gdb/interps.c | |
parent | 80f5885c0674e3f865455e9e03ea60e67f1e4ed3 (diff) | |
download | gdb-c41535fdc41896a2e881e1386eb3be9dff6ca6c4.zip gdb-c41535fdc41896a2e881e1386eb3be9dff6ca6c4.tar.gz gdb-c41535fdc41896a2e881e1386eb3be9dff6ca6c4.tar.bz2 |
Display the ">" prompt in interactive mode while reading canned
commands, even when the current interpreter is MI.
interps.c (interp_set_temp): New function.
interps.h (interp_set_temp): Add prototype.
cli/cli-script.c (restore_interp): New cleanup function.
(read_command_lines): Temporarily override the current interpreter
with CLI and arrange for restoring the original one.
Diffstat (limited to 'gdb/interps.c')
-rw-r--r-- | gdb/interps.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/interps.c b/gdb/interps.c index 36ed520..23e5a10 100644 --- a/gdb/interps.c +++ b/gdb/interps.c @@ -253,6 +253,18 @@ interp_ui_out (struct interp *interp) return current_interpreter->procs->ui_out_proc (current_interpreter); } +/* Temporarily overrides the current interpreter. */ +struct interp * +interp_set_temp (const char *name) +{ + struct interp *interp = interp_lookup (name); + struct interp *old_interp = current_interpreter; + + if (interp) + current_interpreter = interp; + return old_interp; +} + /* Returns the interpreter's cookie. */ void * |