0

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?

Bogey
  • 4,926
  • 4
  • 32
  • 57
  • It is not normal and suggests a bug in the changes you made. Happens when the debugger code itself throws an exception while handling a debug event. – Hans Passant Jul 07 '17 at 15:12
  • Hmm that's interesting. The only thing I changed in my debugger, I believe, was subscribing to a few extra events of the CorProcess - but not really doing anything other than Log in there via log4net, which should ne nearly impossible to throw anything. This is the only circumstance that could trigger the event though, e.g. an exception thrown in a handler of e.g. MDbgProcess.PostDebugEvent ? – Bogey Jul 07 '17 at 15:31

0 Answers0