Search Posts

gcc can’t handle too much #if macro

gcc can’t handle too much macro (#if, #define), the output dwarf will have wrong line number. So when you disassemble the assembly with c/c++ source, everything are wrong, including wrong line number, wrong assembly code to c source code, duplicated c/c++ line.

https://github.com/gcc-mirror/gcc/blob/master/libgcc/libgcc2.c

wrong dwarf produced by gcc
wrong dwarf produced by gcc

 

The decoded lines are out of order
The decoded lines are out of order

In GKD, i add an on/off button to filter out those out of order source, i can’t prove it must be correct but it makes the assembly code more reasonable.

filter out of order c source
filter out of order c source

1 comment on gcc can’t handle too much #if macro

Leave a Reply

Your email address will not be published. Required fields are marked *