[Lldb-commits] [PATCH] D62503: Add ReadCStringFromMemory for faster string reads

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue May 28 07:34:49 PDT 2019


labath added a comment.

In D62503#1519179 <https://reviews.llvm.org/D62503#1519179>, @aadsm wrote:

> Regarding changing the ReadMemory, yes, I was going to submit another patch with it. I was going to do it in a different way though, where I would read as much as possible with the process_vm_readv (fwiw, this function does not fail when it tries to read cross page, it will just partial read) and then read the rest with ptrace.


I think this is fine too, probably even better. I was going to suggest the same thing, but then I convinced myself that this wouldn't work in case the read *starts* in the unreadable memory region.

However, now that I think about it, that is nonsense, because there is no way for us to say to the user that "we failed to read some initial bytes, but this is the memory contents after that". So just using process_vm_readv, and finishing up with ptrace sounds fine to me.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62503/new/

https://reviews.llvm.org/D62503





More information about the lldb-commits mailing list