feat(debug): enhance linked list demo with item count and message output
feat(debug): improve GDB pretty-printer support for structured types fix(debug): update dump_debug_graph script to reflect changes in main.cpp feat(visualization): add type hint display to node table visualizer
This commit is contained in:
@@ -103,14 +103,18 @@ def verify_top_delves_into_list(data):
|
||||
edges = data.get("edges", [])
|
||||
roots_by_name = {r.get("name"): r for r in data.get("roots", [])}
|
||||
|
||||
bare_leaves = [
|
||||
# Other auto-discovered locals (e.g. a `char*` local) can legitimately
|
||||
# produce their own bare scalar-leaf nodes -- only care whether *some*
|
||||
# node looks like a real Node<int> (data+next), i.e. top's address got
|
||||
# upgraded into the full struct rather than stopping at a lone int.
|
||||
node_shaped = [
|
||||
n for n in nodes
|
||||
if [f.get("name") for f in n.get("fields", [])] == ["value"]
|
||||
if [f.get("name") for f in n.get("fields", [])] == ["data", "next"]
|
||||
]
|
||||
if bare_leaves:
|
||||
print(" VERIFY FAIL: $debug_graph(top) produced bare scalar leaf node(s) %s -- "
|
||||
"top's address was never upgraded to the full Node it coincides with"
|
||||
% [n.get("id") for n in bare_leaves])
|
||||
if not node_shaped:
|
||||
print(" VERIFY FAIL: $debug_graph(top) produced no data+next Node-shaped node -- "
|
||||
"top's address was never upgraded to the full Node it coincides with "
|
||||
"(nodes=%r)" % [n.get("id") for n in nodes])
|
||||
return False
|
||||
|
||||
next_edges = [e for e in edges if e.get("label") == "next"]
|
||||
@@ -162,9 +166,9 @@ def main():
|
||||
out_dir = Path(sys.argv[1]) if len(sys.argv) > 1 else Path.home() / "lg"
|
||||
out_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
ok_cpp = dump("cpp", "gdb", str(REPO / "cpp" / "list_example_cpp"), "cpp/main.cpp", 66, out_dir)
|
||||
ok_cpp = dump("cpp", "gdb", str(REPO / "cpp" / "list_example_cpp"), "cpp/main.cpp", 70, out_dir)
|
||||
ok_cpp_top = dump(
|
||||
"cpp_top", "gdb", str(REPO / "cpp" / "list_example_cpp"), "cpp/main.cpp", 66, out_dir,
|
||||
"cpp_top", "gdb", str(REPO / "cpp" / "list_example_cpp"), "cpp/main.cpp", 70, out_dir,
|
||||
expr="$debug_graph(top)",
|
||||
verify=verify_top_delves_into_list,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user