feat(debug): add GDB-based debug visualizer for linked lists
Replace the custom toDebugGraph() method that generated JSON directly in C++ with a generic GDB Python script (debug_graph.py). The script traverses pointers and structures to build a graph representation for the VS Code Debug Visualizer, enabling external pointer display and more extensible visualization.
Update launch configurations to load the script and to disable array/string truncation (needed for the visualizer JSON). Add a debugAdapterConfigurations entry in settings.json to use the expression template $debug_graph(${expr}) for the cppdbg adapter.
This commit is contained in:
20
.vscode/launch.json
vendored
20
.vscode/launch.json
vendored
@@ -19,6 +19,21 @@
|
||||
"description": "Enable pretty-printing for gdb",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
},
|
||||
{
|
||||
"description": "Don't truncate long arrays (needed for Debug Visualizer JSON)",
|
||||
"text": "-gdb-set print elements 0",
|
||||
"ignoreFailures": true
|
||||
},
|
||||
{
|
||||
"description": "Don't truncate long strings (needed for Debug Visualizer JSON)",
|
||||
"text": "-gdb-set print characters 0",
|
||||
"ignoreFailures": true
|
||||
},
|
||||
{
|
||||
"description": "Load the generic $debug_graph(...) Debug Visualizer helper",
|
||||
"text": "source ${workspaceFolder}/gdb/debug_graph.py",
|
||||
"ignoreFailures": false
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -50,6 +65,11 @@
|
||||
"description": "Don't truncate long strings (needed for Debug Visualizer JSON)",
|
||||
"text": "-gdb-set print characters 0",
|
||||
"ignoreFailures": true
|
||||
},
|
||||
{
|
||||
"description": "Load the generic $debug_graph(...) Debug Visualizer helper",
|
||||
"text": "source ${workspaceFolder}/gdb/debug_graph.py",
|
||||
"ignoreFailures": false
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
7
.vscode/settings.json
vendored
7
.vscode/settings.json
vendored
@@ -1,5 +1,10 @@
|
||||
{
|
||||
"debugVisualizer.customVisualizerScriptPaths": [
|
||||
"${workspaceFolder}/vis-plugins/node-table-visualizer.js"
|
||||
]
|
||||
],
|
||||
"debugVisualizer.debugAdapterConfigurations": {
|
||||
"cppdbg": {
|
||||
"expressionTemplate": "$debug_graph(${expr})"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user