| #
ea675a43
|
| 03-Oct-2025 |
Mark Johnston <markj@FreeBSD.org> |
libexec/kgdb: Add new modules and install them together with debug info
This change simplifies integration of gdb python scripts with our kernel debugging infrastructure. Rather than putting debugg
libexec/kgdb: Add new modules and install them together with debug info
This change simplifies integration of gdb python scripts with our kernel debugging infrastructure. Rather than putting debugging scripts in /usr/libexec/kgdb, move them to <path-to-kernel-debug-symbols>/gdb, and add a kernel-gdb.py which automatically loads modules from that directory. kernel-gdb.py will be automatically executed by kgdb when loading kernel debug symbols (assuming a default configuration), so one no longer needs to do anything to use these modules.
The change also adds a couple of new modules, vnet.py and pcpu.py, for conveniently accessing VNET symbols and PCPU/DPCPU fields, respectively. Note that these require a change to the kernel linker when accessing symbols from a loadable kernel module.
sys/tools/gdb/README.txt describes the scheme in more detail and provides some rudiementary documentation for the commands and functions added by these modules. It should be updated when adding new features.
sys/tools/gdb/selftest.py can be used to do some primitive testing of the modules. All it does is execute a number of gdb commands making use of commands and functions added by these modules. The developer is expected to verify that the commands complete without errors and that the output looks sane.
Discussed with: kp, avg, jhb, glebius MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50825
show more ...
|
| #
2524b7df
|
| 15-Jan-2024 |
Mark Johnston <markj@FreeBSD.org> |
crashinfo: Print stack traces for all on-CPU threads
Add a python script which implements the bulk of this functionality. Over time, this would ideally evolve into a library of python routines which
crashinfo: Print stack traces for all on-CPU threads
Add a python script which implements the bulk of this functionality. Over time, this would ideally evolve into a library of python routines which can be used to inspect kernel data structures and automate some debugging tasks, similar to jhb's out-of-tree scripts, but written in a somewhat nicer language and with better integration into the kgdb command prompt.
Note that kgdb currently won't auto-load scripts in this directory. This should perhaps change in the future. It probably also makes more sense to have a crashinfo.py which provides all the kgdb output that we want to include in core.txt, rather than having crashinfo.sh pipe in several commands.
Reviewed by: avg, imp Discussed with: jhb MFC after: 3 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33817
show more ...
|