Skip to content

Tags: PythonCheatsheet/drgn

Tags

v0.0.8

Toggle v0.0.8's commit message
drgn 0.0.8

This release contains a couple of new features, some
backwards-incompatible API changes, some fixes, and a lot of internal
improvements and preparatory work for upcoming features.

New features:

* Helpers are now annotated with type hints.
* Program[] and Program.object() now have partial support for finding
  objects in C++ namespaces (e.g., Program["foo::bar"]).

API changes:

* drgn.Type objects are now associated with a drgn.Program. The program
  can be accessed as Type.prog. This is preparation for supporting C++
  templates, methods, and static members.
* The type factory functions are replaced with drgn.Program methods. In
  particular, Program.pointer_type() is now consistent with the other
  factory methods: it no longer accepts the referenced type as a string,
  but it now accepts an optional size.
* The element type is now the first parameter to Program.array_type()
* The qualifiers parameter to the type factory methods is now a
  keyword-only argument.
* The qualifiers parameter can no longer be passed as None. Use
  Qualifiers.NONE instead.
* The Program.object() flags parameter can no longer be passed as None.
  Use FindObjectFlags.ANY instead.

Fixes:

* Loaded modules in a core dump are now correctly determined on Linux
  5.8 and newer.
* Type.__eq___() now properly compares unnamed members.
* We no longer depend on pkg_resources at runtime, which also improves
  startup time.
* A couple of minor memory leaks and use-after-free bugs were fixed.

Internals:

* The debug information tracking code has been generalized in
  preparation for supporting local variables and arguments in stack
  traces.
* Kernel module support is now automatically tested as part of our
  virtual machine testing.
* Python code style and type checking is now enforced on Travis.
* Documentation generation now supports overloads, relative imports, and
  aliases, among other improvements.

v0.0.7

Toggle v0.0.7's commit message
drgn 0.0.7

This is a tiny release fixing an issue in the README which prevented the
package from being uploaded to PyPI.

v0.0.6

Toggle v0.0.6's commit message
drgn 0.0.6

There is a lot of work currently in progress, so this is a smaller
release.

This release has a few user-facing changes:

* Linux kernel stack traces of tasks that are executing in userspace are
  now correctly handled instead of returning garbage from the kernel
  stack. (As a result, tasks which are in the middle of context
  switching are no longer detected.)
* Variables which the compiler emits as constants can now be accessed.
* Variables with non-default byte order are now handled.
* The kaslr_offset() Linux kernel helper was added.
* Type.__eq__() was fixed to compare Type.language.

Internals:

* Several fixes and improvements were made to the F14 hash table
  implementation, including support for the vector storage policy.
* CONTRIBUTING.rst was added, documenting coding style, testing, and
  more.

v0.0.5

Toggle v0.0.5's commit message
drgn 0.0.5

This release improves the memory access interface:

* Linux kernel virtual address translation was added.
* Helpers to access userspace memory using the new address translation
  support were added: access_process_vm(), access_remote_vm(),
  cmdline(), and environ().
* Support for reading special memory regions (like vmalloc/vmap/percpu)
  from ELF files using the new address translation support instead of
  libkdumpfile was added.
* DRGN_USE_LIBKDUMPFILE_FOR_ELF now defaults to 0. If everything goes
  well with the new address translation support, support for using
  libkdumpfile for ELF files will be removed entirely in a release or
  two.
* Support for reading from physical memory on pre-4.11 kernels was
  added.
* read_u8(), read_u16(), read_u32(), read_u64(), and read_word()
  shortcut methods were added to the Program class.

This release also fixes a couple of stack tracing bugs:

* Stack traces involving "noreturn" functions can now be traced and
  symbolized.
* Several edge cases of Linux kernel stack traces are now handled,
  including the idle task and tasks in the middle of context switching.

v0.0.4

Toggle v0.0.4's commit message
drgn 0.0.4

This release contains a grab bag of user-facing improvements:

* The Language class was added.
* The language of the program is now detected (currently C or C++) and
  accessible as prog.lang. (However, we don't support C++-specific
  features yet.)
* The first official drgn-powered tool was added ("bpf_inspect.py").
  The vision is for the drgn repository to contain a suite of system
  analysis/monitoring tools, similar to BCC.
* Type hints were added to the core library. (Helpers are not yet
  annotated, as there will need to be some exploration on how that would
  interact with type checking of drgn Objects.)
* Stack traces of running threads from a kdump are now available
  (previously this was only supported for ELF dumps).
* Debug information using DW_TAG_partial_unit (usually resulting from
  some sort of post-processing) can now be used.
* Object.__getattribute__() (i.e., the "." operator) was made 2x faster
  on Python >= 3.7.

There were several bug fixes, including:

* The Linux kernel memory-management helpers were updated for newer
  x86-64 kernels without KASLR and 5-level paging.
* The CLI no longer fails if the history file can't be read or written
  (which can occur when drgn was previously run with a sudo
  configuration that preserves $HOME).
* drgn (actually, libelf) now properly handles ELF core dumps with >=
  2^16 segments.

Internals:

* The documentation system was reworked to support type hints.
* The virtual machine testing setup was replaced.
* Some preparations were made to support C++ template parameters.

v0.0.3

Toggle v0.0.3's commit message
drgn 0.0.3

This release makes several user-facing improvements.

API:

* Fault reporting was improved: FaultError now records the address that
  couldn't be accessed, and OutOfBoundsError was added to distinguish
  between invalid addresses and out of bounds accesses of a value
  object.
* Program.symbol() can now find global ELF symbols by name.
* Backwards-incompatible change: Type.members, Type.enumerators, and
  Type.parameters are now sequences of TypeMember, TypeEnumerator, and
  TypeParameter, respectively, instead of tuples.

Linux kernel support:

* New helpers for finding and iterating user_structs.
* New helper for getting kconfig.
* UTS_RELEASE (i.e., `uname -r`) can now be accessed directly from the
  vmcoreinfo before debug info is loaded.

Fixes:

* StackFrame.register()/StackFrame.registers() can now access registers
  of stack frames without valid debug info when possible.
* We no longer leak the libkdumpfile context.

v0.0.2

Toggle v0.0.2's commit message
drgn 0.0.2

The only user-facing changes in this release are the new BPF
helpers/examples and a fix for the tcp_sock example. Other than that,
this release makes several improvements to the build system.

v0.0.1

Toggle v0.0.1's commit message
drgn 0.0.1

This is the first official release of drgn. It does not mark any major
milestone; rather, it's about time we get on PyPI and such. This also
does not guarantee stability of the API yet. I don't expect any major
changes to the core Program and Object APIs, but the auxiliary
interfaces will likely change before 1.0.0.