Skip to content

Conversation

@augusto2112
Copy link
Contributor

Adds a hook so implementations of memory reader can add logic to resolving remote addresses. This is needed because of an interaction between LLDB, which tries to read memory from files instead of process memory whenever possible and the DYLD shared cache.

The shared cache will merge pointers in the GOT sections from multiple images into one location, and update the relative offsets to point to the new location.
LLDB, will have initially read the offset pointing to the "old" location, which will be zeroed out in live memory. This gives LLDB the opportunity to re-read the relative offset, but from live memory, so it can return the right pointer in the shared cache.

rdar://160837587

@augusto2112 augusto2112 requested review from mikeash and tbkka October 23, 2025 18:31
@augusto2112 augusto2112 force-pushed the remote-mirr-indirect-addr branch 2 times, most recently from f4913ea to 64859f8 Compare October 23, 2025 18:35
Adds a hook so implementations of memory reader can add logic to
resolving remote addresses. This is needed because of an interaction
between LLDB, which tries to read memory from files instead of process
memory whenever possible and the DYLD shared cache.

The shared cache will merge pointers in the GOT sections from multiple
images into one location, and update the relative offsets to point to
the new location.
LLDB, will have initially read the offset pointing to the "old"
location, which will be zeroed out in live memory. This gives LLDB the
opportunity to re-read the relative offset, but from live memory, so it
can return the right pointer in the shared cache.

rdar://160837587
@augusto2112 augusto2112 force-pushed the remote-mirr-indirect-addr branch from 64859f8 to 266adaf Compare October 23, 2025 18:35
@augusto2112
Copy link
Contributor Author

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