summaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/utils.py
diff options
context:
space:
mode:
authorThomas Hellström <thomas.hellstrom@linux.intel.com>2025-06-09 18:26:55 +0200
committerThomas Hellström <thomas.hellstrom@linux.intel.com>2025-06-09 18:54:05 +0200
commit86e2d052c2320bf12571a5d96b16c2745e1cfc5e (patch)
treeddd7e116a07fc3126c1941a46c74257a0adae333 /scripts/gdb/linux/utils.py
parentb5735e5e7102683038a1c18d7c8d982c2aef4f8d (diff)
parent19272b37aa4f83ca52bdf9c16d5d81bdd1354494 (diff)
Merge drm/drm-next into drm-xe-next
Backmerging to bring in 6.16 Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Diffstat (limited to 'scripts/gdb/linux/utils.py')
-rw-r--r--scripts/gdb/linux/utils.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/scripts/gdb/linux/utils.py b/scripts/gdb/linux/utils.py
index 03ebdccf5f69..e11f6f67961a 100644
--- a/scripts/gdb/linux/utils.py
+++ b/scripts/gdb/linux/utils.py
@@ -200,7 +200,7 @@ def get_gdbserver_type():
def probe_kgdb():
try:
- thread_info = gdb.execute("info thread 2", to_string=True)
+ thread_info = gdb.execute("info thread 1", to_string=True)
return "shadowCPU" in thread_info
except gdb.error:
return False
@@ -251,3 +251,23 @@ def parse_vmcore(s):
else:
kerneloffset = int(match.group(1), 16)
return VmCore(kerneloffset=kerneloffset)
+
+
+def get_vmlinux():
+ vmlinux = 'vmlinux'
+ for obj in gdb.objfiles():
+ if (obj.filename.endswith('vmlinux') or
+ obj.filename.endswith('vmlinux.debug')):
+ vmlinux = obj.filename
+ return vmlinux
+
+
+@contextlib.contextmanager
+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"))