[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-bugs
Subject:    [Bug debug/20253] New: [3.4/4.0 regression]: Macro debug info broken due to lexer change
From:       "dberlin at gcc dot gnu dot org" <gcc-bugzilla () gcc ! gnu ! org>
Date:       2005-02-28 19:59:42
Message-ID: 20050228195936.20253.dberlin () gcc ! gnu ! org
[Download RAW message or body]

the lexer is no longer calling debug_hooks.start_source_file/end_source_file for
the "base compilation file" (IE the one passed on the command line or giving us
something about stdin, if that is the case).
This breaks macro debug info in dwarf2 because the standard specifies we must
have a start/end file pair for the base file.

This problem did not occur in 3.3.4.

Compile the following test case with 3.3.4 and -g3 -gdwarf-2 -fverbose-asm -dA
-save-temps, and look at the .s file:


#include <stdio.h>

#define ADD(x) (M + x)

main ()
{
#define N 28
#define M 42
   printf ("We're so creative: %d.\n", ADD(N));
}




For 3.3.4 you will see

   .section        .debug_macinfo
        .byte   0x3     # Start new file
        .uleb128 0x0    # Included from line number 0
        .file 1 "sample.c"
        .uleb128 0x1    # Filename we just started

...
 .section        .debug_macinfo
        .byte   0x4     # End file
        .byte   0x0     # End compilation unit


For 3.4/4.0 you will not see these, we just immediately start outputting the macros.

The reason is that debug_hooks.start_source_file/end_source_file is never called
for "sample.c", as it was before.

If someone could reghunt this i'd appreciate it (You should be able to simply
grep the resulting .s file for "End compilation unit" and consider it broken
when it stops appearing).

-- 
           Summary: [3.4/4.0 regression]: Macro debug info broken due to
                    lexer change
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dberlin at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20253
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic