Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When using windbg is there a way to break on a specific CLR exception

I'm debugging a production service which is at rare instances is throwing AppDomainUnloadedException. The exception contains no stacktrace or any kind of useful information about why it happens. So want to attach windbg and only break when AppDomainUnloadedException is thrown and not any other clr exception.

Is this possible?

like image 258
Christian Avatar asked Jul 27 '11 12:07

Christian


People also ask

How do you break on exception in WinDbg?

For each event, you can set the break status. You can configure the break status by doing one of the following: Choose Event Filters from the Debug menu, click the event that you want from the list in the Event Filters dialog box, and then select Enabled, Disabled, Output, or Ignore.

What happens if a kernel-mode driver generated an unhandled exception?

Exceptions that occur in kernel-mode code are more serious than user-mode exceptions. If kernel-mode exceptions are not handled, a bug check is issued and the system stops.

Where does WinDbg install to?

WinDbg Preview is a UWP app, so its binaries span in multiple locations. Its launcher is at %LocalAppData%\Microsoft\WindowsApps\WinDbgX.exe .


1 Answers

You're look for the !soe command (Stop On Exception) syntax should be something like:

!soe System.AppDomainUnloadedException 1
like image 169
SamuelWarren Avatar answered Nov 15 '22 00:11

SamuelWarren