dwarfdump - Debug Build Has No Symbols?

2

I have built my project for iphoneos and iphonesimulator, both debug and release. When I run dwarfdump on the debug builds is reports empty. When I run it on the release build DSYMs it report all of the symbols.

See the output below (I only grabbed the first part of the DSYM output).

Why are the debug build empty?


File: Debug-iphoneos/VerticonsToolbox.framework/VerticonsToolbox (arm64)

.debug_info contents: < EMPTY >


File: Debug-iphonesimulator/VerticonsToolbox.framework/VerticonsToolbox (x86_64)

.debug_info contents: < EMPTY >


File: Release-iphoneos/VerticonsToolbox.framework.dSYM/Contents/Resources/DWARF/VerticonsToolbox (armv7)

.debug_info contents:

0x00000000: Compile Unit: length = 0x000013ad version = 0x0003 abbr_offset = 0x00000000 addr_size = 0x04 (next CU at 0x000013b1)

0x0000000b: TAG_compile_unit [1] * AT_producer( "Apple Swift version 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1)" ) AT_language( DW_LANG_Swift ) AT_name( "/Users/Robert/Development/iOS/VerticonsToolbox/VerticonsToolbox/UI/Application.swift" ) AT_stmt_list( 0x00000000 ) AT_comp_dir( "/Users/Robert/Development/iOS/VerticonsToolbox" )


File: Release-iphonesimulator/VerticonsToolbox.framework.dSYM/Contents/Resources/DWARF/VerticonsToolbox (i386)

.debug_info contents:

0x00000000: Compile Unit: length = 0x00001370 version = 0x0003 abbr_offset = 0x00000000 addr_size = 0x04 (next CU at 0x00001374)

0x0000000b: TAG_compile_unit [1] * AT_producer( "Apple Swift version 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1)" ) AT_language( DW_LANG_Swift ) AT_name( "/Users/Robert/Development/iOS/VerticonsToolbox/VerticonsToolbox/UI/Application.swift" ) AT_stmt_list( 0x00000000 ) AT_comp_dir( "/Users/Robert/Development/iOS/VerticonsToolbox" ) AT_APPLE_optimized( 0x01 )

xcode
dwarf
asked on Stack Overflow Feb 23, 2017 by Verticon

1 Answer

6

On macOS, iOS, tvOS, watchOS, when you do a "dwarf" style build (see your Xcode project's build settings), the debug information is in the .o files, not the linked executable. When you run dsymutil or you select a "dwarf + dSYM" style build setting, a .dSYM bundle is created with all of the debug information in the .o files collected into a single bundle / binary.

answered on Stack Overflow Feb 23, 2017 by Jason Molenda

User contributions licensed under CC BY-SA 3.0