Skip to content
drgn 0.0.22

This release adds new stack trace features, lots of helpers (especially for memory management), partial s390x support, C++ improvements, important bug fixes, and more. It is also the first release licensed under the LGPLv2.1+.

Miscellaneous:

- drgn is now licensed as LGPLv2.1+ instead of GPLv3+. The goal of the more permissive license is to encourage building tools on top of drgn (like [Object Introspection](https://facebookexperimental.github.io/object-introspection/)).
- The `contrib` directory was added as a place to share scripts with minimal requirements. This also replaces the `examples` directory.
- Support for Linux 4.4 (which has been EOL since February 2022) is no longer being actively tested. Most of drgn will continue to work on Linux 4.4 for the time being, but it is likely to stop working soon. The oldest kernel version officially supported by drgn is now 4.9.

New features:

- The `StackFrame.locals()` method was added. It lists all of the arguments and local variables in the scope of a stack frame. Contributed by Stephen Brennan.
- The `StackFrame.sp` attribute was added. This is a generic way to get the stack pointer of a stack frame on any architecture.
- Helpers for XArrays were added in `drgn.helpers.linux.xarray`: `xa_load()`, `xa_for_each()`, `xa_is_value()`, `xa_to_value()`, and `xa_is_zero()`.
- The `drgn.helpers.linux.slab.get_slab_aliases()` helper was added. It identifies which slab caches are merged. Contributed by Stephen Brennan.
- The `drgn.helpers.linux.slab.slab_object_info()` helper was added. It returns what slab cache a pointer is from, its offset from the beginning of the slab object, and whether it is allocated or free.
- The `drgn.helpers.common.memory.identify_address()` helper now includes additional information for slab addresses: the offset from the beginning of the slab object and whether it is allocated or free.
- The `drgn.helpers.common.stack.print_annotated_stack()` helper was added. It prints the contents of stack memory in a stack trace, annotating each word that can be identified as an address. Contributed by Nhat Pham.
- Support for Linux kernel modules and stack unwinding on s390x was added. Contributed by Sven Schnelle.
- Partial support for looking up types with C++ template arguments was added. For now, the arguments must be spelled exactly as the compiler spells them in the debug info. Contributed by Kevin Svetlitski.
- Parsing debug info for C++ template parameter packs was added. Contributed by Alastair Robertson.

Bug fixes:

- A bug that caused stack unwinding to fail when an executable contained `.eh_frame` but its DWARF information was in a separate file was fixed.
- A bug that caused x86-64 stack unwinding without call frame information to stop on a function with a frame pointer if its caller doesn't use frame pointers was fixed. This affected, for example, BPF programs in a Linux kernel using ORC.
- Linux kernel stack unwinding on ppc64 was fixed for kernel versions newer than 5.10 or older than 4.20.
- The CLI's interactive mode was fixed to allow importing modules from the current directory.
- Missing type annotations required for `len(StackTrace)` and `iter(StackTrace)` were added. Contributed by Nhat Pham.
- A potential segfault (not encountered in practice) when parsing invalid DWARF information for an enum type was fixed.
- Leaks in error cases of `Program.type()` and `Program.object()` were fixed.
- The `drgn.helpers.common.memory.identify_address()` helper was fixed to gracefully handle architectures that we haven't implemented virtual address translation for.
- Parsing of DWARF pointer types without a size was fixed to default to the DWARF unit's address size instead of the program's default size.
- Lookups of type names beginning with `size_t` or `ptrdiff_t` were fixed to look up the full name and not those prefixes.

Other improvements:

- Linux kernel support was tested up to Linux 6.2-rc2.
- Python support was tested up to Python 3.11.
- The CLI warning for missing debug info was made more prominent.
- The CLI now prints nicer error messages for common errors like running without root permissions.
- Documentation for the `drgn.helpers.linux.mm.for_each_page()` helper was improved to mention how `FaultError` should be handled.
- drgn can now be built against a libc without `qsort_r()` (e.g., musl < 1.2.3). Contributed by Boris Burkov.

Internals:

- Various tests for kconfig helpers, radix tree helpers, and stack traces were added or improved.
- Tracking of executable and debug info files was separated from libdwfl more.
- Documentation for new architecture support was expanded.