[codegeneration][debug info] generates marker of inlined function body on call site

- makes debuger breakpoint resolution more accurate
- restore expected behavior stack_trace_inline test
- fixes kt-33055
This commit is contained in:
Vasily Levchenko
2021-03-25 17:39:37 +01:00
committed by Space
parent 585e4254a0
commit a11b07f6c3
5 changed files with 26 additions and 1 deletions
@@ -169,6 +169,15 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
null
}
})
putIfNotNull(GENERATE_INLINED_FUNCTION_BODY_MARKER, when (val it = arguments.generateInlinedFunctionMarkerString) {
"enable" -> true
"disable" -> false
null -> null
else -> {
configuration.report(ERROR, "Unsupported -Xg-generate-inline-function-body-marker= value: $it. Possible values are 'enable'/'disable'")
null
}
})
put(STATIC_FRAMEWORK, selectFrameworkType(configuration, arguments, outputKind))
put(OVERRIDE_CLANG_OPTIONS, arguments.clangOptions.toNonNullList())
put(ALLOCATION_MODE, arguments.allocator)
@@ -165,6 +165,14 @@ class K2NativeCompilerArguments : CommonCompilerArguments() {
@Argument(value = "-Xg0", description = "Add light debug information. Deprecated option. Please use instead -Xadd-light-debug=enable")
var lightDebugDeprecated: Boolean = false
@Argument(
value = "-Xg-generate-inline-function-body-marker",
valueDescription = "{disable|enable}",
description = """generates marker of inlined function body on call site to make debugger breakpoint resolution more accurate"""
)
var generateInlinedFunctionMarkerString: String? = null
@Argument(
value = MAKE_CACHE,
valueDescription = "<path>",