From: Tom Tromey Date: Tue, 4 Mar 2025 13:48:47 +0000 (-0700) Subject: Add a quit to maint_print_all_sections X-Git-Tag: binutils-2_45~1354 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a584cfc980fab6e64b627726df001159732d3bc5;p=thirdparty%2Fbinutils-gdb.git Add a quit to maint_print_all_sections If you have many sections, "maint print sections" can take a very long time (due to a bug). If you happen to "c" at the pagination prompt, this can't be interrupted. This patch adds a QUIT to the loop to at least allow interruption. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32758 Reviewed-By: Guinevere Larsen --- diff --git a/gdb/maint.c b/gdb/maint.c index 4fc70d7d0d8..48de2079e0e 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -40,6 +40,7 @@ #include "gdbsupport/selftest.h" #include "inferior.h" #include "gdbsupport/thread-pool.h" +#include "event-top.h" #include "cli/cli-decode.h" #include "cli/cli-utils.h" @@ -373,6 +374,8 @@ maint_print_all_sections (const char *header, bfd *abfd, objfile *objfile, for (asection *sect : gdb_bfd_sections (abfd)) { + QUIT; + obj_section *osect = nullptr; if (objfile != nullptr)