When something throws an exception I usually click on "View details" which brings the QuickWatch window into the foreground and let's me examine the occurred exception.
What really bugs me is that I am not able to browse/search through my code having the QuickWatch window open next to it. I first have to close the window.
Is there a way to keep the window open when in break? Maybe there is another approach?
Is there a way to keep the window open when in break? Maybe there is
another approach?
Actually, there is no such function to browse or search the source code when you call Quick Watch window. And when you call the Quick Window, it will lock the current interface and we cannot do any other operation on other window. And this is the Quick Window feature in Debug mode.
Is there a way to keep the window open when in break? Maybe there is
another approach?
In fact, there is no such function to achieve your goal. Detecting exceptions is the job of the Debug mode process. If Debug mode is broken, the exception cannot be monitored, so it cannot be implemented. It must be based on Debug mode to capture.
As a suggestion, you can try this:
Suggestion
1) When you achieve the Error Exception User Unhandled under Debug mode, you can first browse/search through your code in Code Editor.
2) After that, you can keep the current interface of your code section, open Quick Watch Window(Debug-->QuickWatch)-->input $exception in the Expression textbox and click Reevaluate.
And this will be the same as shown earlier.
Related
I am getting a little desperate here: Almost every time I try to use the Firefox browser tools (FF 66.0.3 on Mac, but has been the same in previous versions) to inspect an element, when selecting any page element to show its code in the inspector, the inspector switches to the javascript debugger, marks an error in the jquery.min.js file (complete first line of three) and causes the browser to hang, i.e. I can still scroll the window, but more or less nothing else (for example no reload, no clicking a link would work etc.)
The debugger shows Error: Permission denied to access property "nodeName". I am doing nothing special, I just use the inspector and try to select any element on the page.
The crazy thing is that this happens on most websites, even here on Stackoverflow, so I suppose some particular browser setting must cause this.
I know this is a vague description and therefore a bit off-topic, but I'd be very grateful for any hints how I could fix this.
You most probably have the "Pause on exceptions" and "Pause on caught exceptions" options set to on:
These will cause the debugger to pause javascript execution whenever an exception is thrown, even though the exception has been caught e.g by a try catch block, like many test codes use.
You can un-toggle these to enjoy a more natural experience or click the play icon to resume the javascript.
When I debug a program using IntelliJ' debugger, how can I return to the normal execution of the program after debugging a part of the code ?
I start a program, test it.
When the debugger find breakpoints, it starts the step by step debugging of the program.
I do my stuff and my checks, nothing goes wrong.
I want to exit step by step debugging and go back to a fluid execution of the program (without having to press a button for all actions) until the debugger find a new breakpoint.
How can I do that and exit the step by step debugging?
You can use the "Resume Program" button, which looks like a green triangle (a "play" button"), or the F9 shortcut.
See, e.g., this screenshot from a debugging session I started (mouse cursor and the hovering tooltip show the button's location):
Note: The screenshot was taken in IntelliJ IDEA 14.1.4 so the exact layout may differ according to your specific version, but the same behavior, buttons and shortcuts have existed in IntelliJ for years now.
So there I am, working on a Silverlight app, and between one build & run and the next, my debug output goes away. Where before I had dozens of lines of Debug.Writeline text, I now have only the module load and thread messages.
Yes, I'm in debug mode (vs. release mode).
Yes, my Output window says "Show output from: Debug".
Yes, when I right-click on the output window, every option is checked.
No, my Tools > options > debugging > general > "Redirect all output text to the immediate window" is not checked.
All I can figure (and it's a wild guess) is that for some reason, the VS debugger isn't attaching to the Silverlight app like it should.
What's weird is this has been happening for the last couple of days, out of the blue. And just as suddenly, all my debug messages start showing up again.
This is VERY frustrating.
EDIT: Of course, after returning to the project after the weekend, all Debug messages are back. No idea what was causing the issue, so I'm sure it will happen again.
Now the question is: should I leave this question open in case the problem arises again in the near future? What happens to an unawarded bounty?
I found the same problem and just by setting options → debugging → output window → Thread Exit Messages to true the output windows was begin to send the right messages !?
I had exactly the same issue. Out of the blue, debug.print stopped working. In my case, it used to go to the Immediate Window. Nothing there. Nothing in the Output window. I followed several suggestions to no avail until I found this one at http://www.experts-exchange.com/questions/26894732/Debug-Print-and-Debug-Write-no-longer-work-in-Visual-Studio-2010.html
There is a context menu in the Output/Debug pane. The "Program Output"
menu item was accidentally cleared.
Checked the item and it started working again (even though my output was the immediate window). What a relief...
Ensure that the DEBUG conditional compilation symbol is defined. The Debug class suggests that you "add the /d:DEBUG option to the compiler command line when you compile your code using a command line, or add #define DEBUG to the top of your file".
Did you create or modify an Application config? If yes: the initial created configuration by VS does contains the necessary wiring configurations to enable the debugging at all. Not sure what and if there are counterparts in Silverlight, but in WPF environments simply replacing the app.config will have the same effect as you expierience.
Check the Immediate Window. Check the options. There is a general setting that says "send Debug output to Immediate Window"
I have a piece of code in C# that's essentially like the following...
WriteFile();
try {
RunTest();
} finally {
DeleteFile();
}
Now this has been planned so that even on failure, it cleans up the files it left behind. This works when not run in debug mode (although it pops up a message asking if I want to debug the program or close it. Closing it produces the appropriate results).
When I run this in debug mode and hit an exception inside of RunTest, I only seem to have two options. In the first one, I tell debugging to stop. This is equivalent to killing the program and the block in finally does not run (so the file doesn't get deleted like it should). If I tell it to continue, it doesn't propogate the exception up and instead, it just hits an exception somewhere else.
Is there anyway to get debug mode to continue like a normal program after hitting an exception?
From the Debug menu, choose Exceptions (or use Ctrl + Alt + E). This will bring up a dialog where you can uncheck appropriate checkboxes in the "User-unhandled" column for exceptions which you don't want to stop at while debugging.
I believe that will make exception propagation work normally. And you can still set a breakpoint either in the try or finally block to see what's happening.
Check Debug/Exceptions if there are any exceptions set.
Another option would be to handle the event Application.ThreadException (Windows Forms) or Application.UnhandledException (Silverlight etc.) and tell the application to continue or exit, depending on the severity of your exception.
Im sure this is something really simple I'm missing. I use makeKeyAndOrderFront: to open a window and it works the first time. When I close the window and try and open it again it quits and gives me the error EXC_BAD_ACCESS. My code is this:
- (IBAction)viewScreen:(id)sender {
[screenView makeKeyAndOrderFront:sender];
}
I can't figure out why this is happening and the debugger console isn't saying much of anything.
Thanks in advance
Why are you calling your window variable screenView? That sounds like it should refer to a view, not a window.
Check whether your window has the “Release when closed” property turned on in IB. When that property is on, the window will release itself when anything or anybody closes it. This can be handy, but if you intend to show the same window again later on, it's probably not what you want.
More generally, you can use Instruments's Zombies template to debug crashes like this.