aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Rommel <[email protected]>2024-04-25 17:34:58 +0200
committerAndrew Morton <[email protected]>2024-05-08 08:41:27 -0700
commitec0b6d17a5f89da2182ec8e2f978c20bbedf6ae2 (patch)
tree04c78e098a14c07147c920660471366b1294bd5c
parent22bcc915ae910bc823d8351542f6d9e7623fff24 (diff)
scripts/gdb: fix failing KGDB detection during probe
Patch series "scripts/gdb: Fixes for $lx_current and $lx_per_cpu". This series fixes several bugs in the GDB scripts related to the $lx_current and $lx_per_cpu functions. The changes were tested with GDB 10, 11, 12, 13, and 14. Patch 1 fixes false-negative results when probing for KGDB Patch 2 fixes the $lx_per_cpu function, which is currently non-functional in QEMU-GDB and KGDB. Patch 3 fixes an additional bug in $lx_per_cpu that occurs with KGDB. Patch 4 fixes the incorrect detection of the current CPU number in KGDB, which silently breaks $lx_per_cpu and $lx_current. This patch (of 4): The KGDB probe function sometimes failed to detect KGDB for SMP machines as it assumed that task 2 (kthreadd) is running on CPU 0, which is not necessarily the case. Now, the detection is agnostic to kthreadd's CPU. Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Florian Rommel <[email protected]> Cc: Andrew Jones <[email protected]> Cc: Deepak Gupta <[email protected]> Cc: Jan Kiszka <[email protected]> Cc: Kieran Bingham <[email protected]> Cc: Kuan-Ying Lee <[email protected]> Cc: Palmer Dabbelt <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r--scripts/gdb/linux/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/gdb/linux/utils.py b/scripts/gdb/linux/utils.py
index 7d5278d815fa..245ab297ea84 100644
--- a/scripts/gdb/linux/utils.py
+++ b/scripts/gdb/linux/utils.py
@@ -196,7 +196,7 @@ def get_gdbserver_type():
def probe_kgdb():
try:
thread_info = gdb.execute("info thread 2", to_string=True)
- return "shadowCPU0" in thread_info
+ return "shadowCPU" in thread_info
except gdb.error:
return False