WARDuino icon indicating copy to clipboard operation
WARDuino copied to clipboard

Ack for update global and local value is only correct for i32 values

Open carllocos opened this issue 1 year ago • 1 comments

When updating a global value the following ack is written to the client channel https://github.com/TOPLLab/WARDuino/blob/da54f219475d3fda5ee88c3e57849d58334b0491/src/Debug/debugger.cpp#L1162

but that ack is only valid if the updated global value is of type i32. For non-i32 values, the ack should print another value of the StackValue struct. This is a problem for the plugin since after updating a global value it would be waiting for an ack of different content.

Idem for local value update https://github.com/TOPLLab/WARDuino/blob/da54f219475d3fda5ee88c3e57849d58334b0491/src/Debug/debugger.cpp#L657

carllocos avatar Jun 13 '23 11:06 carllocos

@carllocos just a thought that occurred to me:

One could argue that this is a bug in the plugin for not following the debug protocol correctly. That is why I want to document the current protocol on this page in the docs. Help with this work is always welcome. Or feedback, since not every instruction is as easily documented in a succinct way.

That said, it would indeed be better like you suggest to print the values properly based on their type. I believe there is already a function that does this somewhere in the vm code.

tolauwae avatar Jul 28 '23 22:07 tolauwae