Skip to content
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

More convenient API for reading an array #377

Open
pcc opened this issue Dec 6, 2023 · 0 comments
Open

More convenient API for reading an array #377

pcc opened this issue Dec 6, 2023 · 0 comments

Comments

@pcc
Copy link
Contributor

pcc commented Dec 6, 2023

Sometimes I need to read all elements of a dynamically sized array. This can be slow, especially with a high latency remote debugging connection to the target. So I would really like an API for reading all elements of the array at once, so that I can read the array with a small number of round trips to the target. I came up with this workaround (for my current use case, which is reading the KASAN ring buffer):

cast('struct kasan_stack_ring_entry(*) [%d]' % prog['stack_ring'].size, prog['stack_ring'].entries)[0].read_()

But it would be nice if there were a better way to do this. One possibility might be a read_array_() method for objects of pointer type that reads a specified number of elements via the pointer and returns the array.

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

No branches or pull requests

1 participant