drgn 0.0.20
This release adds full AArch64 (ARM64) support, a few more helpers, and other small fixes and improvements.
New features:
- Stack traces were implemented for AArch64.
- Virtual address translation was implemented for AArch64.
- Additional registers are now available for the initial stack frame on x86-64:
rflags,es,cs,ss,ds,fs,gs,fs.base,gs.base. - The
lrregister is now available for stack frames on ppc64. - A helper for looking up cgroups by path was added:
drgn.helpers.linux.cgroup.cgroup_get_from_path(). - A helper for walking kernfs paths was added:
drgn.helpers.linux.kernfs.kernfs_walk(). - Helpers for translating to and from physical addresses were added to
drgn.helpers.linux.mm:PFN_PHYS(),PHYS_PFN(),page_to_phys(),phys_to_page(),phys_to_virt(),virt_to_phys(). - Helpers for iterating BTF objects and BPF links were added to
drgn.helpers.linux.bpf:bpf_btf_for_each()andbpf_link_for_each(). Contributed by Quentin Monnet. - Support for UTF character types (e.g.,
char8_t,char16_t,char32_t) was added. Contributed by Kevin Svetlitski. - Support for floating-point reference objects other than 32 or 64 bits was added (values are still not implemented). Contributed by Kevin Svetlitski.
Bug fixes:
drgn -s/--symbols(and the underlyingdrgn.Program.load_debug_info()) now works for kernel module debug info files generated byobjcopy --only-keep-debuginstead of failing with an error.drgn.helpers.linux.slab.slab_cache_for_each_allocated_object()was fixed whenCONFIG_SLAB_FREELIST_HARDENEDis enabled.drgn.helpers.linux.slab.slab_cache_for_each_allocated_object()was fixed when using the SLAB allocator on kernels before v5.17.- The
drgn.helpers.linux.slab.slab_cache_is_merged()helper is now properly added todrgn.helpers.linux.slab.__all__so that it is included indrgn.helpers.linuxand automatically imported in the CLI. - The
cgroup_bpf_prog_for_each()andcgroup_bpf_prog_for_each_effective()helpers indrgn.helpers.linux.bpfwere fixed to support kernels back to v4.10. - The CLI was fixed to add the current directory to
sys.pathwhen running in script mode. Contributed by Logan Gunthorpe. - Missing documentation was added for the
validate_rbtree()andvalidate_rbtree_inorder_for_each_entry()validators indrgn.helpers.linux.rbtree. - An optimization to coalesce virtual address reads (used for vmcore reads and the
access_process_vm()andaccess_remote_vm()helpers indrgn.helpers.linux.mm) was fixed. Previously, the optimization was skipped when it should be used and in rare situations could be used when it shouldn't have been, causing incorrect reads. - A bug when a virtual address read straddles the non-canonical address range on x86-64 was fixed.
- Fallback stack unwinding on ppc64 when debugging information is not available was fixed.
- Reading registers from stack traces with a different byte order was fixed to swap the byte order.
- Automatic lookup of incomplete types was fixed when the type is in a C++ namespace. Contributed by Jay Kamat.
Other improvements:
- Linux kernel support was tested up to Linux v5.19-rc8.
- The address range of kernel modules is now determined more efficiently.
- The
bpf_map_for_each()andbpf_prog_for_each()helpers indrgn.helpers.linux.bpfwere made slightly more efficient by avoiding redundant type lookups. - drgn will now detect a QEMU memory dump without VMCOREINFO and suggest how to get a dump that drgn can use.
Internal:
- The format for defining architecture registers was changed from a custom language to Python.
- The address/
struct pagetranslation helpers indrgn.helpers.linux.mmwere made mostly architecture-agnostic. - The unit tests for the address/
struct pagetranslation helpers indrgn.helpers.linux.mmwere made more thorough. - Unit tests were added for the BPF helpers.