[Lldb-commits] [lldb] [lldb] Add support for updating string during debug process (PR #67782)

Pavel Kosov via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 5 01:05:53 PDT 2023


kpdev wrote:

> BTW, I have no problem with the general direction of this change. It makes a lot more sense to ask a synthetic child provider to change a value - since it does represent the value of the ValueObject - rather than the summary which is just some free-form text. And being able to change characters in a string seems a reasonable thing to do, so switching the std::string comprehension from a Summary provider to a Synthetic Child Provider is the way to do that. So that part if fine.
> 
> But std::strings abound in code, and so if we're going to make this change I don't think we can make that printing less space efficient, which this change seems to have done. We should figure out why that's the case and fix for this to be a really good change.

So, is it Ok to use current `SetValueFromCString` api from ValueObject to ask synthetic provider to update the underlying string?
You mentioned previously that we may add `SetSummaryFromCString` api - in fact currently this is what I am doing - changing the whole string through its summary (please check attached gif for example).
But the problem with the new API is the same as for the changing characters through `SBValue::GetData` - IDE doesn't support it

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


More information about the lldb-commits mailing list