GDB Debug macro definition and display macro-defined values

Source: Internet
Author: User

Macro Definition #define APLLCON0 * (volatile unsigned int *) 0xff500100), value is virtual address

question :

GDB tracing Debug When you want to view the value of this macro, you are prompted as follows: No symbol "APLLCON0" in the current context.


Analysis :

Reference http://blog.csdn.net/jibing57/article/details/7439631

The compiler does not compile the macro definition extension information into a binary file by default.

View the description through man GCC, as follows


You need to add-gdwarf-2 and-g3 two parameters at compile time.

When GCC compiles, the extended debug information is compiled into the binary file, including the macro definition information, when the-G3 parameter is added.

Conclusion :

Add-g3-gdwarf-2 parameter after cflags parameter


Recompile, GDB debug macros, as follows



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.