So, here’s the problem I have.
void * something = ???;
void (*fun)(void*) = ???;
try
{
fun(something);
}
catch (...)
{
assert(false);
}
I’ve been tasked with establishing why the assert is getting fired. Unfortunately I don’t get to change the above code. Furthermore this is in a multi-threaded environment and it’s during shutdown of the program. The part that does the try/catch is unlocked quite purposefully in the real world code. When I try to step through the program it suddenly just disappears on me…I can’t even step TO the right fun() call, let alone into it.
My only recourse seems to be to put a breakpoint in the catch(…) and examine whatever is there. Unfortunately this tells me nothing as I don’t know what fun really is nor what something is.
My only hope at this point is that I can somehow talk the Visual Studio debugger into telling me what ... is and I’d be overjoyed if I could find out where it was thrown. It’s not in the auto list at least…might it be elsewhere? Is there any way for me to make progress here or am I screwed? I feel screwed…
====
Update: There was an external program killing mine when it didn’t shut down in time. That’s why stepping made it disappear. Had nothing to do with threads.
Once I realized that I was able to turn on exceptions as suggested. Unfortunately there was no place that throws one…it was an access violation. The function being stored gets pounded somehow.
Try to use Visual Studio functionality that breaks execution when an exception is thrown. Go to Visual Studio main menu Debug -> Exceptions and tick all exceptions.
This way visual studio will stop when your exception is thrown and you will know what it was.