Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-src
Path: blob/main/sys/tools/gdb/selftest.py
39476 views
1
#
2
# Copyright (c) 2025 Mark Johnston <[email protected]>
3
#
4
# SPDX-License-Identifier: BSD-2-Clause
5
#
6
7
import gdb
8
9
cmds = ["acttrace",
10
"p $V(\"tcbinfo\")",
11
"p $V(\"tcbinfo\", vnet0)",
12
"p $V(\"pf_status\")",
13
"p $V(\"pf_status\", \"gdbselftest\")",
14
"p $PCPU(\"curthread\")",
15
"p $PCPU(\"curthread\", 0)",
16
"p/x $PCPU(\"hardclocktime\", 1)",
17
"p $PCPU(\"pqbatch\")[0][0]",
18
"p $PCPU(\"ss\", 1)",
19
]
20
21
for cmd in cmds:
22
try:
23
print(f"Running command: '{cmd}'")
24
gdb.execute(cmd)
25
except gdb.error as e:
26
print(f"Command '{cmd}' failed: {e}")
27
break
28
29
# We didn't hit any unexpected errors. This isn't as good as actually
30
# verifying the output, but it's better than nothing.
31
print("Everything seems OK")
32
33