xref: /freebsd/sys/tools/gdb/selftest.py (revision ea675a43f09ba569adf1dd17b4f1ced970e48de4)
1#
2# Copyright (c) 2025 Mark Johnston <markj@FreeBSD.org>
3#
4# SPDX-License-Identifier: BSD-2-Clause
5#
6
7import gdb
8
9cmds = ["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
21for 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.
31print("Everything seems OK")
32