public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/20403] New: dwarf2: DW_MACINFO_define - wrong lineno fields for predefined macros
@ 2005-03-10 13:09 niva at niisi dot msk dot ru
  2005-03-10 13:17 ` [Bug debug/20403] dwarf-3: " pinskia at gcc dot gnu dot org
  2005-03-10 14:01 ` dberlin at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: niva at niisi dot msk dot ru @ 2005-03-10 13:09 UTC (permalink / raw)
  To: gcc-bugs

* the options given when GCC was configured/built;

Configured with: 
/home/niva/svnwork/gccvendorcurrent/configure
--with-headers=/home/niva/oc2000/mips/src/include
 --without-libs --enable-generated-files-in-srcdir --enable-threads=posix
-with-dwarf2 
 --disable-shared --target=mips64-none-elf --verbose --enable-languages=c 
 --srcdir=/home/niva/svnwork/gccvendorcurrent --prefix=/home/niva/local --enable-cpp

     * the complete command line that triggers the bug;

mips64-none-elf-gcc -v -g3 -c -o macros.o macros.c -DMYMACRO="123456" -UTTT
-save-temps
mips64-none-elf-readelf --debug-dump=macro macros.o

     * the compiler output (error messages, warnings, etc.);

No error messages

     * There are wrong line numbers in the DW_MACINFO_define and 
       DW_MACINFO_undef directives for pre(defined/undefined) macros. 

       According to the document "DWARF Debugging Information Format", 
       Version 3 November 12, 2003 (Draft 9), see
       6.3.3 Macinfo entries for Command Line Options, 

       "All such DW_MACINFO_define and DW_MACINFO_undef entries
       representing compilation options ... should encode the value 0 as 
       their line number operand."
       
       But readelf reports the lineno values 1, 2, 3, ... , etc.
       for the  <built-in> and <command line> DW_MACINFO_define and
       DW_MACINFO_undef entries.


     * the  preprocessed  file (*macro.i*)

# 1 "macros.c"
# 1 "/home/niva/tests/from_kost/debug1//"
# 1 "<built-in>"
#define __STDC_HOSTED__ 1
#define __GNUC__ 3
#define __GNUC_MINOR__ 4
#define __GNUC_PATCHLEVEL__ 3
#define __SIZE_TYPE__ unsigned int
#define __PTRDIFF_TYPE__ int
#define __WCHAR_TYPE__ int
#define __WINT_TYPE__ unsigned int
#define __GXX_ABI_VERSION 1002
#define __SCHAR_MAX__ 127
#define __SHRT_MAX__ 32767
#define __INT_MAX__ 2147483647
#define __LONG_MAX__ 2147483647L
#define __LONG_LONG_MAX__ 9223372036854775807LL
#define __WCHAR_MAX__ 2147483647
#define __CHAR_BIT__ 8
#define __FLT_EVAL_METHOD__ 0
#define __FLT_RADIX__ 2
#define __FLT_MANT_DIG__ 24
#define __FLT_DIG__ 6
#define __FLT_MIN_EXP__ (-125)
#define __FLT_MIN_10_EXP__ (-37)
#define __FLT_MAX_EXP__ 128
#define __FLT_MAX_10_EXP__ 38
#define __FLT_MAX__ 3.40282347e+38F
#define __FLT_MIN__ 1.17549435e-38F
#define __FLT_EPSILON__ 1.19209290e-7F
#define __FLT_DENORM_MIN__ 1.40129846e-45F
#define __FLT_HAS_INFINITY__ 1
#define __FLT_HAS_QUIET_NAN__ 1
#define __DBL_MANT_DIG__ 53
#define __DBL_DIG__ 15
#define __DBL_MIN_EXP__ (-1021)
#define __DBL_MIN_10_EXP__ (-307)
#define __DBL_MAX_EXP__ 1024
#define __DBL_MAX_10_EXP__ 308
#define __DBL_MAX__ 1.7976931348623157e+308
#define __DBL_MIN__ 2.2250738585072014e-308
#define __DBL_EPSILON__ 2.2204460492503131e-16
#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
#define __DBL_HAS_INFINITY__ 1
#define __DBL_HAS_QUIET_NAN__ 1
#define __LDBL_MANT_DIG__ 53
#define __LDBL_DIG__ 15
#define __LDBL_MIN_EXP__ (-1021)
#define __LDBL_MIN_10_EXP__ (-307)
#define __LDBL_MAX_EXP__ 1024
#define __LDBL_MAX_10_EXP__ 308
#define __DECIMAL_DIG__ 17
#define __LDBL_MAX__ 1.7976931348623157e+308L
#define __LDBL_MIN__ 2.2250738585072014e-308L
#define __LDBL_EPSILON__ 2.2204460492503131e-16L
#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L
#define __LDBL_HAS_INFINITY__ 1
#define __LDBL_HAS_QUIET_NAN__ 1
#define __REGISTER_PREFIX__ 
#define __USER_LABEL_PREFIX__ 
#define __VERSION__ "3.4.3"
#define __NO_INLINE__ 1
#define __FINITE_MATH_ONLY__ 0

