-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new global drgn.value
helper
#473
Comments
For integers, the way drgn helpers currently handle this is by using drgn/drgn/helpers/linux/module.py Lines 187 to 223 in a099064
Do you have an immediate use case for non-integers? If so, I wouldn't be opposed to this. |
My current use case are IDs so |
And maybe use the already existing protocols from My suggestion: |
We don't rely on
I like that suggestion, thanks! |
When writing helper functions it can often be useful to both accept native python types and
drgn.Object
at the same time. Currently this requires writingif isinstance(input, drgn.Object): input = input.value_()
all over the place. It would be very helpful if drgn would provide a util function which does this automatically such that one can just writeinput = drgn.value(input)
. For native python types it would just return them as is and fordrgn.Object
types it would call thevalue_()
method as shown above.If you think this would be a useful addition I would be more than happy to contribute a PR
The text was updated successfully, but these errors were encountered: