diff --git a/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2Native.kt b/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2Native.kt index c0204c3242d..601dfbf6278 100644 --- a/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2Native.kt +++ b/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2Native.kt @@ -121,6 +121,7 @@ class K2Native : CLICompiler() { put(TARGET, arguments.target) put(LIST_TARGETS, arguments.listTargets) put(OPTIMIZATION, arguments.optimization) + put(DEBUG, arguments.debug) put(PRINT_IR, arguments.printIr) put(PRINT_IR_WITH_DESCRIPTORS, arguments.printIrWithDescriptors) diff --git a/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2NativeCompilerArguments.java b/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2NativeCompilerArguments.java index 0ffd80fc1c9..e37f1dcbf05 100644 --- a/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2NativeCompilerArguments.java +++ b/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2NativeCompilerArguments.java @@ -53,6 +53,9 @@ public class K2NativeCompilerArguments extends CommonCompilerArguments { @Argument(value = "-target", valueDescription = "", description = "Set hardware target") public String target; + @Argument(value = "-g", description = "Enable emitting debug information") + public boolean debug; + @Argument(value = "-enable_assertions", shortName = "-ea", description = "Enable runtime assertions in generated code") public boolean enableAssertions; diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanConfigurationKeys.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanConfigurationKeys.kt index 1be35be19f6..24714f33164 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanConfigurationKeys.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanConfigurationKeys.kt @@ -37,6 +37,8 @@ class KonanConfigKeys { = CompilerConfigurationKey.create("current abi version") val OPTIMIZATION: CompilerConfigurationKey = CompilerConfigurationKey.create("optimized compilation") + val DEBUG: CompilerConfigurationKey + = CompilerConfigurationKey.create("compilation with debug information") val NOSTDLIB: CompilerConfigurationKey = CompilerConfigurationKey.create("don't link with stdlib") val NOLINK: CompilerConfigurationKey