#define __mips__ 1
#define _mips 1
#define mips 1
#define __mips64 1
#define __R4000 1
#define __R4000__ 1
#define R4000 1
#define _R4000 1
#define __mips_fpr 64
#define _MIPS_ARCH_MIPS3 1
#define _MIPS_ARCH "mips3"
#define _MIPS_TUNE_MIPS3 1
#define _MIPS_TUNE "mips3"
#define __mips 3
#define _MIPS_ISA _MIPS_ISA_MIPS3
#define __mips_hard_float 1
#define __MIPSEB 1
#define __MIPSEB__ 1
#define MIPSEB 1
#define _MIPSEB 1
#define __LANGUAGE_C 1
#define __LANGUAGE_C__ 1
#define LANGUAGE_C 1
#define _LANGUAGE_C 1
# 1 "<command line>"
#define MYMACRO 123456
#undef TTT
# 1 "macros.c"
#define max(x,y) ((x) >= (y) ? (x) : (y))


#define min(x,y) ((x) <= (y) ? (x) : (y))


int main ()
{
  int i = 6, k = 7;
  return ((i) <= (k) ? (i) : (k)) + ((i) >= (k) ? (i) : (k));
}





    * The output of "mips64-none-elf-readelf --debug-dump=macro macros.o":

  
 DW_MACINFO_define - lineno : 1 macro : __STDC_HOSTED__ 1
 DW_MACINFO_define - lineno : 2 macro : __GNUC__ 3
 DW_MACINFO_define - lineno : 3 macro : __GNUC_MINOR__ 4
 DW_MACINFO_define - lineno : 4 macro : __GNUC_PATCHLEVEL__ 3
 DW_MACINFO_define - lineno : 5 macro : __SIZE_TYPE__ unsigned int
 DW_MACINFO_define - lineno : 6 macro : __PTRDIFF_TYPE__ int
 DW_MACINFO_define - lineno : 7 macro : __WCHAR_TYPE__ int
 DW_MACINFO_define - lineno : 8 macro : __WINT_TYPE__ unsigned int
 DW_MACINFO_define - lineno : 9 macro : __GXX_ABI_VERSION 1002
 DW_MACINFO_define - lineno : 10 macro : __SCHAR_MAX__ 127
 DW_MACINFO_define - lineno : 11 macro : __SHRT_MAX__ 32767
 DW_MACINFO_define - lineno : 12 macro : __INT_MAX__ 2147483647
 DW_MACINFO_define - lineno : 13 macro : __LONG_MAX__ 2147483647L
 DW_MACINFO_define - lineno : 14 macro : __LONG_LONG_MAX__ 9223372036854775807LL
