From 3ba36dc30cbf96d9d7e46859924a971bec2210da Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 28 Apr 2012 12:22:38 -0400 Subject: [PATCH] Debugging: Show tree file writes, commentary --- internals.pod | 6 ++++-- src/.gdbinit | 7 +++++++ src/V3Ast.cpp | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/internals.pod b/internals.pod index b555a3465..0a51b5aa8 100644 --- a/internals.pod +++ b/internals.pod @@ -527,8 +527,10 @@ what made a line in the tree dumps): To print a node: - call nodep->dumpGdb() # aliased to "pn" in src/.gdbinit - call nodep->dumpTreeGdb() # aliased to "pnt" in src/.gdbinit + pn nodep + # or: call nodep->dumpGdb() # aliased to "pn" in src/.gdbinit + pnt nodep + # or: call nodep->dumpTreeGdb() # aliased to "pnt" in src/.gdbinit When GDB halts, it is useful to understand that the backtrace will commonly show the iterator functions between each invocation of C in the diff --git a/src/.gdbinit b/src/.gdbinit index 47b6a8929..9cfe8c654 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -18,3 +18,10 @@ end document pnt Verilator: Print AstNode NODEP's tree end + +define watchedit + watch AstNode::s_editCntGbl==$arg0 +end +document watchedit + Verilator: Create watch on where a edit number is made +end diff --git a/src/V3Ast.cpp b/src/V3Ast.cpp index 8d76b763e..456c1bef4 100644 --- a/src/V3Ast.cpp +++ b/src/V3Ast.cpp @@ -1011,6 +1011,7 @@ void AstNode::dumpTreeAndNext(ostream& os, const string& indent, int maxDepth) { void AstNode::dumpTreeFile(const string& filename, bool append) { if (v3Global.opt.dumpTree()) { { // Write log & close + UINFO(2,"Dumping "< logsp (V3File::new_ofstream(filename, append)); if (logsp->fail()) v3fatalSrc("Can't write "<";