Skip to content

Add objects subcommand#850

Open
meck-gd wants to merge 2 commits into
benfred:masterfrom
GDATAAdvancedAnalytics:objects-subcommand
Open

Add objects subcommand#850
meck-gd wants to merge 2 commits into
benfred:masterfrom
GDATAAdvancedAnalytics:objects-subcommand

Conversation

@meck-gd

@meck-gd meck-gd commented May 8, 2026

Copy link
Copy Markdown

I found that this project has extensive capabilities for accessing object attributes and pretty-printing values of many different types, but it was only being used for printing locals in a stack frame and for some thread introspection. The potential for other uses is immense.

This PR adds a new command called objects, which allows introspection into live objects of an interpreter instance by walking the GC. It's supported for both, active processes and core dumps. All Python versions with active support are covered. Prior to 3.9, GC structures looked a bit different.

Use cases:

  • Debugging: What instances of a specific type are there and what values do specific attributes in them have?
  • Forensics: Access runtime values in a Python process dump (possibly taken from a full system memory dump), e.g., to inspect malware.

A potential future extension could be to take an object address and print its entire attribute dict.

meck-gd added 2 commits May 8, 2026 18:44
This command allows you to get a list of all GC-registered objects
and to query specific atttribute values for debugging.
@meck-gd
meck-gd force-pushed the objects-subcommand branch from 89253f8 to e712f55 Compare May 11, 2026 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant