medismailben wrote:

I'm not a big fan of using the StringList as the return type since it's make 
`ReadCStrings` a lossy API.  Having such critical API be lossy seems wrong to 
me. If you don't think SBValueList is the right thing to use, we should come up 
with something else.

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. 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.

I'd recommend doing this in a separate PR, that'd land before this one, so we 
can make use of it here.

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