DW_MACINFO_define - lineno : 15 macro : __WCHAR_MAX__ 2147483647
 DW_MACINFO_define - lineno : 16 macro : __CHAR_BIT__ 8
 DW_MACINFO_define - lineno : 17 macro : __FLT_EVAL_METHOD__ 0
 DW_MACINFO_define - lineno : 18 macro : __FLT_RADIX__ 2
 DW_MACINFO_define - lineno : 19 macro : __FLT_MANT_DIG__ 24
 DW_MACINFO_define - lineno : 20 macro : __FLT_DIG__ 6
 DW_MACINFO_define - lineno : 21 macro : __FLT_MIN_EXP__ (-125)
 DW_MACINFO_define - lineno : 22 macro : __FLT_MIN_10_EXP__ (-37)
 DW_MACINFO_define - lineno : 23 macro : __FLT_MAX_EXP__ 128
 DW_MACINFO_define - lineno : 24 macro : __FLT_MAX_10_EXP__ 38
 DW_MACINFO_define - lineno : 25 macro : __FLT_MAX__ 3.40282347e+38F
 DW_MACINFO_define - lineno : 26 macro : __FLT_MIN__ 1.17549435e-38F
 DW_MACINFO_define - lineno : 27 macro : __FLT_EPSILON__ 1.19209290e-7F
 DW_MACINFO_define - lineno : 28 macro : __FLT_DENORM_MIN__ 1.40129846e-45F
 DW_MACINFO_define - lineno : 29 macro : __FLT_HAS_INFINITY__ 1
 DW_MACINFO_define - lineno : 30 macro : __FLT_HAS_QUIET_NAN__ 1
 DW_MACINFO_define - lineno : 31 macro : __DBL_MANT_DIG__ 53
 DW_MACINFO_define - lineno : 32 macro : __DBL_DIG__ 15
 DW_MACINFO_define - lineno : 33 macro : __DBL_MIN_EXP__ (-1021)
 DW_MACINFO_define - lineno : 34 macro : __DBL_MIN_10_EXP__ (-307)
 DW_MACINFO_define - lineno : 35 macro : __DBL_MAX_EXP__ 1024
 DW_MACINFO_define - lineno : 36 macro : __DBL_MAX_10_EXP__ 308
 DW_MACINFO_define - lineno : 37 macro : __DBL_MAX__ 1.7976931348623157e+308
 DW_MACINFO_define - lineno : 38 macro : __DBL_MIN__ 2.2250738585072014e-308
 DW_MACINFO_define - lineno : 39 macro : __DBL_EPSILON__ 2.2204460492503131e-16
 DW_MACINFO_define - lineno : 40 macro : __DBL_DENORM_MIN__ 4.9406564584124654e-324
 DW_MACINFO_define - lineno : 41 macro : __DBL_HAS_INFINITY__ 1
 DW_MACINFO_define - lineno : 42 macro : __DBL_HAS_QUIET_NAN__ 1
 DW_MACINFO_define - lineno : 43 macro : __LDBL_MANT_DIG__ 53
 DW_MACINFO_define - lineno : 44 macro : __LDBL_DIG__ 15
 DW_MACINFO_define - lineno : 45 macro : __LDBL_MIN_EXP__ (-1021)
 DW_MACINFO_define - lineno : 46 macro : __LDBL_MIN_10_EXP__ (-307)
 DW_MACINFO_define - lineno : 47 macro : __LDBL_MAX_EXP__ 1024
 DW_MACINFO_define - lineno : 48 macro : __LDBL_MAX_10_EXP__ 308
 DW_MACINFO_define - lineno : 49 macro : __DECIMAL_DIG__ 17
 DW_MACINFO_define - lineno : 50 macro : __LDBL_MAX__ 1.7976931348623157e+308L
 DW_MACINFO_define - lineno : 51 macro : __LDBL_MIN__ 2.2250738585072014e-308L
 DW_MACINFO_define - lineno : 52 macro : __LDBL_EPSILON__ 2.2204460492503131e-16L
 DW_MACINFO_define - lineno : 53 macro : __LDBL_DENORM_MIN__
