Suppress First Chance Exceptions

·

·

1–2 minutes

I am writing a small compiler using ANTLR 3.0. When I debug it, I get numerous first chance exceptions. With each exception, a messages is displayed in the Output window and the program breaks into the source code, which becomes quite annoying and time-consuming. The exceptions are thrown and handled by ANTLR to detect which branch of the lexer or parse rule to proceed. In most cases, I don’t need to worry about them.

How can I get rid of the messages and prevent the control from breaking into the code?

To get rid of the messages while debugging, right click in the Output window, and in the context menu, uncheck in the menu item “Exception Messages”.

Context Menu of Popup Window
Context Menu of Popup Window

To prevent the control from breaking into the source code when an exception  is thrown, open the Exceptions dialog by selecting the Debug – Exceptions menu item, add the exception types to the Exceptions dialog, make sure the Thrown and User-unhandled flags for the exceptions are unchecked. In the screen shot below, two exceptions that are thrown by ANTLR are added under the Common Language Runtime Exceptions.

Exceptions Dialog
Exceptions Dialog

Related Articles

Get updates

Spam-free subscription, we guarantee. This is just a friendly ping when new content is out.

Go back

Your message has been sent

Warning
Warning
Warning.

Leave a comment