I am using Visual Studio 2012 VC++ for debugging some of the code. Is it possible to log the list of functions the program is hitting and provide a snapshot of the variable when it hits at the specific point. I am trying to place breakpoint at many places and trying to print the information of the variable. Is there a easy way to do that?? like an extension or plugin or macros..
I tried to search for macros, but I don't find that under tools. Seems that for VC++ they don't provide that option either...
Custom debug visualization in visual studio:
Is there any way to do it per project instead of editing the "global" autoexp.dat?
Would be nice if it tagged along when changing workstation..
No: per-project (or per-user) visualizers in Visual Studio 2010 (C++ native) are not possible. Visual Studio 2012 added this feature; it is based on "natvis" XML files.
Rather old question, but lets give my cent:
For VS2008 SP1 and VS2010 you have the alternative to use your custom file, instead of invasively edit the native autoexp.dat file using the _vcee_autoexp environment variable.
Credit to: https://vtk.org/Wiki/ITK/Debug_Visualizers_for_Visual_Studio
Note: I have not tried, but maybe using a relative path VS loads it based on the solution folder. Alternatively I would also try using multiple path separated with semicolons. Just give it a try.
We are doing QT development in Visual Studio 2010. I would like to be able to see the contents of A QDomNode variable in the Visual Studio Debugger.
It is possible to customize the display of variables in the Visual Studio Debugger by customizing the autoexp.dat file. The QT Add in for Visual Studio adds many customizations to autoexp.dat that enable you to see relevant information for QT classes, and there are a number of discussions on customizing the autoexep.dat that include a customization for QDomNode that appear to originate from this Daniel Albuschat blog entry QT Debugging with Visual Studio 2005. However, QDomNode is still not visible to me even with the described modifcations to autoexp.dat.
I notice that QDomNode uses a member variable QDomNodePrivate* impl as a PIMPL to hide its data members behind. This is similar to the "d" pointer commonly used in QT, notably in QString, which is able to see data correctly... Any pointers would be appreciated...
A simple preview would be:
QDomNode|*::QDomNode{
preview ($e.impl->name)
}
But this does not really work, because the debugger can see the structure of impl only when it is "inside" qdom.cpp wich contains the definition of QDomNodePrivate. You can test this by stepping inside some QDom method. One "hacky" solution would be to copy the class definition of QDomNodePrivate into some header file that you include in your program.
And don't forget: You have to be Administrator to successfully edit autoexp.dat!
I have seen and used a rename feature in Visual Studio 2010.
However when editing code in C++ mode, I see no "Refactor" menu, and the CTRL+R CTRL+R command produces the following error message:
The key combination (Ctrl+R, Ctrl+R) is bound to command (Rename...) which is not currently available.
Eclipse seems to have got this right. Is there no rename feature in VS 2010 for VC++?
Is there no rename feature in VS 2010 for VC++?
That is correct. None of the refactoring features work for C++ projects (C# and VB only). If you want these things, you need to use a third party plugin, such as Visual Assist.
I just moved from Visual Studio 2008 to Visual Studio 2010 (final) and noticed one major flaw:
When I try to use AutoComplete in a C++ source file for managed C++, a small note in the footer appears:
IntelliSense for C++/CLI is not available
Uh, has IntelliSense for C++/CLI been dropped from Visual Studio 2010? Is there any way to get this back? It is rather useful...
You are correct. Unfortunately it has been dropped. You can check this opened issue on Microsoft's Connect website.
I'll just quote them for the sake of the answer:
Unfortunately in this release we had to cut the intellisense support for C++/CLI due to time constraints. If you want to get some intellisense like quick info and memberlist on the native classes you can get it by choosing no /clr support in the project properties.
About getting back intellisense, your best chances for now are using third-party tools like VA Assist for example. I've tried it with Visual Studio 2008 and its IntelliSense is a whole lot better than the default one.
It is available again in Visual Studio 2012.
If you want to get IntelliSense back, install Visual Assist X from Whole Tomato Software. Here you can get a 30-days trial to check the intellisense.
According to the Visual C++ Team Blog, C++/CLI Intellisense will be in the next version of Visual Studio, but not in a service pack for VS2010. That blog post also gives some detail as to what went wrong and led to this sad state.
I don't know if you can use this settings but it work for me. I only check the Common Language RunTime Support for the cpp files that use it. I do not check it for the whole project and I've got intellisense for all the files that don't use the CLI.
Yes! you can enable the IntelliSence, but in a tricky way. Follow these instructions:
Go to your project properties. (Right click on your project name in
Project Explorer, and select Properties. or simply Alt + Enter)
From Configuration Properties, select General
In the right-hand section, find "Common Language Runtime Support"
and change it to "No Common Language Runtime Support".
Click the OK Button.
Now the IntelliSence is working. But a problem is an error when you compile your code! (The error is: error LNK1123: failure during conversion to COFF: file invalid or corrupt)
You can simply go back to Project Properties an change Common Language Runtime Support to "Common Language Runtime Support, Old Syntax (/clr:oldSyntax)".
Good luck.
This solution is only if you don't want Common Language Runtime
It worked for me in VS2010
Go to Project Propreties > Configuration Properties > General > Common Language Runtime Support and set it to No Common Language Runtime Support.
This will work fine just after hitting Apply button.
As mentioned you could install some paid software such as "Visual Assist X from Whole Tomato Software".
or
You could use open source tools that contain intellisense*, one such tool is Qt Creator 3.3.1 (opensource). You have two options, either setup your entire project with Qt to compile using VS2010 compiler, or use Qt to link to your source files and compile with VS2010. You write your code in Qt, save, flip windows to vs2010 and compile and debug.
When changes are saved in Qt, vs2010 will automatically reload the source file in the project and you can compile.