New C++ Concurrency Static Analysis Warnings in Visual Studio 2012

Monday, July 2, 2012

Another cool feature in the Visual Studio 2012 C++ compiler is the revamped code analysis rule sets and brand new UI for configuring them. This is not just the simple /analyze switch we all know and love since Visual Studio 2005 anymore. To get a general impression of the UI changes, open a C++ project’s properties and check out the Code Analysis node. You’ll be able to review the rule set that runs on your project and optionally enable/disable specific warnings. Check out some of these rules: Specifically, I’d like to focus on the new...

Visual Studio 2012 C++ Auto-Parallelizer

Sunday, June 17, 2012

As you might have gathered from some scarce reports on the Web and the initial list of new features in Visual Studio 2012, the new C++ compiler is now capable of automatically vectorizing loop bodies—a feature I’ve already covered here, and also automatically parallelizing them using multiple threads. Here’s an example. Consider the classic prime number calculation loop, designed to count the number of primes in a given range: __declspec(noinline) bool is_prime(int n) {     for (int x = 2; x < n; ++x) {        ...
no comments

Developing Device Drivers in Studio 11

Saturday, November 26, 2011

Another piece of great news delivered at //build/ has to do with device driver development. Coincidentally, a few weeks ago I posted a series of baby-steps with Windows driver development, and if you’ve read some of that you’d notice that the driver dev work is very different from application development – you use a different build environment, you deploy drivers manually, and you debug them with a different debugger. This story changes, however, with Visual Studio 11. You can now build drivers in Visual Studio, deploy them to test machines automatically, and debug (in kernel-mode!) using the Visual...

Use the WinDbg Engine in Visual Studio User-Mode Debugging

Tuesday, November 15, 2011

In our C++ Debugging course, there are several scenarios which require WinDbg and cannot be completed in Visual Studio. They all rely on advanced extension commands available in WinDbg. Some examples: Tracing opened and closed handles with the !htrace command Viewing native heap information with the !heap command Loading and executing code in the debuggee process with the SDbgExt extension commands !loaddll, !remotecall Inspecting handles to synchronization objects with the !handle command The sheer power of WinDbg built-in commands and...
one comment

SELA Developer Practice: December 2011

Sunday, October 30, 2011

I’m interrupting our scheduled programming for an important announcement: we will be hosting the SELA Developer Practice at the Crown Plaza hotel (Tel Aviv) and the SELA headquarters on December 4-8, 2011! The format is (again) slightly different—we will be having a day full of keynote sessions on Windows 8 and other //build announcements, including Visual Studio 11 and .NET Framework 4.5. Then, we will host 22 full-day tutorials on a wide variety of topics—old and new—parallel programming, Windows 8 development, TFS, Windows Phone Mango, HTML 5, .NET debugging, and many others. The speakers are...
no comments

SIMD-Optimized C++ Code in Visual Studio 11

Monday, October 17, 2011

The C++ compiler in Visual Studio 11 has another neat optimization feature up its sleeve. Unlike intrusive features, such as running code on the GPU using the AMP extensions, this one requires no additional compilation switches and no changes – even the slightest – to the code. The new compiler will use SIMD (Single Instruction Multiple Data) instructions from the SSE/SSE2 and AVX family to "parallelize" loops. This is not the standard, thread-level parallelism, which runs certain iterations of the loop in parallel. This is the processor’s inherent ability to execute operations on individual parts of large data...

Open Kernel Crash Dumps in Visual Studio 11

Friday, October 14, 2011

A dream is coming true. A dream where all the debugging you’ll ever do on your developer box is going to be in a single tool – Visual Studio. In a later post, I will discuss device driver development in Visual Studio 11, which is another dream come true. For now, let’s take a look at how Visual Studio can open kernel crash dumps and perform crash analysis with all the comfy tool windows and UI that we know and love. To perform kernel crash analysis in Visual Studio 11, you will need to install the Windows...

Debugging Optimized Code in Visual Studio 11

Wednesday, October 12, 2011

Executive summary: When using the Windows debugger engine to debug optimized C++ code compiled with Visual Studio 11 you can step into inline functions and see local variables that are stored in CPU registers. The current (Visual Studio 2010 compiler) state of affairs is that compiler optimizations are way smarter than the debugger engine, which lacks the information necessary to map a fully optimized binary back to the source code in a reliable manner. This is why C++ developers don’t like debugging optimized code: as if the compiler-introduced reorderings which take you from one line to a completely...

Sessions at BUILD Day 2 and Windows 8

Thursday, September 15, 2011

The second day of the BUILD conference was dedicated mostly to breakout-style sessions on the various topics covered only in brief during the keynotes. Some of the new stuff I’ve seen today in pseudo-random order: Visual Studio 11 Productivity Power Tools (with over a million downloads)! are going to be built-in in Visual Studio 11. You can right-click a piece of code in Visual Studio and select “Find Matching Clones” for a similarity analyzer that detects copy-paste across the board. Visual Studio will feature...
no comments