* 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.
#include "tuiRegs.h"
#include "tuiStack.h"
#include "tuiWin.h"
#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 "readline/readline.h"
#include "target.h"
#include "frame.h"
#include "breakpoint.h"
/* Tells whether the TUI is active or not. */
int tui_active = 0;
/* Tells whether the TUI is active or not. */
int tui_active = 0;
if (tui_active)
{
tui_disable ();
if (tui_active)
{
tui_disable ();
+ rl_prep_terminal (0);
+
printf_filtered ("Left the TUI mode\n");
}
else
{
printf_filtered ("Left the TUI mode\n");
}
else
{
tui_enable ();
printf_filtered ("Entered the TUI mode\n");
}
tui_enable ();
printf_filtered ("Entered the TUI mode\n");
}
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');
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 ();
tui_version = 1;
tui_active = 1;
refresh ();
tui_version = 1;
tui_active = 1;
refresh ();
+
+ /* Update gdb's knowledge of its terminal. */
+ terminal_save_ours ();
so that terminal management with the inferior works. */
tui_setup_io (0);
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;
}
tui_version = 0;
tui_active = 0;
}
tuiGetLowDisassemblyAddress (CORE_ADDR low, CORE_ADDR pc)
{
int line;
tuiGetLowDisassemblyAddress (CORE_ADDR low, CORE_ADDR pc)
{
int line;
/* Determine where to start the disassembly so that the pc is about in the
middle of the viewport. */
/* Determine where to start the disassembly so that the pc is about in the
middle of the viewport. */
+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)
void
tui_show_assembly (CORE_ADDR addr)
/* Leave the tui mode. */
extern void tui_disable (void);
/* Leave the tui mode. */
extern void tui_disable (void);
+extern void tui_initialize_io (void);
+
+extern void tui_initialize_readline (void);
+
+extern int tui_active;
+
+extern void tui_install_hooks (void);
+extern void tui_remove_hooks (void);
+
+extern void tui_show_source (const char *file, int line);
+
+extern struct ui_out *tui_out_new (struct ui_file *stream);
+
/* tuiDataWin.c */
extern void tui_vCheckDataValues (va_list);
/* tuiDataWin.c */
extern void tui_vCheckDataValues (va_list);
** Update only the filename portion of the locator.
*/
void
** Update only the filename portion of the locator.
*/
void
-tuiUpdateLocatorFilename (char *fileName)
+tuiUpdateLocatorFilename (const char *fileName)
{
TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
{
TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
extern void tuiSetLocatorInfo (char *, char *, int, CORE_ADDR,
TuiLocatorElementPtr);
extern void tuiSetLocatorInfo (char *, char *, int, CORE_ADDR,
TuiLocatorElementPtr);
-extern void tuiUpdateLocatorFilename (char *);
+extern void tuiUpdateLocatorFilename (const char *);
extern void tuiUpdateLocatorInfoFromFrame
(struct frame_info *, TuiLocatorElementPtr);
extern void tuiUpdateLocatorDisplay (struct frame_info *);
extern void tuiUpdateLocatorInfoFromFrame
(struct frame_info *, TuiLocatorElementPtr);
extern void tuiUpdateLocatorDisplay (struct frame_info *);
/* Define the tui control variables. */
c = add_set_enum_cmd
("tui-border-kind", class_tui,
/* Define the tui control variables. */
c = add_set_enum_cmd
("tui-border-kind", class_tui,
- tui_border_kind_enums, (char*) &tui_border_kind,
+ tui_border_kind_enums, &tui_border_kind,
"Set the kind of border for TUI windows.\n"
"This variable controls the border of TUI windows:\n"
"space use a white space\n"
"Set the kind of border for TUI windows.\n"
"This variable controls the border of TUI windows:\n"
"space use a white space\n"
c = add_set_enum_cmd
("tui-border-mode", class_tui,
c = add_set_enum_cmd
("tui-border-mode", class_tui,
- tui_border_mode_enums, (char*) &tui_border_mode,
+ tui_border_mode_enums, &tui_border_mode,
"Set the attribute mode to use for the TUI window borders.\n"
"This variable controls the attributes to use for the window borders:\n"
"normal normal display\n"
"Set the attribute mode to use for the TUI window borders.\n"
"This variable controls the attributes to use for the window borders:\n"
"normal normal display\n"
c = add_set_enum_cmd
("tui-active-border-mode", class_tui,
c = add_set_enum_cmd
("tui-active-border-mode", class_tui,
- tui_border_mode_enums, (char*) &tui_active_border_mode,
+ tui_border_mode_enums, &tui_active_border_mode,
"Set the attribute mode to use for the active TUI window border.\n"
"This variable controls the attributes to use for the active window border:\n"
"normal normal display\n"
"Set the attribute mode to use for the active TUI window border.\n"
"This variable controls the attributes to use for the active window border:\n"
"normal normal display\n"