I'm messing around with the Visual Studio add-in API trying to see if something I want to do is possible. One thing I am doing right now is something like:
public void Exec(string commandName, vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
{
_applicationObject.Events.DebuggerEvents.OnExceptionThrown += DebuggerEvents_OnExceptionThrown;
handled = false;
if(executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault)
{
if(commandName == "MyAddin1.Connect.MyAddin1")
{
handled = true;
return;
}
}
}
void DebuggerEvents_OnExceptionThrown(string ExceptionType, string Name, int Code, string Description, ref dbgExceptionAction ExceptionAction)
{
//how to get line number here?
}
Ideally, I'd like to be able to get the current function and line number whenever an exception is thrown by a program being debugged. Is this possible?