[Lldb-commits] [lldb] [lldb] Add support for changing char in Scalar::SetValueFromCString (PR #67784)
Pavel Kosov via lldb-commits
lldb-commits at lists.llvm.org
Thu Oct 5 00:41:05 PDT 2023
kpdev wrote:
> This seems like a somewhat limited way to poke a character into the value if the string has more than one character already in it.
>
> If you are trying to do more fancy setting of the contents of an SBValue, then it would be more straightforward to get the SBData for the value with GetData, then you have access to the actual bytes in the data, and you can poke in values wherever you want. I think that might be a better approach than trying to get SetValueFromCString to handle changing single character ValueObjects.
The main purpose of all these patches is to be able to update string value during debug process in IDE (vscode for example).
LLDB communication with IDE is not straight, it uses some external tools for this, e.g.:
When we want to change value in the vscode, firstly vscode send request to lldb-mi through `Debug Adapter Protocol`, then lldb-mi asks lldb to change received value through `SetValueFromCString` api, so if we would like to avoid using this api - we need to add such support on the lldb-mi side. But it is not necessary, that IDE will communicate to the lldb-mi, it can send requests to any tool which supports DAP, and this tool will probably use `SetValueFromCString` api
https://github.com/llvm/llvm-project/pull/67784
More information about the lldb-commits
mailing list