(lldb) p index
(Int) 2
(lldb) watchpoint set variable index
error: no variable or instance variable named 'index' found in this frame
index is a @State variable. If I list variables, there is _index, with a value of 0. It seems that it's a default value. Clearly lldb is sourcing the value of index from somewhere?
My code is getting fed the right values, so clearly index is getting changed.
How can I watch this variable 'index' that is actually changing?
Just in case you are not aware of it, index is a computed property generated by @State property wrapper. It appears lldb watchpoint command only support monitoring value at a specific memory address (my quick search shows gdb watch command supports monitoring expression by single stepping).