Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-src
Path: blob/main/sys/tools/kernel-gdb.py
102957 views
1
#
2
# Copyright (c) 2025 Mark Johnston <[email protected]>
3
#
4
# SPDX-License-Identifier: BSD-2-Clause
5
#
6
7
import importlib
8
import os
9
import sys
10
11
sys.path.append(os.path.join(os.path.dirname(__file__), "gdb"))
12
13
modules = [
14
"acttrace",
15
"freebsd",
16
"pcpu",
17
"vnet"
18
]
19
20
21
def reload_modules(modules):
22
for mod in modules:
23
if mod in sys.modules:
24
importlib.reload(sys.modules[mod])
25
else:
26
importlib.import_module(mod)
27
28
reload_modules(modules)
29
30
31
class reload(gdb.Command):
32
"""
33
Reload the FreeBSD kernel GDB helper scripts.
34
"""
35
def __init__(self):
36
super(reload, self).__init__("kgdb-reload", gdb.COMMAND_USER)
37
38
def invoke(self, arg, from_tty):
39
reload_modules(modules)
40
41
42
# Register the reload command with gdb.
43
reload()
44
45