From 814fb204c21ebbe96d5f03df849ed9c04d1d0881 Mon Sep 17 00:00:00 2001 From: Vasily Levchenko Date: Wed, 8 Jan 2020 16:09:49 +0100 Subject: [PATCH] [debug][bindings] type name inspection introduces command type_name --- llvmDebugInfoC/src/scripts/konan_lldb.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llvmDebugInfoC/src/scripts/konan_lldb.py b/llvmDebugInfoC/src/scripts/konan_lldb.py index 31d78ef801f..9e0766a34ad 100644 --- a/llvmDebugInfoC/src/scripts/konan_lldb.py +++ b/llvmDebugInfoC/src/scripts/konan_lldb.py @@ -362,6 +362,9 @@ def print_this_command(debugger, command, result, internal_dict): def clear_cache_command(debugger, command, result, internal_dict): SYNTHETIC_OBJECT_LAYOUT_CACHE.clear() +def type_name_command(debugger, command, result, internal_dict): + result.AppendMessage(evaluate('(char *)Konan_DebugGetTypeName({})'.format(command)).summary) + def __lldb_init_module(debugger, _): __FACTORY['object'] = lambda x, y, z: KonanObjectSyntheticProvider(x, y, z) __FACTORY['array'] = lambda x, y, z: KonanArraySyntheticProvider(x, z) @@ -383,3 +386,4 @@ def __lldb_init_module(debugger, _): debugger.HandleCommand('type category enable Kotlin') debugger.HandleCommand('command script add -f {}.print_this_command print_this'.format(__name__)) debugger.HandleCommand('command script add -f {}.clear_cache_command clear_kotlin_cache'.format(__name__)) + debugger.HandleCommand('command script add -f {}.type_name_command type_name'.format(__name__))