diff options
| author | Mark Johnston <markj@FreeBSD.org> | 2025-11-19 13:58:11 +0000 |
|---|---|---|
| committer | Mark Johnston <markj@FreeBSD.org> | 2025-11-19 14:00:05 +0000 |
| commit | 32605b159f3fea3a5d4710055681650f3de9ea68 (patch) | |
| tree | 420a37b54b34312742f43c5728d04d00aa7f9d47 | |
| parent | 007679a138089676aadc9a712277f4004403b905 (diff) | |
gdb: Fix some PEP 8 violations
Silence some warnings in my editor. No functional change intended.
MFC after: 1 week
| -rw-r--r-- | sys/tools/gdb/acttrace.py | 2 | ||||
| -rw-r--r-- | sys/tools/gdb/freebsd.py | 3 | ||||
| -rw-r--r-- | sys/tools/gdb/pcpu.py | 3 | ||||
| -rw-r--r-- | sys/tools/gdb/vnet.py | 3 |
4 files changed, 10 insertions, 1 deletions
diff --git a/sys/tools/gdb/acttrace.py b/sys/tools/gdb/acttrace.py index fdd18a4833cd..da79fda59da1 100644 --- a/sys/tools/gdb/acttrace.py +++ b/sys/tools/gdb/acttrace.py @@ -11,11 +11,13 @@ import gdb from freebsd import * from pcpu import * + class acttrace(gdb.Command): """ Print the stack trace of all threads that were on-CPU at the time of the panic. """ + def __init__(self): super(acttrace, self).__init__("acttrace", gdb.COMMAND_USER) diff --git a/sys/tools/gdb/freebsd.py b/sys/tools/gdb/freebsd.py index 81ea60373348..f88eef876c7f 100644 --- a/sys/tools/gdb/freebsd.py +++ b/sys/tools/gdb/freebsd.py @@ -6,6 +6,7 @@ import gdb + def symval(name): sym = gdb.lookup_global_symbol(name) if sym is None: @@ -72,4 +73,6 @@ def tdfind(tid, pid=-1): tdfind.cached_threads[int(ntid)] = td if ntid == tid: return td + + tdfind.cached_threads = dict() diff --git a/sys/tools/gdb/pcpu.py b/sys/tools/gdb/pcpu.py index 94c451e6eca5..08ae81e5121e 100644 --- a/sys/tools/gdb/pcpu.py +++ b/sys/tools/gdb/pcpu.py @@ -7,6 +7,7 @@ import gdb from freebsd import * + class pcpu(gdb.Function): """ A function to look up PCPU and DPCPU fields by name. @@ -16,6 +17,7 @@ class pcpu(gdb.Function): omitted, and the currently selected thread is on-CPU, that CPU is used, otherwise an error is raised. """ + def __init__(self): super(pcpu, self).__init__("PCPU") @@ -73,5 +75,6 @@ class pcpu(gdb.Function): obj = gdb.Value(pcpu_base + pcpu_entry_addr - start + base) return obj.cast(pcpu_entry.type.pointer()).dereference() + # Register with gdb. pcpu() diff --git a/sys/tools/gdb/vnet.py b/sys/tools/gdb/vnet.py index 5f416b2a515a..6175a5d6f551 100644 --- a/sys/tools/gdb/vnet.py +++ b/sys/tools/gdb/vnet.py @@ -5,9 +5,9 @@ # import gdb -import traceback from freebsd import * + class vnet(gdb.Function): """ A function to look up VNET variables by name. @@ -18,6 +18,7 @@ class vnet(gdb.Function): pointer to a struct vnet (e.g., vnet0 or allprison.tqh_first->pr_vnet) or a string naming a jail. """ + def __init__(self): super(vnet, self).__init__("V") |
