From f1e591b0c97a9a5680c150bd27694cea3f5ac1e8 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 4 Aug 2025 09:01:56 -0600 Subject: [PATCH] Do not include cleanups.h from common-defs.h Most code doesn't use cleanups any more, so remove the include of cleanups.h from common-defs.h, and then only include that file where it is truly needed. Approved-By: Simon Marchi --- gdb/compile/compile.c | 1 + gdb/debuginfod-support.c | 1 + gdb/run-on-main-thread.c | 1 + gdb/top.c | 1 + gdb/value.c | 1 + gdbsupport/common-defs.h | 1 - 6 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c index 229e155ef2e..5d81ec12b71 100644 --- a/gdb/compile/compile.c +++ b/gdb/compile/compile.c @@ -45,6 +45,7 @@ #include "gdbsupport/pathstuff.h" #include "gdbsupport/scoped_ignore_signal.h" #include "gdbsupport/buildargv.h" +#include "gdbsupport/cleanups.h" /* Hold "compile" commands. */ diff --git a/gdb/debuginfod-support.c b/gdb/debuginfod-support.c index 8f28fd53871..e99c13bc569 100644 --- a/gdb/debuginfod-support.c +++ b/gdb/debuginfod-support.c @@ -18,6 +18,7 @@ #include "diagnostics.h" #include +#include "gdbsupport/cleanups.h" #include "gdbsupport/scoped_fd.h" #include "debuginfod-support.h" #include diff --git a/gdb/run-on-main-thread.c b/gdb/run-on-main-thread.c index 30b0928778d..bf53163b6b7 100644 --- a/gdb/run-on-main-thread.c +++ b/gdb/run-on-main-thread.c @@ -22,6 +22,7 @@ #include #include #endif +#include "gdbsupport/cleanups.h" #include "gdbsupport/event-loop.h" /* The serial event used when posting runnables. */ diff --git a/gdb/top.c b/gdb/top.c index 72d19530070..b097683e613 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -34,6 +34,7 @@ #include "value.h" #include "language.h" #include "terminal.h" +#include "gdbsupport/cleanups.h" #include "gdbsupport/job-control.h" #include "annotate.h" #include "completer.h" diff --git a/gdb/value.c b/gdb/value.c index 5574642bc33..82d9a86e372 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -45,6 +45,7 @@ #include #include #include "completer.h" +#include "gdbsupport/cleanups.h" #include "gdbsupport/selftest.h" #include "gdbsupport/array-view.h" #include "cli/cli-style.h" diff --git a/gdbsupport/common-defs.h b/gdbsupport/common-defs.h index cfdefe19ce0..8d7e2a9353c 100644 --- a/gdbsupport/common-defs.h +++ b/gdbsupport/common-defs.h @@ -216,7 +216,6 @@ #include "errors.h" #include "print-utils.h" #include "common-debug.h" -#include "cleanups.h" #include "common-exceptions.h" #include "gdbsupport/poison.h" -- 2.47.3