Can I view the unhandled exception in the Visual Studio 2017 debugger?

The library I am using (zmq) is throwing an exception. The debugger breaks and tells me.

How, if possible, can I see this exception. Specifically, what's the () message? Without having to wrap try / catch around it and print to the output stream.

  • It does not appear in auto or locale watchlists. I was looking for stack frames around the point where it happened.
  • Adding $ exception to the list of wrist watches simply returns "identifier $ exception is undefined"
  • Using the memory explorer to poll for the location of the exception shows nothing useful.

I've read that it can be done using the CLR - can I do it in regular C ++?

+3


source to share


5 answers


(1) Make sure the exception messages have been enabled in the Output window under Tools-> Options-> Debugging-> Output. enter image description here



(2) If the message is still not an exception, one possible reason is that zmq does not really support VS's Exception feature. Of course, you could write a generic application like C # or VC ++ that can prove this. If other apps don't have this problem, we would think of a specific zmq.

+1


source


Link to this answer :

You will get a window when an exception is thrown with break / continue / ignore option. Copy and paste the hex address into this dialog, then hit the break button. Now, in the clock window, enter something like:



(std::exception*)0xXXXXXXXX

      

+1


source


Step 1. Define the exception (it will be recorded in the output window in VS) Step 2. Place an exception breakpoint with the exception you saw in the output.

If it's ZeroMQ I would say that you are sending 2 requests to the REQ socket without waiting for a response.

0


source


your output window

(View / Output or press CTRL + ALT + O)

where you should see the message, but you may need to check the exception option:

enter image description here

See here for details

0


source


As far as I know, this is not currently possible. I've added a User Voice suggestion here , but I'm not sure when Microsoft will ever implement this feature.

Currently, what you can do is use the Exception Type and Location (from the post "Exception is selected in Address in Module : Microsoft C ++ Exception: Enter Location . ' Into memory location , and then add the expression' ( Type *) Location If Type is some internal type of exception that you do not have access to, you can hope that it will be retrieved from std :: exception and replaced with it.

0


source







All Articles