Skip to content
drgn 0.0.17

New features:

- A new API representing threads was added. The `Thread` class represents a thread. `Thread.stack_trace()` returns the stack trace for the thread. `Program.threads()` returns an iterator over the threads in the program. `Program.thread()` returns a thread given its thread ID. `Program.main_thread()` returns the main thread of the program. `Program.crashed_thread()` returns the thread that caused the program to crash. Contributed by Kevin Svetlitski and Mykola Lysenko.
- `Program.symbols()` was added. It returns all ELF symbols in the program, optionally filtered by a name or address. Contributed by Stephen Brennan.
- Support for looking up C++ classes with `Program.type()` was added. Contributed by Mykola Lysenko.
- Support for setting the default program language (`Program.language`) was added.
- Helpers for getting the Linux kernel log buffer were added (`drgn.helpers.linux.printk.get_printk_records()` and `drgn.helpers.linux.printk.get_dmesg()`). Contributed by Alex Zhu.
- Helpers for translating between Linux kernel socket objects and inode objects were added (`drgn.helpers.linux.net.SOCKET_I()` and `drgn.helpers.linux.net.SOCK_INODE()`). Contributed by Peilin Ye.
- A helper for getting the Linux kernel's idle tasks was added (`drgn.helpers.linux.sched.idle_task()`).
- A helper for decoding Linux kernel `struct page` flags was added (`drgn.helpers.linux.mm.decode_page_flags()`).
- Generic helpers for decoding flags were added (`drgn.helpers.decode_flags()` and `drgn.helpers.decode_enum_type_flags()`).

Bug fixes:

- A crash when encountering kernel modules processed by `objcopy --only-keep-debug` was fixed. Contributed by Peilin Ye.
- An endianness bug when debugging kernel modules that use a different byte order than the host was fixed.
- A compilation error on older versions of GCC was fixed. Contributed by Alakesh Haloi.
- libdrgn is now linked against libm to fix undefined references to `rint`.
- `drgn.helpers.linux.percpu.per_cpu_ptr()` was fixed to support !SMP kernels.
- A `TypeError` when `drgn.helpers.linux.rbtree.rb_find()` doesn't find a match was fixed.
- A memory leak when using an invalid `TypeTemplateParameter` was fixed.
- A missing type annotation for `drgn.Language.CPP` was added.
- `drgn_stack_trace_destroy()` was fixed to allow a `NULL` argument like other `destroy()` functions.

Other improvements:

- Linux kernel support was tested up to v5.17-rc6.
- The CLI now diagnoses the common mistake of passing a core dump file where a script is expected.
- `drgn.helpers.linux.list.list_for_each_entry()`, `drgn.helpers.linux.list.list_for_each_entry_reverse()`, `drgn.helpers.linux.list.hlist_for_each_entry()`, `drgn.helpers.linux.list_nulls.hlist_nulls_for_each_entry()`, and `drgn.helpers.linux.rbtree.rbtree_inorder_for_each_entry()` were optimized to only look up the entry type once per call.
- Parsing of type names in `Program.type()` was slightly optimized.
- Lookups of built-in kernel variables (e.g., `UTS_RELEASE`, `PAGE_SIZE`) were slightly optimized.
- `Program.type()` now accepts a `Type`. This makes it easier to write helpers that accept a type name or a `Type`.

Build system:

- Python is now required to build libdrgn even if the Python bindings are disabled.
- GNU Awk is no longer required to build drgn.
- Additional compiler warnings are now enabled by default. Developers should enable them as errors.
- Configuration options for developers to enable ASan (contributed by Kevin Svetlitski) and UBSan were added.

Internal:

- Developer documentation was improved.
- [`pre-commit`](https://pre-commit.com/) was configured to enforce coding standards. Contributed by Stephen Brennan.
- s390x and EPEL 9 builds were enabled on Packit. Contributed by Davide Cavalca.
- Test cases using `/proc/vmcore` in a kdump environment were added. Contributed by Kevin Svetlitski.
- Test cases for the Linux kernel red-black tree and linked list helpers were added.