[Lldb-commits] [lldb] [lldb] Add ReadCStrings API to Process (PR #172026)

Felipe de Azevedo Piovezan via lldb-commits lldb-commits at lists.llvm.org
Sun Dec 14 23:33:24 PST 2025


felipepiovezan wrote:

> Looking at SBStringList, there's no way to indicate an unreadable string in the returned list, except that the C++ SB API could return a nullptr, and surprise for any existing clients who don't handle that. We need to accept a 0-length string, I'm not suggesting otherwise, but I am displeased by the state we've gotten ourselves in.

Yeah... if we had a SBString class, we would not have this issue, as clients are generally forced to ask if a SB object is valid before accessing them.

One thing we could do is set the SBError object to an error state if _any_ string read failed. This way clients would know they can't trust an empty string result. What do you think?

https://github.com/llvm/llvm-project/pull/172026


More information about the lldb-commits mailing list