diff options
author | Stephane Carrez <stcarrez@nerim.fr> | 2001-07-23 21:13:57 +0000 |
---|---|---|
committer | Stephane Carrez <stcarrez@nerim.fr> | 2001-07-23 21:13:57 +0000 |
commit | c6f60bcd2c458714bd21da267719d55ba7e10736 (patch) | |
tree | 23342d6814f59cbeea06415378a0eba33232eb18 /gdb/tui/tui.c | |
parent | ab35b6115a9eb2b59ea5cf028dc9241766a19949 (diff) | |
download | gdb-c6f60bcd2c458714bd21da267719d55ba7e10736.zip gdb-c6f60bcd2c458714bd21da267719d55ba7e10736.tar.gz gdb-c6f60bcd2c458714bd21da267719d55ba7e10736.tar.bz2 |
* tuiStack.c (tuiUpdateLocatorFilename): Use const char*.
* tuiStack.h (tuiUpdateLocatorFilename): Update prototype.
* tuiWin.c (_initialize_tuiWin): Don't cast table of enum in calls
to add_set_enum_cmd.
* tui.c (tui_show_source): New function.
(tuiGetLowDisassemblyAddress): Use CORE_ADDR for newLow.
(tui_switch_mode): Prep or deprep readline terminal;
make sure the \n we return does not redo the last command.
* tui.h (tui_show_source): Declare.
(tui_out_new, tui_install_hooks, tui_remove_hooks): Likewise.
(tui_active, tui_initialize_io, tui_initialize_readline): Likewise.
Diffstat (limited to 'gdb/tui/tui.c')
-rw-r--r-- | gdb/tui/tui.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index 6c1dea0..b224be9 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -39,10 +39,12 @@ #include "tuiRegs.h" #include "tuiStack.h" #include "tuiWin.h" +#include "tuiSourceWin.h" #include "readline/readline.h" #include "target.h" #include "frame.h" #include "breakpoint.h" +#include "inferior.h" /* Tells whether the TUI is active or not. */ int tui_active = 0; @@ -55,10 +57,13 @@ tui_switch_mode (void) if (tui_active) { tui_disable (); + rl_prep_terminal (0); + printf_filtered ("Left the TUI mode\n"); } else { + rl_deprep_terminal (); tui_enable (); printf_filtered ("Entered the TUI mode\n"); } @@ -74,6 +79,9 @@ tui_switch_mode (void) will be able to setup the terminal for its needs. By re-entering in readline, we also redisplay its prompt in the non-curses mode. */ rl_newline (1, '\n'); + + /* Make sure the \n we are returning does not repeat the last command. */ + dont_repeat (); return 0; } @@ -232,6 +240,9 @@ tui_enable (void) tui_version = 1; tui_active = 1; refresh (); + + /* Update gdb's knowledge of its terminal. */ + terminal_save_ours (); } /* Leave the tui mode. @@ -254,6 +265,8 @@ tui_disable (void) so that terminal management with the inferior works. */ tui_setup_io (0); + /* Update gdb's knowledge of its terminal. */ + terminal_save_ours (); tui_version = 0; tui_active = 0; } @@ -276,7 +289,7 @@ CORE_ADDR tuiGetLowDisassemblyAddress (CORE_ADDR low, CORE_ADDR pc) { int line; - Opaque newLow; + CORE_ADDR newLow; /* Determine where to start the disassembly so that the pc is about in the middle of the viewport. */ @@ -385,6 +398,15 @@ _tuiReset (void) } /* _tuiReset */ #endif +void +tui_show_source (const char *file, int line) +{ + /* make sure that the source window is displayed */ + tuiAddWinToLayout (SRC_WIN); + + tuiUpdateSourceWindowsWithLine (current_source_symtab, line); + tuiUpdateLocatorFilename (file); +} void tui_show_assembly (CORE_ADDR addr) |