Using the Macro Expansion Window
The Macro Expansion window enables you to investigate source code with complex multiple-line
macros. Macros are often used to define constants, but can also be used to define code
fragments that can be used like functions. When you work with code that uses macros in this
way, it might be difficult to understand what is happening in the code. You may need to
examine the macros in context with the source code that is calling the macro.
To view the source code with expanded macro code:
-
Right-click on the macro and select Navigate > View Macro Expansion from the pop-up
menu.
The Macro Expansion window opens to display the expanded macro in context with the code
that calls it.
-
You can also mouse over the code of interest while pressing Ctrl+Alt, and click the
hyperlink to open the Macro Expansion window.
In the Macro Expansions window, the macro contents are located inside guarded blocks.
Semantic highlighting is provided for expanded code. You can use hyperlinks in the Macro
Expansion window to go to other source files. Also there is highlighting for macro parameter
usages.
The left column of the Macro Expansion window includes several toolbar buttons:
-
Synchronize caret, content and context
This option synchronizes caret position and content in the source file in the Editor
window and in the Macro Expansion window.
It also changes context to make it relevant to caret position (if expand local context
only selected).
-
Expand local context only Only the macros in the code block where the caret is located are
expanded in the Macro Expansion window.
-
Expand whole file
All macros in the source file are expanded in the Macro Expansion window.
-
Up and down arrows
These buttons are for quick navigation to go to the next macro or go to the previous
macro.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.