mirror of
https://github.com/wolfpld/tracy.git
synced 2026-01-18 17:11:26 +01:00
Add LLDB summary for Vector.
This commit is contained in:
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@@ -16,4 +16,5 @@
|
||||
"variant": { "statusBarVisibility": "compact" }
|
||||
},
|
||||
"cmake.copyCompileCommands": "${workspaceFolder}/compile_commands.json",
|
||||
"lldb.launch.initCommands": ["command script import ${workspaceRoot}/extra/natvis.py"],
|
||||
}
|
||||
|
||||
11
extra/natvis.py
Normal file
11
extra/natvis.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import lldb
|
||||
|
||||
def VectorSummary(value, dict):
|
||||
size = value.GetChildMemberWithName('m_size').GetValueAsUnsigned()
|
||||
capacity = 1 << value.GetChildMemberWithName('m_capacity').GetValueAsUnsigned()
|
||||
magic = bool(value.GetChildMemberWithName('m_magic').GetValueAsUnsigned())
|
||||
return 'size={0}, capacity={1}, magic={2}'.format(size, capacity, magic)
|
||||
|
||||
def __lldb_init_module(debugger, dict):
|
||||
debugger.HandleCommand('type summary add -w tracy -F natvis.VectorSummary -x ^tracy::Vector<.+>')
|
||||
debugger.HandleCommand('type category enable tracy')
|
||||
Reference in New Issue
Block a user