[Lldb-commits] [lldb] [lldb] Add ReadCStrings API to Process (PR #172026)
Felipe de Azevedo Piovezan via lldb-commits
lldb-commits at lists.llvm.org
Tue Dec 16 02:05:51 PST 2025
================
@@ -205,6 +205,20 @@ class LLDB_API SBProcess {
size_t ReadCStringFromMemory(addr_t addr, void *char_buf, size_t size,
lldb::SBError &error);
+ /// Given a list of addresses, read one NULL-terminated string per address.
+ ///
+ /// \param [in] string_addresses
+ /// The list of addresses to read from.
+ /// \param [in] error
+ /// An error that gets populated if the process is not in a valid state.
+ ///
+ /// \return
+ /// A list of strings read, which is guaranteed to contain as
+ /// many strings as there are addresses in the input. If reading from an
+ /// address fails, an empty string is returned for that address.
+ SBStringList ReadCStringsFromMemory(SBValueList string_addresses,
----------------
felipepiovezan wrote:
Yeah, that's the idea. SBProcess only has this method:
```
size_t ReadCStringFromMemory(addr_t addr, void *char_buf, size_t size,
lldb::SBError &error);
```
Which is the one you are alluding to. However, I had originally been inspired by this variant in `Process`:
```
size_t ReadCStringFromMemory(lldb::addr_t vm_addr, std::string &out_str,
Status &error);
```
It could be just a slip up that we never exposed this other variant in the SBAPI
https://github.com/llvm/llvm-project/pull/172026
More information about the lldb-commits
mailing list