简体   繁体   中英

Find all functions generated by macros

我正在尝试使用C中的宏生成各种函数。有没有办法让我看到编译期间生成的所有函数?

If you are using gcc, the option -save-temps saves the intermediate steps of compilation (preprocessed files and assembly code) while generating binary.

You can see a brief description here .

You could use nm on the object file to get the name of public (non static ) functions.

You could pass the -v option to the cc1 to get the the name of compiled functions.

You could also extend your recent GCC compiler using MELT

And of course, you could get the preprocessed form, as other answers suggested.

您可以使用gcc编译器的-E选项来查看预处理文件。

gcc -E main.c > main.i

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM