My VS2013 doesn't show local variable values when I start debugging by setting a breakpoint as shown in the attached picture with red question mark. I have already checked "Use Managed Compatibility Mode" but it doesn't work for me. Please suggest what I am supposed to do.
From the screenshot it looks like you are viewing the "Watch 1" window (used for evaluating expressions and variables). What you're looking for is called the "Locals" window. You can find it using the menus Debug -> Windows -> Locals while running the solution.
Related
I feel a bit silly about this, but I seem to have accidentally hidden the variables section for debug mode in Visual Studio Code, and can't figure out how to get it back.
The debugger is starting ok (using node.js for debuggging a js file), and I can see Watch, Call Stack, and Breakpoints - but no Variables window. Have attached a screenshot to show the layout.
screeny of VS Code window
Press Ctrl + P to open the "Go to File..." menu and type in view Variables and press Enter. This will show the variables view again.
Summary: Is there an easy way to save alternate command arguments used by the Visual Studio debugger?
Details:
Visual Studio has an option to set Command Argument that are used by the debugger. For example in the screenshot shown here I've set them to FOO BAR. Sometimes when debugging a project I want to switch the arguments to test different input sets. And often the arguments are much longer than just FOO BAR. It would be nice if there was a way to save the arguments that I've typed and switch between them quickly. Ideally it would also be possible to change the working directory at the same time. But I haven't found a way to do this yet so that's why I'm asking here. I'm using Visual Studio Professional 2012.
You can just create new configuration(s) for this project. I see that your current active configuration is Debug (top left corner of project settings dialog). You can create new configuration(s), which will be based on this one, and name them like Debug-Test1, Debug-Test2, etc. After you will do this you will have a choice to switch between this configurations in VS Debug Toolbar.
I have been assigned to a project at work and I need to do some old-style debug because the Debug itself doesn't work with the libraries which are being used.
So, since it's a C++ with Qt application, I first tried with qDebug(). Then with cout, and finally with printf (which I hate in comparision to the former ones). NOTHING.
Nothing is written into the output window of Visual Studio 2008, and I'm quite sure it is executing these lines of code (I even tried to put a qDebug at the very beginning of the main.cpp). It is a GUI app by the way, and I've tried Debug output as well as Build output, but nothing is displayed.
I have looked for similar questions, but none of them provided a solution yet. Any help?
Chances are, your Visual Studio environment has been configured to redirect all output from the Output Window to the Immediate Window. I've been bitten by this a couple of times, as this is inexplicably a default setting for certain environment configurations.
To reset the setting, follow these steps:
From the "Tools" menu, select "Options".
Expand the "Debugging" item in the tree to the left, and select "General".
In the list to the right, scroll down to "Redirect all Output Window text to the Immediate Window", and ensure that it is unchecked.
Click OK to return sanity to the world.
It looks like you can't use qDebug directly if it is not a console based application. Sounds weird to me, but sadly it is like that.
I believe there is a setting (or combination of settings) in Visual Studio that allow you to see in the Immediate Window (or Output Window, I can't remember which), the timestamp and name of an assembly as it is loaded while debugging. I used to have this switched on as it is very useful for finding performance issue areas. Sadly however, when VS recently decided to undock all my windows for no good reason, I had to reset my VS settings and have now lost this.
I can't find for the life of me which setting it was that I had switched on.
Any help appreciated.
Apart from reading Debug output messages in Output window, you can also use Modules Window (at least in Visual Studio 2013) which gives you a nice searchable list of loaded modules with various additional details:
Debug -> Windows -> Modules
In the Output window, change the "Show output from" combo to Debug if necessary. Right-click the window and tick "Module load messages". And any others you might want to see.
Hey, I accidentally closed that window in VS that you can use to inspect variables and the like, and I can't find anywhere to get it back; where do I find it? Thanks.
Try the following
Debug -> Windows -> Locals
It may be Immediate or Watch instead of Locals depending on what you are looking for. You will need to be in the middle of a Debugging session for Locals or Watch to show up.