July 28th, 2021

Visual Studio Code C++ July 2021 Update: Disassembly View, Macro Expansion and Windows ARM64 Debugging

Julia Reid
Program Manager 2

The July 2021 update of the C++ extension for Visual Studio Code is here, bringing you brand new features— such as a Disassembly View while debugging, inline macro expansions, and debug support for Windows ARM64 architecture—along with a bunch of enhancements and bug fixes. To find out more about all the enhancements, check out our release notes on GitHub.

Disassembly View

We’re excited to announce that Disassembly View— our #1 upvoted GitHub issue (#206)— is publicly available in VS Code Insiders! Disassembly View allows you to debug assembly code corresponding to the instructions created by your compiler. It’ll be available in the 1.59 release of Visual Studio Code in August, but in the meantime you can download VS Code Insiders and try it out!

To open Disassembly View while debugging, right click your source code and select Open Disassembly View.

Image showing the right-click menu option to Open Disassembly View

In the Disassembly View, the yellow hollow marker represents the current instruction. For each instruction, you’ll see the memory address (left column) and the machine language instructions displayed as hex (middle column) and as assembly language (right column). You can navigate between instructions, step over (F10) and step in to (F11) instructions.

Image showing the Disassembly View opened side by side with source code

To set a breakpoint in the Disassembly View, hover over the instruction and click the red filled circle that appears to the left of the memory address.

Image showing the red filled circle that appears on hover to set a breakpoint at an instruction in Disassembly View

Unset the breakpoint by clicking the red dot again, or by unchecking the box in the Breakpoints section of the Debug pane.

Image showing the Breakpoints section of the Debug pane, where users can enable and disable breakpoints

Check out this GIF to see Disassembly View in action:

GIF showing how to open Disassembly View while debugging, navigate between instructions and set breakpoints

Macro Expansion

With this latest release of the C++ extension, you can expand macros inline (GitHub issue #4183), making it easier to read and understand your code. To expand a macro inline, click on it, select the lightbulb, and then click Inline macro.

GIF showing how to expand a macro inline

Windows ARM64 Debugging

Last year, we announced support for running the C++ extension on Windows ARM64 architecture, giving Surface Pro X users access to C++ IntelliSense, code navigation, and build support. With the July 2021 update of the C++ extension, you can debug projects on Windows ARM64, completing the end-to-end Surface Pro X C++ development experience in VS Code.

What do you think?

Download the C++ extension for Visual Studio Code today, give it a try, and let us know what you think. If you run into any issues, or have any suggestions, please report them in the Issues section of our GitHub repository. You can also join our Insiders program and get access to early builds of our release by going to File > Preferences > Settings and under Extensions > C/C++, change the “C_Cpp: Update Channel” to “Insiders.” Then under Features > Extensions, enable “Extensions: Auto Update.”

We can be reached via the comments below or in email at visualcpp@microsoft.com. You can also find our team on Twitter at @VisualC.

Category
C++

Author

Julia Reid
Program Manager 2

11 comments

Discussion is closed. Login to edit/delete existing comments.

  • purple u

    could this extension have at least a memory address searcher on it, hard to use for this moment.

  • Xiangxian Zhou

    Thank you Julia for your great effort in Makefile Tool and Disassembly View. Now vscode is a full-fledged IDE that can be used in system programming. I have been searching for this kind of tool for long time, and finally I got this, thank you!

    • Xiangxian Zhou

      When I click open Disassembly view during debugging a simple C program, the Disassembly view is empty. I guess I missed something in my gcc compiling command, Can you provide your compiling command?

      • Julia ReidMicrosoft employee Author

        It should be working for C programs… are you building/debugging with Makefile Tools or with the C++ extension?

      • Xiangxian Zhou

        I am using Makefile Tools and C++ extension. I use gcc in the Makefile to compile program like this “gcc -g -o hello hello.c”.

  • Shahid Roofi Khan · Edited

    A stable simple working feature is better thing that boat of features that you can't rely on.

    When we talking about debugging linux code in VS code, facililated through above extension, basic debugging have to work first reliably.

    took me whole day today, to find out that i could not debug my C Code using Linux GDB, because of VSCode / Extension for C/C++.

    Eventually i had to use another IDE to debug, but i found out that...

    Read more
    • Julia ReidMicrosoft employee Author

      Hi Shahid – Thanks for logging an issue. Happy to see that your problem was resolved!

  • Toby

    Sounds great.
    Still won’t install this extension again though, due to this bug which makes the basic functionality of editing highly frustrating when using this extension.
    https://github.com/microsoft/vscode/issues/100530
    Unfortunately this bug renders the extension less than useless for me.

  • Kalebe Alves

    That’s one of my most awaited feature for vscode. Great job! I’ll test it now!
    Now the only things missing are a good memory view and auto completion for the debug console and watcher.

    • Kalebe Alves

      The extension worked poorly for me. Almost Everytime I try to disassembly it disconnects from gdb, in one instance it even crashed the whole cpptools runner, but I have a bigger problem. The registers reader functionality are virtually unusable. Everytime I try to get some value gdb crashes, but no problem happens when running the commands for the same thing over the terminal. I didn't had time to report this before but I'll do it...

      Read more