I tried to use a Performance wizard tool for my short C++ testing in VS 2010 Ultimate.
But for any code the profiling process crashes and the following error occurs:
Could not launch xxx.exe. Injection of runtime library failed.
By this time I used Netbeans and with the VS 2010 profiler I do not have much experience.
I wonder whether this function is available for unmanaged C++... The C++ code is correct...
Configuration: VS 2010 Ultimate, Win 7 Prof. 32 bit.
Updated question:
An instrumentation method works well but the CPU sampling method still does not work.
Yes, the profiler works on native code.
Try running Visual Studio as an elevated admin user.
Check if you have enabled Application Verifer shims for your application.
This problem can be caused by some security or anti-malware program installing hooks in your program, so the profiler cannot get its hooks in. Some vendors provide ways to limit those hooks so you can profile, or you could just try turning it off for a period while profiling.
Related
To get the dump file (for crashes) I am using the userModeProcessorDumper.exe. Now the question is how to read this file (to see the stack information). Regarding this I have couple of questions
Yes I know I can use WinDbg (related tools) to analyze the .dmp file. My question is - Can this be analyzed in Visual Studio? To be more specific - I am having Visual Studio Enterprise Edition 6 - In this particular pack - can the .dmp file be opened for analysis.
If Yes, Please help me with steps.
I see in web advice to use Visual Studio 2XXX version. So I am feeling that the same cannot be done using VS Enterprise Edition.
The application is built on MinGW, even these application - can we analyze in Visual Studio (what ever is the edition - i.e Visual Studio 2XXX or VS Enterprise Edition X.Y)? Should I take care of any additional setting for this.
Any material link on this topic would be very helpful to me.
Thanks a lot in advance for your advice.
PS : My application is a C++ based application.
From what I remembered, VS6 cannot be used to debug dumps. It's been a while since I last used it, and trying to verify me memory I came across a workaround that might allow you to debug those dumps after all: Visual C++ 6, and post-mortem (crash dump) debugging.
I don't have VC6 at hand, and have no idea if this really works. Other than that, I feel for you... There are IDEs so much better than VC6. Hope this inability gives you the push towards an upgrade. Debugging dumps is really easy with VC7 and above.
Which version of VS 2010 has PreFast static code analyzer for native c++? I have downloaded VS 2010 Ultimate edition trial version in hope that it would contain all the features, but could not found inbuilt PreFast in it.
I tried to link VS 2010 to set it directories with WDK's PreFast and add "/analyze" in comand Line additional options but unable to get results.
it's in ultimate (I just tested it), but I don't think it's in pro.
help page http://msdn.microsoft.com/en-us/library/bb385907.aspx
I was looking for some memory leakage, thread dead locks kind of rules.
Prefast is static analysis tool. It checks for possible NULL derefferensing, buffer overruns and such. You are looking for dynamic analysis tool like Bounds Checker. Not sure, that it is available for VS 2010. Another option would be to use Application Verifyer.
How can I get Visual Studio to help me optimize my application, or tell me areas of slowness? Thanks
If you have Visual Studio 2013 Professional then you can use the Performance and Diagnostics hub: http://blogs.msdn.com/b/visualstudioalm/archive/2013/07/12/performance-and-diagnostics-hub-in-visual-studio-2013.aspx . This profiler is well integrated in the IDE and I've found it really quick and easy for spotting code hotspots.
If you have the super enterprise edition it's built in (but I haven't used it - and I think it's ability to profile unmanaged code is limited)
Otherwise see What's the best free C++ profiler for Windows?
As another suggestion, I have found the AMD CodeAnalyst a great companion. It integrates with VS2010 very well, and provides detailed breakdown of CPU time on a line-to-line basis. You can zoom in and out to see from a top-level to a function-level. Not to mention it even has in-line disassembly display if you need that extra bit of information!
Totally worth a try.
The Windows SysInternals website has a number of other useful utilities for network management, security, system information and more. Check it out. I’m sure you’ll find something of value.
Here is how it helped me:
Slow Visual Studio Performance … Solved!
I had an odd performance-related issue today. My Microsoft Visual Studio seemed to be taking far too long to perform even the simplest of operations. I Googled around and tried a few ideas that people had such as disabling add-ins or clearing Visual Studio’s recent projects list but those suggestions didn’t seem to solve the problem. I remembered that the Windows SysInternals website had a tool called Process Monitor that would sniff registry and file accesses by any running program. It seemed to me that Visual Studio was up to something and Process Monitor should help me figure out what it was. I downloaded the most recent version, and after fiddling around a bit with its display filters, ran it and to my horror, I saw that Visual Studio was so slow because it was accessing the more than 10,000 folders in C:\Users\krintoul\AppData\Local\Microsoft\WebSiteCache on most IDE operations. I’m not sure why there were that many folders and moreover, wasn’t sure what Visual Studio was doing with them, but after I zipped those folders up and moved them somewhere else, Visual Studio’s performance improved tremendously.
I've recently obtained an HTC Desire and I'm interested in porting my 3D engine to the device. I have a slight annoyance however. I'd love to be able to do development under Visual Studio 2008. Am I to assume I'm going to need to re-process my SLN files to do GCC builds? Its not a vast issue as I already have an application that processes SLN and VCProj files through GCC and then links them together at the other end. I'll just need to set up the right libraries with it.
Are there any other gotchas I need to think about? Or, indeed, is there an easier way?
Any info would be much appreciated!
Cheers :)
You will need to use your own or the NDK supplied build system. I believe Visual Studio can be set up to call external commands to build. You can of course use Visual Studio as the code editor, and call the NDK supplied make on the Makefile to build your application. You can't use Visual Studio as a debugger.
Im not used with VS. Using it to develop android apps sounds like pain to me. Main reason is that i dont think it got any plugins for android as Eclipse does. I guess you can use it as pure Java IDE (??), but still... building, editing and syntax hightlighting, code-autocomplete, etc etc... will be missing...
Follow the instructions on using Ant to do builds and you should be able to figure out how to make the VS build process drive your apps.
I don't understand the desire to use such a terrible code editor, but anyone trying to set up their IDE to build Android apps should start with the Ant stuff that they document.
Simply Put,
XCode + Eclipse + Carbide etc all cannot match the debugging environment of Visual Studio, GDB simply sucks our time.
These workaround tools just slow down the working process, to be honest working in xcode or esp eclipse seems like your thinking process is being overtaken by the management of bloatware that is required to manage the development in these forsaken IDE's. However Visual Studio development is more responsive and the IDE always seem to be prepared for any of your explorations
Regards
Bil
I develop commercial unmanaged C++ app on Visual Studio 2008, and I want to add a static-code analysis tool.
Any recommendations?
I think it would be real nice if the tool can be integrated into MSVC.
I'm thinking about PC-Lint + Visual Lint
However, I have been taking a hard look at Coverity, Understand, and Klockwork as well.
Price isnt really the issue. I want opinions from people who actually used the tool for unmanaged C++ on MSVC, and they just absolutely loved it.
Lastly, VSTS and Intel Parallel Studio now also offer static code analysis. Nice~
Note: related post suggest Coverity is the best (?) (see last 2 posts)
Beyond all those you mentioned, VS Team Developer edition comes bundled with a nice static analysis tool called prefast. Its (obviously..) well integrated into the IDE, and accessible via the menus.
Its in fact a public release of an MS internal tool - a thin version of a tool called Prefix they run on their builds. Personally, when I faced the same decision, prefast sufficed.
I work for RedLizard building Goanna, a C++ static analysis plugin for Visual Studio. Its focus is on desktop use by a programmer. You can run it on individual files, just as you do the compiler, and it can give you results quickly.
There is a trial available. Right-click a file, select Run Goanna, and the results appear in the Visual Studio warnings list.
You can try CppDepend, a pretty complete c and c++ static analyzer, well integrated with VS 2008, 2010, 2012, 2013 and 2015.
I just started using cppcheck which I like very much due to the low noise.
Although it does not integrate directly with Visual Studio 2008, VS can be customized and you should be able to integrate it directly into the IDE.
I use PVS-Studio static code analyzer.
This static code analyzer good integrated with Visual Studio 2005, 2008, 2010, 2012, 2013.
It has many additional features:
Verification of files which were recently modified several days ago;
Verification of files by their filenames from within the text file
list;
version control systems integration; ability to operate fro m command line
interface;
«False Alarms» marking; saving and loading of analysis
results;
utilizing all available cores and processors;
etc...