Debugging: Show tree file writes, commentary

This commit is contained in:
Wilson Snyder 2012-04-28 12:22:38 -04:00
parent 641024c235
commit 3ba36dc30c
3 changed files with 12 additions and 2 deletions

View File

@ -527,8 +527,10 @@ what made a <e####> line in the tree dumps):
To print a node: To print a node:
call nodep->dumpGdb() # aliased to "pn" in src/.gdbinit pn nodep
call nodep->dumpTreeGdb() # aliased to "pnt" in src/.gdbinit # 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 When GDB halts, it is useful to understand that the backtrace will commonly
show the iterator functions between each invocation of C<visit> in the show the iterator functions between each invocation of C<visit> in the

View File

@ -18,3 +18,10 @@ end
document pnt document pnt
Verilator: Print AstNode NODEP's tree Verilator: Print AstNode NODEP's tree
end end
define watchedit
watch AstNode::s_editCntGbl==$arg0
end
document watchedit
Verilator: Create watch on where a edit number is made
end

View File

@ -1011,6 +1011,7 @@ void AstNode::dumpTreeAndNext(ostream& os, const string& indent, int maxDepth) {
void AstNode::dumpTreeFile(const string& filename, bool append) { void AstNode::dumpTreeFile(const string& filename, bool append) {
if (v3Global.opt.dumpTree()) { if (v3Global.opt.dumpTree()) {
{ // Write log & close { // Write log & close
UINFO(2,"Dumping "<<filename<<endl);
const auto_ptr<ofstream> logsp (V3File::new_ofstream(filename, append)); const auto_ptr<ofstream> logsp (V3File::new_ofstream(filename, append));
if (logsp->fail()) v3fatalSrc("Can't write "<<filename); if (logsp->fail()) v3fatalSrc("Can't write "<<filename);
*logsp<<"Tree Dump from <e"<<dec<<editCountLast()<<">"; *logsp<<"Tree Dump from <e"<<dec<<editCountLast()<<">";