You can make a C++ data break point to help determine whenever a SkookumScript value has been modified.
(I was typing this in to help track down a different problem though it turns out it wasn’t needed, though I thought it still might be useful to others in the future.)
It is a little cumbersome/hacky though it should work. (It would be nice if the SkookumIDE had data breakpoints - though they don’t exist yet. )
Here is how you do it for an
my_num though it should be similar for many other types:
- In your original code, place an
Integer method that uses
my_num that has no effect on
my_num and you aren’t using (so it only gets the one call).
!dummy: my_num.max(0) would do the trick or some similar method that you aren’t using. (Binding it to a variable so that the result is used or the bulk of the C++ method is ignored.)
- In Visual Studio, put a C++ breakpoint in the
mthd_max() call in
SkInteger.cpp. Make sure it is after
SkInstance * this_obj_p = scope_p->get_this(); which is line 450 in my current version.
- Run your normal test and hit the above breakpoint.
- Copy this expression to your Watch window to find the memory address to watch
&(((this_obj_p)->m_user_data).m_data).m_integer. I drag from the Value column to a new Name column to get the address.
- Now follow the steps here to set a data breakpoint using the address obtained in step #4. It should look similar to this (though with your own specific memory address):
- Continue the VS debugger and it will break when
my_num is next modified.
- Examine the C++ callstack to determine where you are in the callstack.
Of course reading the C++ callstack to figure out what SkookumScript is doing is tricky too. Using the
SkookumScript.natvis debugging visualizers for VS C++ debugging can help - let us know if you would like a copy.