LINK: return occasionally deleted in 7d111c4d extracting debug info on MacOS.
This code generates .dSYM folder containing debug info in dwarf format, it is place where debuger lookup symbols and type declarations.
This commit is contained in:
committed by
vvlevchenko
parent
29ce88a6f0
commit
ab392bf9ed
+14
@@ -69,6 +69,7 @@ internal open class MacOSBasedPlatform(distribution: Distribution)
|
||||
: PlatformFlags(distribution) {
|
||||
|
||||
override val linker = "${distribution.sysRoot}/usr/bin/ld"
|
||||
private val dsymutil = "${distribution.llvmBin}/llvm-dsymutil"
|
||||
|
||||
open val osVersionMin = listOf(
|
||||
propertyTargetString("osVersionMinFlagLd"),
|
||||
@@ -90,6 +91,14 @@ internal open class MacOSBasedPlatform(distribution: Distribution)
|
||||
linkerKonanFlags +
|
||||
listOf("-lSystem")
|
||||
}
|
||||
|
||||
open fun dsymutilCommand(executable: ExecutableFile): List<String> {
|
||||
return listOf(dsymutil, executable)
|
||||
}
|
||||
|
||||
open fun dsymutilDryRunVerboseCommand(executable: ExecutableFile): List<String> {
|
||||
return listOf(dsymutil, "-dump-debug-map" ,executable)
|
||||
}
|
||||
}
|
||||
|
||||
internal open class LinuxBasedPlatform(distribution: Distribution)
|
||||
@@ -222,6 +231,11 @@ internal class LinkStage(val context: Context) {
|
||||
entryPointSelector
|
||||
|
||||
runTool(*linkCommand.toTypedArray())
|
||||
if (platform is MacOSBasedPlatform && context.shouldContainDebugInfo()) {
|
||||
if (context.phase?.verbose ?: false)
|
||||
runTool(*platform.dsymutilDryRunVerboseCommand(executable).toTypedArray())
|
||||
runTool(*platform.dsymutilCommand(executable).toTypedArray())
|
||||
}
|
||||
|
||||
return executable
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user