Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ok, so I know that this was a joke, but it's... still kinda useful. I think the
print_type_report()
function is genuinely helpful (though it could probably do a bit better at representing the type). Also, I've added an undocumented--debug-self
option which will create aProgram
pointing at the current task, and initialize a variableoot
(object of test) to represent the program that drgn launched as part of the CLI. With that, you can actually quite quickly do some useful analysis.I added these helpers to the docs, but I put them into a separate page named "Development Helpers", and I made sure that it was clear that the helpers may not be stable. If the helpers had been included in the main "Helpers" page, they would have sorted above the Linux helpers, which is definitely not okay.
Anyway, here's an example using them. It's fun. Yeah it's kinda for the meme. No pressure to actually merge it :P
In particular, it's interesting how the
struct list_head
gets included at index 1, 2, 6, and 10. So maybe there's an opportunity for improving caching there. Similarly withkset
at index 5 and 8, anddevice
at index 15 and 17.