Skip to main content

Is it possible to see the value of a C macro in TRACE32? - Knowledgebase / TRACE32 PowerView - Lauterbach Support

Is it possible to see the value of a C macro in TRACE32?

Authors list

C preprocessor macros are generally not included in the debug information of the ELF file. Therefore, the debugger normally cannot determine their values.

However, you can manually declare macros in TRACE32 using:

sYmbol.CREATE.MACRO MACRO_1 <contents>
sYmbol.CREATE.MACRO MACRO_2 <contents>
sYmbol.CREATE.Done

You can display the list of manually created macros with:

sYmbol.List.MACRO

Some compilers can also include macro information in the ELF file. For example, GCC includes macro information when compiled with the -g3 option. This information is stored in the .debug_macinfo section.

When loading such an ELF file with Data.LOAD.Elf, use the /MACRO option to import the macro information into TRACE32:

Data.LOAD.Elf <file> /MACRO


Helpful Unhelpful

10 of 12 people found this page helpful

Comments (2)

Neelakantappa M
How to use these declared macros in T32? I have tried like below but didn't get the desired output. Getting symbol not found error. sYmbol.CREATE.MACRO MACRO_1 (0x25) sYmbol.CREATE.Done local &temp &temp = MACRO_1 gosub func MACRO_1 Both the methods didn't work.
Khaled Jmal

You should use &temp=Var.Value(MACRO_1) instead of &temp = MACRO_1

I also do not recommend to use white spaces in PRACTICE expressions.



Add a comment

ID-0
To prove you are a human, please tell us the text you see in the CAPTCHA image