forked from llvm/llvm-project
-
Couldn't load subscription status.
- Fork 351
[lldb] Implement Process::{ReadPointers,ReadUnsignedIntegers}FromMemory #11686
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
Merged
jasonmolenda
merged 1 commit into
swiftlang:stable/21.x
from
felipepiovezan:felipe/proc_read_poiters_from_mem
Oct 24, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment (and the DummyReaderProcess impl) describe what is done in
TestReadUnsignedIntgersFromMemory, but in this test we're reading from a series of addresses that have a low byte of 0, so the returned result will be 64-bits of 0x0 in each case. How does thisexpected_resultget returned?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's true.
DummyReaderProcessreads byte by byte. So if the pointer's address starts at 0, the pointer will have 8 bytes, the first byte being zero, the last byte being 7There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your comment above describes exactly this - reading 4 bytes from addr 0x5 will get you a UInt32 of 0x05050505. That's what TestReadUnsignedIntegersFromMemory is doing. But this method is expecting a UInt64 with different values in each byte pos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, reading 4 bytes from addr 0x5 will get you 0x05060708 (or the other way around, endianness is hard)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah my bad, i see you're incrementing
addrin your writer loop. I thought it would not mutate that.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fwiw
each byte of a memory read result is its address modulo 256-- I'd probably say "the byte's address" instead of "its address" because it's easy for me to read this as "the address of the byte range % 256"There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addris the loop variable; the function argument isvm_addr, which is not mutated.I will try to update that code on a separate PR to change the comment as you described and rename some variables.