From 8ebb6fcd0755717f7c2dd9ff7623e8199b0a88d5 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 10 Jun 2024 10:43:10 +0200 Subject: 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 Reported-By: Tom de Vries Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31865 --- gdb/tui/tui-win.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gdb') 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 #include "readline/readline.h" +#include #include static void tui_set_tab_width_command (const char *, int); -- cgit v1.1