]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ddb: Add CTF-based pretty printing
authorBojan Novković <bnovkov@FreeBSD.org>
Fri, 22 Mar 2024 03:01:34 +0000 (04:01 +0100)
committerBojan Novković <bnovkov@FreeBSD.org>
Fri, 22 Mar 2024 03:03:33 +0000 (04:03 +0100)
commitc21bc6f3c2425de74141bfee07b609bf65b5a6b3
tree06b3412042dd10e0edb1f6f29140856aeaf65a2a
parent312a05c39e5fd79b37ee6f922462232797f56a2a
ddb: Add CTF-based pretty printing

Add basic CTF support and a CTF-powered pretty-printer to ddb.

The db_ctf.* files expose a basic interface for fetching type
data for ELF symbols, interacting with the CTF string table,
and translating type identifiers to type data.

The db_pprint.c file uses those interfaces to implement
a pretty-printer for all kernel ELF symbols.
The pretty-printer works with symbol names and arbitrary addresses:
pprint struct thread 0xffffffff8194ad90

Pretty-printing currently only works after the root filesystem
gets mounted because the CTF info is not available during
early boot.

Differential Revision: https://reviews.freebsd.org/D37899
Approved by: markj (mentor)
13 files changed:
share/man/man4/ddb.4
sys/conf/files
sys/ddb/db_command.c
sys/ddb/db_ctf.c [new file with mode: 0644]
sys/ddb/db_ctf.h [new file with mode: 0644]
sys/ddb/db_pprint.c [new file with mode: 0644]
sys/ddb/ddb.h
sys/kern/kern_ctf.c
sys/kern/kern_linker.c
sys/kern/link_elf.c
sys/kern/link_elf_obj.c
sys/kern/linker_if.m
sys/sys/linker.h