# to make this (local) .lldbinit work, don't forget to add the following line to global ~/.lldbinit:
# settings set target.load-cwd-lldbinit true

command script import lldb_addons.py

type summary add --python-function "lldb_addons.class_with_debug_string" FunctionData
type summary add --python-function "lldb_addons.class_with_debug_string" ClassData
type summary add --python-function "lldb_addons.class_with_debug_string" VarData
type summary add --python-function "lldb_addons.class_with_debug_string" DefineData
type summary add --python-function "lldb_addons.class_with_debug_string" LibData
type summary add --python-function "lldb_addons.class_with_debug_string" ModuliteData
type summary add --python-function "lldb_addons.class_with_debug_string" ComposerJsonData
type summary add --python-function "lldb_addons.class_with_debug_string" SrcDir
type summary add --python-function "lldb_addons.class_with_debug_string" SrcFile
type summary add --python-function "lldb_addons.class_with_debug_string" Location
type summary add --python-function "lldb_addons.class_with_debug_string" TypeData
type summary add --python-function "lldb_addons.class_with_debug_string" tinf::Node
type summary add --python-function "lldb_addons.class_with_debug_string" Assumption
type summary add --python-function "lldb_addons.class_with_debug_string" Key
type summary add --python-function "lldb_addons.class_with_debug_string" MultiKey
type summary add --python-function "lldb_addons.class_with_debug_string" TypeHint
type summary add --python-function "lldb_addons.class_with_debug_string" cfg::Node
type summary add --python-function "lldb_addons.class_with_debug_string" cfg::UsageData
type summary add --python-function "lldb_addons.class_with_debug_string" GenericsDeclarationMixin
type summary add --python-function "lldb_addons.class_with_debug_string" GenericsInstantiationMixin
type summary add --python-function "lldb_addons.class_with_debug_string" GenericsInstantiationPhpComment

type summary add --python-function "lldb_addons.token_printer" Token
type summary add --python-function "lldb_addons.vk_string_view_printer" vk::string_view

type summary add --python-function "lldb_addons.data_ptr_printer" Id<FunctionData>  # FunctionPtr
type summary add --python-function "lldb_addons.data_ptr_printer" Id<ClassData>     # ClassPtr
type summary add --python-function "lldb_addons.data_ptr_printer" Id<VarData>       # VarPtr
type summary add --python-function "lldb_addons.data_ptr_printer" Id<DefineData>    # DefinePtr
type summary add --python-function "lldb_addons.data_ptr_printer" Id<LibData>       # LibPtr
type summary add --python-function "lldb_addons.data_ptr_printer" Id<ModuliteData>  # ModulitePtr
type summary add --python-function "lldb_addons.data_ptr_printer" Id<ComposerJsonData>  # ComposerJsonPtr
type summary add --python-function "lldb_addons.data_ptr_printer" Id<SrcDir>        # SrcDirPtr
type summary add --python-function "lldb_addons.data_ptr_printer" Id<SrcFile>       # SrcFilePtr
type summary add --python-function "lldb_addons.data_ptr_printer" Id<cfg::UsageData> # UsagePtr

type synth add -l "lldb_addons.data_ptr_children" Id<FunctionData>  # FunctionPtr
type synth add -l "lldb_addons.data_ptr_children" Id<ClassData>     # ClassPtr
type synth add -l "lldb_addons.data_ptr_children" Id<VarData>       # VarPtr
type synth add -l "lldb_addons.data_ptr_children" Id<DefineData>    # DefinePtr
type synth add -l "lldb_addons.data_ptr_children" Id<LibData>       # LibPtr
type synth add -l "lldb_addons.data_ptr_children" Id<ModuliteData>  # ModulitePtr
type synth add -l "lldb_addons.data_ptr_children" Id<ComposerJsonData>  # ComposerJsonPtr
type synth add -l "lldb_addons.data_ptr_children" Id<SrcDir>        # SrcDirPtr
type synth add -l "lldb_addons.data_ptr_children" Id<SrcFile>       # SrcFilePtr
type synth add -l "lldb_addons.data_ptr_children" Id<cfg::UsageData> # UsagePtr

type summary add --python-function "lldb_addons.vertex_printer" -x "^VertexAdaptor<.+>$"
type synth add -l "lldb_addons.vertex_children" -x "^VertexAdaptor<.+>$"

settings set target.process.thread.step-avoid-regexp VertexAdaptor<.+>::as<.+>|VertexAdaptor<.+>::try_as<.+>|VertexAdaptor<.+>::operator->|Id<.+>::operator->
