diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2024-06-10 10:43:10 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2024-06-10 10:43:10 +0200 |
commit | 8ebb6fcd0755717f7c2dd9ff7623e8199b0a88d5 (patch) | |
tree | 6b6729f9f37c5e541979b2418e714f4128f6e4c2 /gdb | |
parent | 3ee50921cb47f71c62b335cc36d1188e6b6ce1b3 (diff) | |
download | gdb-8ebb6fcd0755717f7c2dd9ff7623e8199b0a88d5.zip gdb-8ebb6fcd0755717f7c2dd9ff7623e8199b0a88d5.tar.gz gdb-8ebb6fcd0755717f7c2dd9ff7623e8199b0a88d5.tar.bz2 |
gdb: re-add necessary includes in tui/tui-win.c
Commit 9102a6c15c75 ("gdb/tui: cleanup includes") broke
gdb.python/tui-window.exp on Linux:
Running /data/vries/gdb/src/gdb/testsuite/gdb.python/tui-window.exp ...
WARNING: timeout in accept_gdb_output
WARNING: timeout in accept_gdb_output
FAIL: gdb.python/tui-window.exp: Window was updated
and caused a build failure on AIX:
CXX tui/tui-win.o
tui/tui-win.c: In function 'void tui_sigwinch_handler(int)':
tui/tui-win.c:532:3: error: 'mark_async_signal_handler' was not declared in this scope; did you mean 'async_signal_handler'?
532 | mark_async_signal_handler (tui_sigwinch_token);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| async_signal_handler
tui/tui-win.c: At global scope:
tui/tui-win.c:538:1: error: variable or field 'tui_async_resize_screen' declared void
538 | tui_async_resize_screen (gdb_client_data arg)
| ^~~~~~~~~~~~~~~~~~~~~~~
tui/tui-win.c:538:26: error: 'gdb_client_data' was not declared in this scope
538 | tui_async_resize_screen (gdb_client_data arg)
| ^~~~~~~~~~~~~~~
tui/tui-win.c: In function 'void tui_initialize_win()':
tui/tui-win.c:579:36: error: 'tui_async_resize_screen' was not declared in this scope
579 | = create_async_signal_handler (tui_async_resize_screen, NULL,
| ^~~~~~~~~~~~~~~~~~~~~~~
tui/tui-win.c:579:7: error: 'create_async_signal_handler' was not declared in this scope; did you mean 'async_signal_handler'?
579 | = create_async_signal_handler (tui_async_resize_screen, NULL,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| async_signal_handler
gmake: *** [Makefile:1947: tui/tui-win.o] Error 1
On Linux, the removal of the signal.h include causes the `#ifdef
SIGWINCH` sections to become inactive. The code builds, but then the
TUI fails to react to terminal size changes. When we add back the
inclusion of signal.h, then we see the same build error as on AIX.
On AIX, I suppose that the SIGWINCH define is still seen by some other
transitive include.
When I go back to before 9102a6c15c75, I don't see async-event.h and
signal.h being marked as unneeded by clangd, so I'm not sure why I
removed them in the first place... I'll be more careful in the future
(files with #ifdef/#ifndef can be tricky w.r.t. determining necessary
includes).
So, re-add the inclusion of signal.h and async-event.h
Change-Id: I3ed385c2dc1726ade2118a5186ea7cccffd12635
Reported-By: Aditya Kamath1 <Aditya.Kamath1@ibm.com>
Reported-By: Tom de Vries <tdevries@suse.de>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31865
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/tui/tui-win.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c index 2f793e2..c67c4f5 100644 --- a/gdb/tui/tui-win.c +++ b/gdb/tui/tui-win.c @@ -24,6 +24,7 @@ Author: Susan B. Macchia */ +#include "async-event.h" #include "command.h" #include "symtab.h" #include "frame.h" @@ -46,6 +47,7 @@ #include "gdb_curses.h" #include <ctype.h> #include "readline/readline.h" +#include <signal.h> #include <string_view> static void tui_set_tab_width_command (const char *, int); |