Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I effectively use gdb for debugging the compiler?

compiler debugging gdb
0
Posted

How do I effectively use gdb for debugging the compiler?

0

Pre-requirements:1. Your gcc version needs to be 2.95.2 or 2.96 2. To enable debugging, you can build the entire compiler with make BUILD_OPTIMIZE=DEBUG Or you can build individual components (such as wopt.so) by going into the corresponding targia_xxx directories, and build with “BUILD_OPTIMIZE=DEBUG”. To single step inside the backend components (we’ll show the CG portion, other components are similar): 1. Remember to set the environment variable LD_LIBRARY_PATH. For cross compiler this variable should be set as export LD_LIBRARY_PATH=${TOOROOT}/usr/ia64-orc-linux/lib/gcc-lib/ia64-orc-linux/2.0:$LD_LIBRARY_PATH For native compiler it should be export LD_LIBRARY_PATH=${TOOROOT}/usr/lib/gcc-lib/ia64-orc-linux/2.0:$LD_LIBRARY_PATH 2. First run orcc using options ” … -show -keep … “. It will keep some needed intermediate files. orcc -show -keep kk16.c It will print some info like this: /home/xyz/orc-2.0/usr/ia64-orc-linux/altbin/gcc -D_LANGUAGE_C -D_SGI_COMPILER_VERSION=10. -D__host_

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123