How to Inspect Preprocessing Macros Using the DVT Eclipse IDE

Overview

This video explains how to use some of DVT's macro-oriented features: see macro values in tooltips, expand and collapse macro calls inline.

Details

Introduction

DVT has many ways to inspect and debug preprocessing macros. For example, to see the defined value of a simple macro, just hover it with the mouse cursor. For more elaborate macros, it's easier to inspect the preprocessed code in the editor.

Expanding Macros

To unravel a macro call, place the editor cursor on it, right-click, and select Macros > Expand one level inline. The macro call is commented out and replaced with a macro definition code with all parameters replaced.

In a similar way, you can apply preprocessing for a block of code. You can expand all levels in line and all the nested macro calls will be replaced as well.

Any macro expansion adds a high-priority reminder in the Tasks View, so that you don't forget to collapse it when you're done debugging.

Collapsing Macro Expansion

To undo the macro expansion, you can either right-click on the marker, or place the editor cursor on the DVT-Expand Macro Inline Start pragma, right-click, and select Macros > Collapse Inline Expansion.

Two very convenient shortcuts are assigned to the Expand and Collapse sections

  • Ctrl+Shift+Plus to expand
  • Ctrl+Shift+Minus to collapse

When trying to collapse a modified macro expansion, a dialog pops up to present the differences, so you can make sure that all of your changes have been reviewed and ported to the macro definition.