aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/tui')
-rw-r--r--gdb/tui/tui-command.c2
-rw-r--r--gdb/tui/tui-command.h2
-rw-r--r--gdb/tui/tui-data.c2
-rw-r--r--gdb/tui/tui-data.h2
-rw-r--r--gdb/tui/tui-disasm.c6
-rw-r--r--gdb/tui/tui-disasm.h2
-rw-r--r--gdb/tui/tui-file.c8
-rw-r--r--gdb/tui/tui-file.h13
-rw-r--r--gdb/tui/tui-hooks.c6
-rw-r--r--gdb/tui/tui-hooks.h2
-rw-r--r--gdb/tui/tui-interp.c6
-rw-r--r--gdb/tui/tui-io.c2
-rw-r--r--gdb/tui/tui-io.h2
-rw-r--r--gdb/tui/tui-layout.c6
-rw-r--r--gdb/tui/tui-layout.h2
-rw-r--r--gdb/tui/tui-location.c2
-rw-r--r--gdb/tui/tui-location.h2
-rw-r--r--gdb/tui/tui-regs.c6
-rw-r--r--gdb/tui/tui-regs.h2
-rw-r--r--gdb/tui/tui-source.c2
-rw-r--r--gdb/tui/tui-source.h2
-rw-r--r--gdb/tui/tui-status.c6
-rw-r--r--gdb/tui/tui-status.h2
-rw-r--r--gdb/tui/tui-win.c6
-rw-r--r--gdb/tui/tui-win.h2
-rw-r--r--gdb/tui/tui-wingeneral.c2
-rw-r--r--gdb/tui/tui-wingeneral.h2
-rw-r--r--gdb/tui/tui-winsource.c2
-rw-r--r--gdb/tui/tui-winsource.h2
-rw-r--r--gdb/tui/tui.c26
-rw-r--r--gdb/tui/tui.h2
31 files changed, 66 insertions, 65 deletions
diff --git a/gdb/tui/tui-command.c b/gdb/tui/tui-command.c
index 677721d..9bd33e2 100644
--- a/gdb/tui/tui-command.c
+++ b/gdb/tui/tui-command.c
@@ -1,6 +1,6 @@
/* Specific command window processing.
- Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
diff --git a/gdb/tui/tui-command.h b/gdb/tui/tui-command.h
index 61f8cf3..2f82291 100644
--- a/gdb/tui/tui-command.h
+++ b/gdb/tui/tui-command.h
@@ -1,6 +1,6 @@
/* Specific command window processing.
- Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c
index 962dbc5..7d1d055 100644
--- a/gdb/tui/tui-data.c
+++ b/gdb/tui/tui-data.c
@@ -1,6 +1,6 @@
/* TUI data manipulation routines.
- Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h
index 6f2087b..dd33a59 100644
--- a/gdb/tui/tui-data.h
+++ b/gdb/tui/tui-data.h
@@ -1,6 +1,6 @@
/* TUI data manipulation routines.
- Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c
index bb1ff7b..627f71c 100644
--- a/gdb/tui/tui-disasm.c
+++ b/gdb/tui/tui-disasm.c
@@ -1,6 +1,6 @@
/* Disassembly display.
- Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
@@ -546,9 +546,7 @@ run_tests ()
} /* namespace selftests */
#endif /* GDB_SELF_TEST */
-void _initialize_tui_disasm ();
-void
-_initialize_tui_disasm ()
+INIT_GDB_FILE (tui_disasm)
{
#if GDB_SELF_TEST
selftests::register_test ("tui-disasm", selftests::tui::disasm::run_tests);
diff --git a/gdb/tui/tui-disasm.h b/gdb/tui/tui-disasm.h
index 4279bb0..173cc8b 100644
--- a/gdb/tui/tui-disasm.h
+++ b/gdb/tui/tui-disasm.h
@@ -1,6 +1,6 @@
/* Disassembly display.
- Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
diff --git a/gdb/tui/tui-file.c b/gdb/tui/tui-file.c
index 17ac138..df6f503 100644
--- a/gdb/tui/tui-file.c
+++ b/gdb/tui/tui-file.c
@@ -1,5 +1,5 @@
/* UI_FILE - a generic STDIO like output stream.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of GDB.
@@ -21,7 +21,7 @@
#include "tui/tui-command.h"
void
-tui_file::puts (const char *linebuffer)
+tui_file::do_puts (const char *linebuffer)
{
tui_puts (linebuffer);
if (!m_buffered)
@@ -29,7 +29,7 @@ tui_file::puts (const char *linebuffer)
}
void
-tui_file::write (const char *buf, long length_buf)
+tui_file::do_write (const char *buf, long length_buf)
{
tui_write (buf, length_buf);
if (!m_buffered)
@@ -41,5 +41,5 @@ tui_file::flush ()
{
if (m_buffered)
tui_cmd_win ()->refresh_window ();
- stdio_file::flush ();
+ escape_buffering_file::flush ();
}
diff --git a/gdb/tui/tui-file.h b/gdb/tui/tui-file.h
index 6178a90..b6dc058 100644
--- a/gdb/tui/tui-file.h
+++ b/gdb/tui/tui-file.h
@@ -1,5 +1,5 @@
/* TUI_FILE - a STDIO-like output stream for the TUI.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of GDB.
@@ -23,18 +23,21 @@
/* A STDIO-like output stream for the TUI. */
-class tui_file : public stdio_file
+class tui_file : public escape_buffering_file
{
public:
tui_file (FILE *stream, bool buffered)
- : stdio_file (stream),
+ : escape_buffering_file (stream),
m_buffered (buffered)
{}
- void write (const char *buf, long length_buf) override;
- void puts (const char *) override;
void flush () override;
+protected:
+
+ void do_write (const char *buf, long length_buf) override;
+ void do_puts (const char *) override;
+
private:
/* True if this stream is buffered. */
diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c
index 69294cc..024fedd 100644
--- a/gdb/tui/tui-hooks.c
+++ b/gdb/tui/tui-hooks.c
@@ -1,6 +1,6 @@
/* GDB hooks for TUI.
- Copyright (C) 2001-2024 Free Software Foundation, Inc.
+ Copyright (C) 2001-2025 Free Software Foundation, Inc.
This file is part of GDB.
@@ -262,9 +262,7 @@ tui_remove_hooks (void)
tui_attach_detach_observers (false);
}
-void _initialize_tui_hooks ();
-void
-_initialize_tui_hooks ()
+INIT_GDB_FILE (tui_hooks)
{
/* Install the permanent hooks. */
gdb::observers::new_objfile.attach (tui_new_objfile_hook, "tui-hooks");
diff --git a/gdb/tui/tui-hooks.h b/gdb/tui/tui-hooks.h
index 21ba169..6fee785 100644
--- a/gdb/tui/tui-hooks.h
+++ b/gdb/tui/tui-hooks.h
@@ -1,6 +1,6 @@
/* External/Public TUI hools header file, for GDB the GNU debugger.
- Copyright (C) 2004-2024 Free Software Foundation, Inc.
+ Copyright (C) 2004-2025 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/tui/tui-interp.c b/gdb/tui/tui-interp.c
index 25761be..3d0e152 100644
--- a/gdb/tui/tui-interp.c
+++ b/gdb/tui/tui-interp.c
@@ -1,6 +1,6 @@
/* TUI Interpreter definitions for GDB, the GNU debugger.
- Copyright (C) 2003-2024 Free Software Foundation, Inc.
+ Copyright (C) 2003-2025 Free Software Foundation, Inc.
This file is part of GDB.
@@ -161,9 +161,7 @@ tui_interp_factory (const char *name)
return new tui_interp (name);
}
-void _initialize_tui_interp ();
-void
-_initialize_tui_interp ()
+INIT_GDB_FILE (tui_interp)
{
interp_factory_register (INTERP_TUI, tui_interp_factory);
diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c
index b3ede07..1b4cc82 100644
--- a/gdb/tui/tui-io.c
+++ b/gdb/tui/tui-io.c
@@ -1,6 +1,6 @@
/* TUI support I/O functions.
- Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
diff --git a/gdb/tui/tui-io.h b/gdb/tui/tui-io.h
index 66b3b90..aa931f8 100644
--- a/gdb/tui/tui-io.h
+++ b/gdb/tui/tui-io.h
@@ -1,6 +1,6 @@
/* TUI support I/O functions.
- Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c
index 3fac65f..558055d 100644
--- a/gdb/tui/tui-layout.c
+++ b/gdb/tui/tui-layout.c
@@ -1,6 +1,6 @@
/* TUI layout window management.
- Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
@@ -1294,9 +1294,7 @@ tui_new_layout_command (const char *spec, int from_tty)
/* Function to initialize gdb commands, for tui window layout
manipulation. */
-void _initialize_tui_layout ();
-void
-_initialize_tui_layout ()
+INIT_GDB_FILE (tui_layout)
{
struct cmd_list_element *layout_cmd
= add_basic_prefix_cmd ("layout", class_tui, _("\
diff --git a/gdb/tui/tui-layout.h b/gdb/tui/tui-layout.h
index 107b123..6046bb6 100644
--- a/gdb/tui/tui-layout.h
+++ b/gdb/tui/tui-layout.h
@@ -1,6 +1,6 @@
/* TUI layout window management.
- Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
diff --git a/gdb/tui/tui-location.c b/gdb/tui/tui-location.c
index 8e63d4f..24a14fb 100644
--- a/gdb/tui/tui-location.c
+++ b/gdb/tui/tui-location.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2021-2024 Free Software Foundation, Inc.
+/* Copyright (C) 2021-2025 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/tui/tui-location.h b/gdb/tui/tui-location.h
index 5eda4bd..eecefbc 100644
--- a/gdb/tui/tui-location.h
+++ b/gdb/tui/tui-location.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2021-2024 Free Software Foundation, Inc.
+/* Copyright (C) 2021-2025 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c
index 5158c06..ac2757a 100644
--- a/gdb/tui/tui-regs.c
+++ b/gdb/tui/tui-regs.c
@@ -1,6 +1,6 @@
/* TUI display registers in window.
- Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
@@ -566,9 +566,7 @@ tui_reggroup_completer (struct cmd_list_element *ignore,
complete_on_enum (tracker, extra, text, word);
}
-void _initialize_tui_regs ();
-void
-_initialize_tui_regs ()
+INIT_GDB_FILE (tui_regs)
{
struct cmd_list_element **tuicmd, *cmd;
diff --git a/gdb/tui/tui-regs.h b/gdb/tui/tui-regs.h
index 48f6aa0..5f7afa6 100644
--- a/gdb/tui/tui-regs.h
+++ b/gdb/tui/tui-regs.h
@@ -1,6 +1,6 @@
/* TUI display registers in window.
- Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c
index 2ef0308..e2dff84 100644
--- a/gdb/tui/tui-source.c
+++ b/gdb/tui/tui-source.c
@@ -1,6 +1,6 @@
/* TUI display source window.
- Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
diff --git a/gdb/tui/tui-source.h b/gdb/tui/tui-source.h
index 10702b2..626ac40 100644
--- a/gdb/tui/tui-source.h
+++ b/gdb/tui/tui-source.h
@@ -1,6 +1,6 @@
/* TUI display source window.
- Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
diff --git a/gdb/tui/tui-status.c b/gdb/tui/tui-status.c
index fa2d07c..c2d3873 100644
--- a/gdb/tui/tui-status.c
+++ b/gdb/tui/tui-status.c
@@ -1,6 +1,6 @@
/* TUI status line.
- Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
@@ -325,9 +325,7 @@ tui_update_command (const char *arg, int from_tty)
/* Function to initialize gdb commands, for tui window stack
manipulation. */
-void _initialize_tui_stack ();
-void
-_initialize_tui_stack ()
+INIT_GDB_FILE (tui_stack)
{
add_com ("update", class_tui, tui_update_command,
_("\
diff --git a/gdb/tui/tui-status.h b/gdb/tui/tui-status.h
index 8b507fd..2a84732 100644
--- a/gdb/tui/tui-status.h
+++ b/gdb/tui/tui-status.h
@@ -1,6 +1,6 @@
/* TUI status line.
- Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index 95639f5..d4fbbf1 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -1,6 +1,6 @@
/* TUI window generic functions.
- Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
@@ -1091,9 +1091,7 @@ bool tui_left_margin_verbose = false;
/* Function to initialize gdb commands, for tui window
manipulation. */
-void _initialize_tui_win ();
-void
-_initialize_tui_win ()
+INIT_GDB_FILE (tui_win)
{
static struct cmd_list_element *tui_setlist;
static struct cmd_list_element *tui_showlist;
diff --git a/gdb/tui/tui-win.h b/gdb/tui/tui-win.h
index 1521993..64153cf 100644
--- a/gdb/tui/tui-win.h
+++ b/gdb/tui/tui-win.h
@@ -1,6 +1,6 @@
/* TUI window generic functions.
- Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c
index 90fdaceb..de4ef52 100644
--- a/gdb/tui/tui-wingeneral.c
+++ b/gdb/tui/tui-wingeneral.c
@@ -1,6 +1,6 @@
/* General window behavior.
- Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
diff --git a/gdb/tui/tui-wingeneral.h b/gdb/tui/tui-wingeneral.h
index b037e79..0e0e5fe 100644
--- a/gdb/tui/tui-wingeneral.h
+++ b/gdb/tui/tui-wingeneral.h
@@ -1,6 +1,6 @@
/* General window behavior.
- Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index b5889a8..a545c48 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -1,6 +1,6 @@
/* TUI display source/assembly window.
- Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
diff --git a/gdb/tui/tui-winsource.h b/gdb/tui/tui-winsource.h
index deae786..b531f0e 100644
--- a/gdb/tui/tui-winsource.h
+++ b/gdb/tui/tui-winsource.h
@@ -1,6 +1,6 @@
/* TUI display source/assembly window.
- Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index 491fcb1..5883d6c 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -1,6 +1,6 @@
/* General functions for the WDB TUI.
- Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
@@ -67,7 +67,12 @@ show_tui_debug (struct ui_file *file, int from_tty,
/* Tells whether the TUI is active or not. */
bool tui_active = false;
-static bool tui_finish_init = true;
+
+/* Tells whether the TUI should do deferred curses initialization.
+ If TRIBOOL_TRUE, then yes. If TRIBOOL_FALSE. then no (because
+ initialization is already done). If TRIBOOL_UNKNOWN, then no (because
+ initialization failed). */
+static tribool tui_finish_init = TRIBOOL_TRUE;
enum tui_key_mode tui_current_key_mode = TUI_COMMAND_MODE;
@@ -392,7 +397,13 @@ tui_enable (void)
/* To avoid to initialize curses when gdb starts, there is a deferred
curses initialization. This initialization is made only once
and the first time the curses mode is entered. */
- if (tui_finish_init)
+ if (tui_finish_init == TRIBOOL_UNKNOWN)
+ {
+ /* Initialization failed before, just throw a generic error, don't try
+ again. */
+ error (_("Cannot enable the TUI"));
+ }
+ else if (tui_finish_init == TRIBOOL_TRUE)
{
WINDOW *w;
SCREEN *s;
@@ -412,6 +423,9 @@ tui_enable (void)
if (!gdb_stderr->isatty ())
error (_("Cannot enable the TUI when output is not a terminal"));
+ /* Don't try initialization again. */
+ tui_finish_init = TRIBOOL_UNKNOWN;
+
s = newterm (NULL, stdout, stdin);
#ifdef __MINGW32__
/* The MinGW port of ncurses requires $TERM to be unset in order
@@ -470,7 +484,7 @@ tui_enable (void)
tui_set_win_focus_to (tui_src_win ());
keypad (tui_cmd_win ()->handle.get (), TRUE);
wrefresh (tui_cmd_win ()->handle.get ());
- tui_finish_init = false;
+ tui_finish_init = TRIBOOL_FALSE;
}
else
{
@@ -604,9 +618,7 @@ tui_get_command_dimension (unsigned int *width,
return true;
}
-void _initialize_tui ();
-void
-_initialize_tui ()
+INIT_GDB_FILE (tui)
{
struct cmd_list_element **tuicmd;
diff --git a/gdb/tui/tui.h b/gdb/tui/tui.h
index 319bd2e..3a9d955 100644
--- a/gdb/tui/tui.h
+++ b/gdb/tui/tui.h
@@ -1,6 +1,6 @@
/* External/Public TUI Header File.
- Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.