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

c18n: Allow GDB to access compartment data #2087

Merged
merged 1 commit into from
Apr 20, 2024

Conversation

bsdjhb
Copy link
Collaborator

@bsdjhb bsdjhb commented Apr 18, 2024

Extend struct r_debug to contain a pointer to RTLD's array of compartments and count of elements. Export the size of struct compart so a debugger can walk the array.

@bsdjhb
Copy link
Collaborator Author

bsdjhb commented Apr 18, 2024

This is a variant of a commit originally by @dpgao. I hardcode the offset of relevant members of struct compart in GDB similar to what is done today for link_map. The only thing I depend on getting from rtld is the size of struct compart so the structure can grow in the future.

Extend struct r_debug to contain a pointer to RTLD's array of
compartments and count of elements.  Export the size of struct compart
so a debugger can walk the array.

Co-authored-by: John Baldwin <[email protected]>
@bsdjhb bsdjhb merged commit fa9c89d into CTSRD-CHERI:dev Apr 20, 2024
28 checks passed
@bsdjhb bsdjhb deleted the gdb_comparts branch April 20, 2024 01:34
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.

2 participants