Skip to content

drgn 0.0.20

Compare
Choose a tag to compare
@osandov osandov released this 26 Jul 00:25
· 854 commits to main since this release

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 lr register 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() and bpf_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 underlying drgn.Program.load_debug_info()) now works for kernel module debug info files generated by objcopy --only-keep-debug instead of failing with an error.
  • drgn.helpers.linux.slab.slab_cache_for_each_allocated_object() was fixed when CONFIG_SLAB_FREELIST_HARDENED is 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 to drgn.helpers.linux.slab.__all__ so that it is included in drgn.helpers.linux and automatically imported in the CLI.
  • The cgroup_bpf_prog_for_each() and cgroup_bpf_prog_for_each_effective() helpers in drgn.helpers.linux.bpf were fixed to support kernels back to v4.10.
  • The CLI was fixed to add the current directory to sys.path when running in script mode. Contributed by Logan Gunthorpe.
  • Missing documentation was added for the validate_rbtree() and validate_rbtree_inorder_for_each_entry() validators in drgn.helpers.linux.rbtree.
  • An optimization to coalesce virtual address reads (used for vmcore reads and the access_process_vm() and access_remote_vm() helpers in drgn.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() and bpf_prog_for_each() helpers in drgn.helpers.linux.bpf were 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 page translation helpers in drgn.helpers.linux.mm were made mostly architecture-agnostic.
  • The unit tests for the address/struct page translation helpers in drgn.helpers.linux.mm were made more thorough.
  • Unit tests were added for the BPF helpers.