clayborg added a comment.

My objection to the BeginWriteMemoryBatch and EndWriteMemoryBatch is users must 
know to emit these calls when they really just want to call 
process.WriteMemory() and not worry about how it is done. Much like writing to 
read only code when setting breakpoints, we don't require the user to know that 
they must check the memory permissions first, set permissions to be writable 
and then revert them back after writing to a memory location.

If we have the ability to do things correctly, then we should and we shouldn't 
require people to know about calls that are specific to flash. Just make it 
happen if you can, else return an error. So I would rather see the 
ObjectFile::Load become more process aware where it gets the memory region info 
and efficiently loads memory as needed by watching the m_blocksize than require 
everyone else that might want to write memory to know to start a batch and end 
a batch. It comes down to keeping the API simple.



================
Comment at: include/lldb/Target/MemoryRegionInfo.h:109-110
   ConstString m_name;
+  OptionalBool m_flash;
+  lldb::offset_t m_blocksize;
 };
----------------
Could these two be combined into one entry? Could "m_blocksize" be 
"m_flash_block_size" and if the value is zero, then it isn't flash?


https://reviews.llvm.org/D42145



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to