Skip to content

Conversation

kpdev
Copy link
Member

@kpdev kpdev commented Sep 29, 2023

When we trying to change not the whole string,
but single character in it - lldb's ValueObject fits in Scalar and therefore lldb trying to update it as a Scalar value which is currently only support numbers, so characters support added.

~~

Huawei RRI, OS Lab

When we trying to change not the whole string,
but single character in it - lldb's ValueObject fits in Scalar
and therefore lldb trying to update it as a Scalar value
which is currently only support numbers, so characters support added.

~~

Huawei RRI, OS Lab
@kpdev
Copy link
Member Author

kpdev commented Sep 29, 2023

Depends on: #67309 (comment)

@jimingham
Copy link
Collaborator

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.

@kpdev
Copy link
Member Author

kpdev commented Oct 5, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants