mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-21 22:24:35 +00:00
Add LLDB summary for Vector.
This commit is contained in:
parent
11eee619fb
commit
4b14d961f0
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')
|
Loading…
Reference in New Issue
Block a user