felipepiovezan wrote:

> I think it would be better to change `Process::ReadMemoryRanges` to return 
> `llvm::SmallVector<llvm::Expected<llvm::MutableArrayRef<uint8_t>>>` and then 
> we could change `lldb_private::StringList` to hold a 
> `std::vector<llvm::Expected<std::string>>`, add a `HasError` method to check 
> if it contains any error, as well as a `GetErrorAtIndex()` method to surface 
> the error appropriately. 

This was discussed during the RFC, and the conclusion was that if a memory read 
did not return the number of bytes requested, a user could call the 
single-address variant if they really wanted more details. Even then, it was 
felt that _what_ the error was was not relevant, only the fact that _some_ 
error occurred, which is already expressed by the read length.

> That way you could keep your SBStringString api, but in the even where there 
> was a memory read failure for one of the addresses, the user could get the 
> error from the same SBStringList object.

This would be akin to changing the behavior of an SB object, which I don't 
think we are allowed to do


https://github.com/llvm/llvm-project/pull/172026
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to