From 669985f85337073c12bfdee1e08986cad697d5d8 Mon Sep 17 00:00:00 2001 From: Vasily Levchenko Date: Mon, 17 May 2021 15:52:45 +0200 Subject: [PATCH] [debug][stacktrace][mac] more tracing for stacktrace debugging --- kotlin-native/runtime/src/debug/cpp/SourceInfo.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kotlin-native/runtime/src/debug/cpp/SourceInfo.cpp b/kotlin-native/runtime/src/debug/cpp/SourceInfo.cpp index e036ef8ec66..511b2445afd 100644 --- a/kotlin-native/runtime/src/debug/cpp/SourceInfo.cpp +++ b/kotlin-native/runtime/src/debug/cpp/SourceInfo.cpp @@ -143,7 +143,7 @@ extern "C" struct SourceInfo Kotlin_getSourceInfo(void* addr) { CSSymbolRef symbol = CSSymbolOwnerGetSymbolWithAddress(symbolOwner, address); if (CSIsNull(symbol)) return result; - SYM_LOG("Kotlin_getSourceInfo: address: %p\n", addr); + SYM_LOG("Kotlin_getSourceInfo: address: (%p) {\n", addr); SYM_DUMP(symbol); @@ -175,8 +175,10 @@ extern "C" struct SourceInfo Kotlin_getSourceInfo(void* addr) { int32_t lineNumber = CSSourceInfoGetLineNumber(ref); if (lineNumber == 0) return 0; - SYM_DUMP(ref); CSRange range = CSSourceInfoGetRange(ref); + SYM_LOG("ref(%p .. %p) [{\n", (void *)rangeRef.location, (void *)(range.location + range.length)); + SYM_DUMP(ref); + SYM_DUMP(CSSourceInfoGetSymbol(ref)); const char* fileName = CSSourceInfoGetPath(ref); /** * We need to change API fo Kotlin_getSourceInfo to return information about inlines, @@ -197,10 +199,11 @@ extern "C" struct SourceInfo Kotlin_getSourceInfo(void* addr) { if (continueUpdateResult && (address >= range.location && address < range.location + range.length)) continueUpdateResult = false; - + SYM_LOG("}]\n"); return 0; }); } + SYM_LOG("}\n"); return result; }