]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Add a quit to maint_print_all_sections
authorTom Tromey <tromey@adacore.com>
Tue, 4 Mar 2025 13:48:47 +0000 (06:48 -0700)
committerTom Tromey <tromey@adacore.com>
Thu, 6 Mar 2025 21:07:45 +0000 (14:07 -0700)
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 <guinevere@redhat.com>
gdb/maint.c

index 4fc70d7d0d8dd15379b58daeb2df0b8cb33089a7..48de2079e0e418b12786e42238556417dce18939 100644 (file)
@@ -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)