Skip to contentSkip to conversation

scripts-gdb-symbols-factor-out-pagination_off.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message May 21, 2025

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: scripts/gdb/symbols: factor out pagination_off()
has been removed from the -mm tree. Its filename was
scripts-gdb-symbols-factor-out-pagination_off.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Ilya Leoshkevich <[email protected]>
Subject: scripts/gdb/symbols: factor out pagination_off()
Date: Thu, 15 May 2025 17:52:12 +0200

Move the code that turns off pagination into a separate function. It will be useful later in order to prevent hangs when loading symbols for kernel image in physical memory during s390 early boot.

---

 scripts/gdb/linux/symbols.py |   20 +++++++-------------
 scripts/gdb/linux/utils.py   |   11 +++++++++++
 2 files changed, 18 insertions(+), 13 deletions(-)
scripts/gdb/linux/symbols.py renamed from scripts/gdb/linux/symbols.py~scripts-gdb-symbols-factor-out-pagination_off +7 -13
@@ -38,19 +38,13 @@ if hasattr(gdb, 'Breakpoint'):
             # Disable pagination while reporting symbol (re-)loading.
             # The console input is blocked in this context so that we would
             # get stuck waiting for the user to acknowledge paged output.
-            show_pagination = gdb.execute("show pagination", to_string=True)
-            pagination = show_pagination.endswith("on.\n")
-            gdb.execute("set pagination off")
-
-            if module_name in cmd.loaded_modules:
-                gdb.write("refreshing all symbols to reload module "
-                          "'{0}'\n".format(module_name))
-                cmd.load_all_symbols()
-            else:
-                cmd.load_module_symbols(module)
-
-            # restore pagination state
-            gdb.execute("set pagination %s" % ("on" if pagination else "off"))
+            with utils.pagination_off():
+                if module_name in cmd.loaded_modules:
+                    gdb.write("refreshing all symbols to reload module "
+                              "'{0}'\n".format(module_name))
+                    cmd.load_all_symbols()
+                else:
+                    cmd.load_module_symbols(module)
 
             return False
 
scripts/gdb/linux/utils.py renamed from scripts/gdb/linux/utils.py~scripts-gdb-symbols-factor-out-pagination_off +11 -0
@@ -260,3 +260,14 @@ def get_vmlinux():
             obj.filename.endswith('vmlinux.debug')):
             vmlinux = obj.filename
     return vmlinux
+
+
[email protected]
+def pagination_off():
+    show_pagination = gdb.execute("show pagination", to_string=True)
+    pagination = show_pagination.endswith("on.\n")
+    gdb.execute("set pagination off")
+    try:
+        yield
+    finally:
+        gdb.execute("set pagination %s" % ("on" if pagination else "off"))

_

Patches currently in -mm which might be from [email protected] are