MDbg / ICorDebug: What is "OnExceptionInCallback"?

100 Views Asked by At

I'm using an MDbg to write a custom debugger to debug an ExcelDna-based C# AddIn in Excel. In other words, I'm loading an Excel AddIn in Excel, and attach my custom MDbg-based debugger to Excel afterwards.

Earlier today, the CorProcess (-> Excel) triggered "OnExceptionInCallback" a few times. I'm trying to figure out why.

I couldn't recognize any pattern, to me it seemed this happened randomly and I believe even at times where my own AddIn didn't even run any code at all when this exception handler was invoked. So I'd assume this may have been triggered by something from within Excel, rather than my particular AddIn.

Unfortunately, I've been trying to reproduce this for the past two hours but so far it hasn't happened at all anymore, without having made any relevant changes to the code base.

MDbg suspends a process when this is triggered, ignoring the usual exception settings (e.g. MDbgEngine.Options.StopOnException) - so gut feeling tells me this isn't some sort of normal debug event that can just be ignored?

So long story short: Does anybody know what the CorProcess.OnExceptionInCallback event represents? Under what circumstances exactly would this be triggered, what is happening in a debugee what would trigger this to be fired?

0

There are 0 best solutions below