[Bug driver/49726] -g0 file.S -g does not produce debug info

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jul 13 23:09:00 GMT 2011


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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-07-13 23:08:31 UTC ---
The problem is that the specs don't understand that -g0 is overridden by -g in
the driver.  In the cc1/cc1plus/fortran1 case, the driver passes -g* directly
to those programs but in the as case, it has to do something special:
#ifndef ASM_DEBUG_SPEC
# if defined(DBX_DEBUGGING_INFO) && defined(DWARF2_DEBUGGING_INFO) \
     && defined(HAVE_AS_GDWARF2_DEBUG_FLAG) &&
defined(HAVE_AS_GSTABS_DEBUG_FLAG)
#  define ASM_DEBUG_SPEC                        \
      (PREFERRED_DEBUGGING_TYPE == DBX_DEBUG                \
       ? "%{!g0:%{gdwarf-2*:--gdwarf2}%{!gdwarf-2*:%{g*:--gstabs}}}" ASM_MAP   
\
       : "%{!g0:%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}}" ASM_MAP)
# else
#  if defined(DBX_DEBUGGING_INFO) && defined(HAVE_AS_GSTABS_DEBUG_FLAG)
#   define ASM_DEBUG_SPEC "%{g*:%{!g0:--gstabs}}" ASM_MAP
#  endif
#  if defined(DWARF2_DEBUGGING_INFO) && defined(HAVE_AS_GDWARF2_DEBUG_FLAG)
#   define ASM_DEBUG_SPEC "%{g*:%{!g0:--gdwarf2}}" ASM_MAP
#  endif
# endif
#endif
#ifndef ASM_DEBUG_SPEC
# define ASM_DEBUG_SPEC ""
#endif



More information about the Gcc-bugs mailing list