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...
Related
I know that GDB comes with reverse debugging, but is there a way I can get this functionality in Visual Studio 2013 Pro?
Visual Studio (2010, 2012, 2013 Ultimate only) does have a feature that allows you to step backwards from a breakpoint or exception (Intellitrace), and the values in the Locals and Autos panes (as well as DataTips that appear on a hover over a statement) will the show the state at that (previous) point. Unfortunately, Intellitrace is not available for 2013 Professional. In addition, it has only limited support for F# and does not support C++ or JavaScript.
Right now, (since no 3rd party extensions exist that I’m aware of) your best option is looking at the call stack to examine the source code that executed prior to the breakpoint or exception. BTW you can “drag” the debug point up and down in the debug gutter of the VS source window but this will only set the point of next execution (any previous state information is not displayed).
Since GDB does have this feature you could try something like VisualGDB or WinGDB, but I'm not sure how well reverse debugging is supported in either of these two or their stability once introduced into the most recent VS IDE.
When Roslyn installed, it comes with a couple of great demo tools. Firstly, the most valuable I think for those who want to learn syntax trees more thoroughly is the Syntax Visualizer Tool Window which shows the syntax tree of active *.cs files.
Everything worked fine when I launched this extension and tried it in a test instance of Visual Studio. But when I have installed this extension, it's not working anymore. I still have View -> Other Windows -> Roslyn Syntax Visualizer but just an empty window tool pops up.
Does anyone have the same problem and know the solution?
I guess that maybe I need to copy DLL files which this extension produces when rebuild but I don't know where should I put it.
Later I found another interesting detail - when I launch my own extension, Syntax Visualizer Tool works! So, it works only in test instance of Visual Studio. Why it should be like that?
The Syntax Visualizer only works when you are running Visual Studio with Roslyn enabled. When you start a test instance of Visual Studio, Roslyn is automatically enabled. Manually starting Visual Studio with Roslyn can be done by adding /rootsuffix Roslyn to the shortcut, but take care that Roslyn is not finished yet. It might not be advisable to enable it by default, depending on what you are working on. Of course, you can also just create another shortcut with Roslyn, so you can choose which one you want.
If you see [Roslyn] in your code tabs in Visual Studio, then you can use the visualizer. Another way of verifying if Roslyn is enabled is to view your extensions. The Roslyn Language Services has to be there for it to work. If this is not the case, then the visualizer can be opened, but it won't show any contents.
You can find more information about the visualizer extension here.
Nico most likely has the answer. Look in the Debug properties of the Syntax Visualizer project to see that it is launching with /rootsuffix Roslyn. Also, without launching this way, you should be able to see the Syntax Visualizer in the C# REPL and C# Script editor windows; as these are Roslyn CSharp editors.
I want to prevent VS from attempting to debug code that is not mine. When I 'Step-Into' my code, VS tries to find resource files I don't have. I'm really not interested in viewing the 3rd party code code.
How can I only step through my managed code?
Followed this without success:
Restrict Visual Studio 2010 from debugging third-party DLL files
Also changed JIT debugging to Managed only.
Using breakpoints and step over.
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!
When I look up anything about macros for Visual studio 2005, everyone is referencing the samples that ship with it. However, Visual studio was installed for me (IT department) and I do not have these sample macros.
Is there another place I can find(or download) them?
Note that you can also create your own using the macro recorder (Ctrl+Shift+R). After you record some actions, stop recording (ctrl+shift+R again), you can view the macro source using the Macros IDE (Tools | Macros | Macros IDE).
In VC 6 they used to be in a normal file from what I remember, but I'm not sure where they are kept in VS2005 and VS2008. I can't imagine that there is an install option to not include them.
Did you look in the Macro IDE or the Macro Explorer?
http://msdn.microsoft.com/en-us/library/s2shw615(VS.80).aspx
The Macros IDE includes some sample macros for your study and use. They are located in a node called Samples and are available in either the Macro Explorer or the Macros IDE. The following is a list of the macro samples and a description of what they do.
Try here for examples and tutorials
Code Project
Line Counter Add-in