Running / stepping into code in debugger not going to right method!

Suddenly, when I execute my Windows app in the debugger, it’s not stepping into the correct method! Ultimately, the app crashes because the execution chain is not correct.

And yet – the built executable runs perfectly.

Anyone ever seen this? Should I be freaking out?

NOTE: This MAY have something to do with calling methods (during App launch) that I’ve defined in Window1, POSSIBLY before Window1 has been fully initialized. I noticed that Window1’s “opening()” event hasn’t been called yet. When I moved the method that wasn’t being stepped into correctly OUT of Window1 and INTO MyApp, I was able to step into THAT method from the App’s Opening() event handler.

I still have to move several methods I’m calling during App initialization out of Window1 to be certain. I suspect this may have worked without problem up until now because Window1’s UI components were fewer, so maybe there was a timing issue with initialization?

i use often at top of a method
so i can follow what is going on.
and sometimes i use at top & bottom.
System.DebugLog(CurrentMethodName+" Start" )
System.DebugLog(CurrentMethodName+" End")
and if that is not enough also a time stamp.

@MarkusR – This is what we refer to as “Ghetto Debugging” – and it’s super helpful. However, the result is the same – I go to step into a method in Window1, and it never gets there.

Not completely certain yet, but this may have been pilot error: I think I was under the misunderstanding that the Opening() event method of each container located on each PagePanel was called when that particular PagePanel was displayed. In fact, each PagePanel’s DesktopContainer.Opening() is called when the window that contains the PagePanel is first opened / initialized.

This led to all manner of my own derived initDataForView() calls – one for each of the 14 page panel containers – right at the beginning. However, there was no deterministic order, and I had never intended them to be called all at once. That accounts for the crashing.

There DOES seem to be an issue with the debugger possibly indicating the incorrect object name: my initDataForView() is implemented as doing nothing in a base class I created, BaseContainer, which itself is derived from DesktopContainer. Every DesktopContainer I create is derived from BaseContainer, so this MAY have added to the confusion in the debugger.

1 Like