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.
Unified · Split
| @@ -196,7 +196,7 @@ def get_gdbserver_type(): · 195 unmodified lines | ||
| 196 | 196 | def probe_kgdb(): |
| 197 | 197 | try: |
| 198 | 198 | thread_info = gdb.execute("info thread 2", to_string=True) |
| 199 | − return "shadowCPU0" in thread_info | |
| 199 | + return "shadowCPU" in thread_info | |
| 200 | 200 | except gdb.error: |
| 201 | 201 | return False |
| 202 | 202 | |