On 07/30/2009 07:38 AM, sumanth wrote:
How can I make sure the debugging information printed by my compiler for extern variables is correct. I am able to print them in gdb in with an _ (underscore). I am using Gcc-4.3.4 and gdb 5.3
ELF targets usually don't prepend an underscore to symbol names. But if you are prepending an underscore for some reason, then you need to make sure that your ASM_OUTPUT_* macros handle this correctly. You set USER_LABEL_PREFIX to an underscore, and then you add the USER_LABEL_PREFIX unless the symbol name starts with '*'. See the ASM_GENERATE_INTERNAL_LABEL docs. This stuff can be tricky. You will probably have to step through your cc1 port in gdb to see exactly what is going on. It will be useful to look at an existing port that handles this correctly; step through it in gdb to see how it works.
Jim