public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/53453] New: darwin linker expects both AT_name and AT_comp_dir debug notes
@ 2012-05-22 13:27 howarth at nitro dot med.uc.edu
  2012-05-22 14:30 ` [Bug debug/53453] " howarth at nitro dot med.uc.edu
                   ` (18 more replies)
  0 siblings, 19 replies; 20+ messages in thread
From: howarth at nitro dot med.uc.edu @ 2012-05-22 13:27 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53453
           Summary: darwin linker expects both AT_name and AT_comp_dir
                    debug notes
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: howarth@nitro.med.uc.edu


Future versions of dsymutil on darwin will emit warnings of the form...

warning: no debug symbols in executable (-arch x86_64)

warning: no debug symbols in executable (-arch i386)

when the debug note for AT_comp_dir is missing from linked object files.
Upstream had the following comments...

------------------------------------------------------------------------
The issue is not directly dsymutil.  The way it works on darwin, is that 
the linker does not copy dwarf debug info.  Instead, the linker leaves 
the debug info in the .o files and then puts "debug notes" into the final 
linked image. If you run the program under gdb, the debugger sees the 
notes and opens the .of files and reads the dwarf. If instead you run 
dysmtuil, it reads the debug notes which tells it where to find the 
.o files from which to read the dwarf and merge all the dwarf into 
the .dSYM.

The dsymtuil warning is that no dwarf was found.  In this case that 
is because there were no debug notes recorded by the linker which 
was because of the lack of AT_comp_dir.   In some of the cases you've 
set up, there was no warning because there was some dwarf found but 
not all dwarf was found, so the .dSYM is less than ideal.

The format of the debug notes requires a pair of dir/file.  Because 
it always just worked before, the linker just copied the dir from 
AT_comp_dir and the file from AT_name. It does not look like the 
dwarf spec requires the AT_comp_dir, but it has always been there 
before and the linker has come to depend on it.
-------------------------------------------------------------------------

This issue can be demonstrated with Xcode 4.2 under 10.7.4 using gcc trunk...


howarth% gcc-fsf-4.8
/sw/src/fink.build/gcc48-4.8.0-1000/gcc-4.8-20120520/gcc/testsuite/gcc.c-torture/execute/builtins/20010124-1.c
/sw/src/fink.build/gcc48-4.8.0-1000/gcc-4.8-20120520/gcc/testsuite/gcc.c-torture/execute/builtins/20010124-1-lib.c
/sw/src/fink.build/gcc48-4.8.0-1000/gcc-4.8-20120520/gcc/testsuite/gcc.c-torture/execute/builtins/lib/main.c
-fno-diagnostics-show-caret --save-temps -w -O3 -g -lm -m64 -o 20010124-1.x4
howarth% dwarfdump --debug-info main.o | grep -A3 AT_language
             AT_language( DW_LANG_C89 )
             AT_name(
"/sw/src/fink.build/gcc48-4.8.0-1000/gcc-4.8-20120520/gcc/testsuite/gcc.c-torture/execute/builtins/lib/main.c"
)
             AT_stmt_list( 0x00000000 )

whereas if you copy or symlink the source files into a local directory and
compile with...

howarth% gcc-fsf-4.8 20010124-1.c 20010124-1-lib.c main.c
-fno-diagnostics-show-caret --save-temps -w -O3 -g -lm -m64 -o 20010124-1.x4

...both the AT_name and AT_comp_dir debug notes are present...

howarth% dwarfdump --debug-info main.o | grep -A3 AT_language                  
                               AT_language( DW_LANG_C89 )
             AT_name( "main.c" )
             AT_comp_dir( "/Users/howarth/xcode44_bugv2/good_binary" )
             AT_stmt_list( 0x00000000 )

and future dsymutil releases won't emit the warning.


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

end of thread, other threads:[~2013-04-17 16:21 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-22 13:27 [Bug debug/53453] New: darwin linker expects both AT_name and AT_comp_dir debug notes howarth at nitro dot med.uc.edu
2012-05-22 14:30 ` [Bug debug/53453] " howarth at nitro dot med.uc.edu
2012-05-22 14:40 ` howarth at nitro dot med.uc.edu
2012-05-22 14:41 ` jakub at gcc dot gnu.org
2012-05-22 23:32 ` howarth at nitro dot med.uc.edu
2012-05-22 23:55 ` jakub at gcc dot gnu.org
2012-05-24 13:54 ` howarth at nitro dot med.uc.edu
2012-05-24 19:41 ` howarth at nitro dot med.uc.edu
2012-05-24 19:55 ` howarth at nitro dot med.uc.edu
2012-05-24 20:20 ` jakub at gcc dot gnu.org
2012-05-24 23:27 ` howarth at nitro dot med.uc.edu
2012-05-25  5:54 ` howarth at nitro dot med.uc.edu
2012-05-25  6:04 ` mrs at gcc dot gnu.org
2012-05-25 13:03 ` howarth at nitro dot med.uc.edu
2012-05-25 13:41 ` howarth at nitro dot med.uc.edu
2012-05-30  0:08 ` mrs at gcc dot gnu.org
2012-05-30  1:37 ` mrs at gcc dot gnu.org
2013-04-17  7:17 ` ebotcazou at gcc dot gnu.org
2013-04-17 15:55 ` mrs at gcc dot gnu.org
2013-04-17 16:21 ` mrs at gcc dot gnu.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).