[Lldb-commits] [PATCH] D42145: [lldb] Use vFlash commands when writing to target's flash memory regions

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 30 11:38:24 PST 2018

clayborg added a comment.

In https://reviews.llvm.org/D42145#991459, @owenpshaw wrote:

> Thanks.  What I'm struggling to reconcile are your statements that users should not have to know how things must happen, but then that we should make ObjectFile::Load smart so it doesn't result in an unnecessary amount of reads/writes.  If writing to flash memory effectively requires some smarts on the caller's part, then how have we made things easier for the callers?

We don't have to, we can let them submit each memory write and do things inefficiently. I am just saying it isn't too hard in ObjectFile::Load to gather large contiguous writes and submit them as one Process::WriteMemory. Pavel's suggestion that we send an array of regions would allow us to do this internally in the Process::WriteMemory(regions) call.

> And at that point isn't start/end a lot simpler than requiring callers to worry about block sizes themselves?

There are no block size requirements here, WriteMemory can either do the write memory or error out. Just submit the largest contiguous write possible. Not sure what the issue is here?


More information about the lldb-commits mailing list