4.9406564584124654e-324L
 DW_MACINFO_define - lineno : 54 macro : __LDBL_HAS_INFINITY__ 1
 DW_MACINFO_define - lineno : 55 macro : __LDBL_HAS_QUIET_NAN__ 1
 DW_MACINFO_define - lineno : 56 macro : __REGISTER_PREFIX__
 DW_MACINFO_define - lineno : 57 macro : __USER_LABEL_PREFIX__
 DW_MACINFO_define - lineno : 58 macro : __VERSION__ "3.4.3"
 DW_MACINFO_define - lineno : 59 macro : __NO_INLINE__ 1
 DW_MACINFO_define - lineno : 60 macro : __FINITE_MATH_ONLY__ 0
 DW_MACINFO_define - lineno : 62 macro : __mips__ 1
 DW_MACINFO_define - lineno : 63 macro : _mips 1
 DW_MACINFO_define - lineno : 64 macro : mips 1
 DW_MACINFO_define - lineno : 65 macro : __mips64 1
 DW_MACINFO_define - lineno : 66 macro : __R4000 1
 DW_MACINFO_define - lineno : 67 macro : __R4000__ 1
 DW_MACINFO_define - lineno : 68 macro : R4000 1
 DW_MACINFO_define - lineno : 69 macro : _R4000 1
 DW_MACINFO_define - lineno : 70 macro : __mips_fpr 64
 DW_MACINFO_define - lineno : 71 macro : _MIPS_ARCH_MIPS3 1
 DW_MACINFO_define - lineno : 72 macro : _MIPS_ARCH "mips3"
 DW_MACINFO_define - lineno : 73 macro : _MIPS_TUNE_MIPS3 1
 DW_MACINFO_define - lineno : 74 macro : _MIPS_TUNE "mips3"
 DW_MACINFO_define - lineno : 75 macro : __mips 3
 DW_MACINFO_define - lineno : 76 macro : _MIPS_ISA _MIPS_ISA_MIPS3
 DW_MACINFO_define - lineno : 77 macro : __mips_hard_float 1
 DW_MACINFO_define - lineno : 78 macro : __MIPSEB 1
 DW_MACINFO_define - lineno : 79 macro : __MIPSEB__ 1
 DW_MACINFO_define - lineno : 80 macro : MIPSEB 1
 DW_MACINFO_define - lineno : 81 macro : _MIPSEB 1
 DW_MACINFO_define - lineno : 82 macro : __LANGUAGE_C 1
 DW_MACINFO_define - lineno : 83 macro : __LANGUAGE_C__ 1
 DW_MACINFO_define - lineno : 84 macro : LANGUAGE_C 1
 DW_MACINFO_define - lineno : 85 macro : _LANGUAGE_C 1
 DW_MACINFO_define - lineno : 1 macro : MYMACRO 123456
 DW_MACINFO_undef - lineno : 2 macro : TTT
 DW_MACINFO_define - lineno : 1 macro : max(x,y) ((x) >= (y) ? (x) : (y))
 DW_MACINFO_define - lineno : 4 macro : min(x,y) ((x) <= (y) ? (x) : (y))
 DW_MACINFO_end_file

-- 
           Summary: dwarf2: DW_MACINFO_define - wrong lineno fields for
                    predefined macros
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: niva at niisi dot msk dot ru
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: mips64-none-elf


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20403


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug debug/20403] dwarf-3: DW_MACINFO_define - wrong lineno fields for predefined macros
  2005-03-10 13:09 [Bug debug/20403] New: dwarf2: DW_MACINFO_define - wrong lineno fields for predefined macros niva at niisi dot msk dot ru
@ 2005-03-10 13:17 ` pinskia at gcc dot gnu dot org
  2005-03-10 14:01 ` dberlin at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-10 13:17 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-debug
            Summary|dwarf2: DW_MACINFO_define - |dwarf-3: DW_MACINFO_define -
                   |wrong lineno fields for     |wrong lineno fields for
                   |predefined macros           |predefined macros


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20403


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug debug/20403] dwarf-3: DW_MACINFO_define - wrong lineno fields for predefined macros
  2005-03-10 13:09 [Bug debug/20403] New: dwarf2: DW_MACINFO_define - wrong lineno fields for predefined macros niva at niisi dot msk dot ru
  2005-03-10 13:17 ` [Bug debug/20403] dwarf-3: " pinskia at gcc dot gnu dot org
@ 2005-03-10 14:01 ` dberlin at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: dberlin at gcc dot gnu dot org @ 2005-03-10 14:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dberlin at gcc dot gnu dot org  2005-03-10 14:01 -------
This is technically correct.
In 4.0 we are still off by a  single line, we claim it to be line 1 when it
should be 0.
We also will output them after the main file starts (this is because of the
order of CPP processing).
However, this is an incredibly minor bug.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20403


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-03-10 14:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-10 13:09 [Bug debug/20403] New: dwarf2: DW_MACINFO_define - wrong lineno fields for predefined macros niva at niisi dot msk dot ru
2005-03-10 13:17 ` [Bug debug/20403] dwarf-3: " pinskia at gcc dot gnu dot org
2005-03-10 14:01 ` dberlin at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).