Debug: add GDB dtf function to dump tree to file
This commit is contained in:
parent
cbd073ed08
commit
dee7210231
|
|
@ -19,6 +19,13 @@ document pnt
|
||||||
Verilator: Print AstNode NODEP's tree
|
Verilator: Print AstNode NODEP's tree
|
||||||
end
|
end
|
||||||
|
|
||||||
|
define dtf
|
||||||
|
call AstNode::dumpTreeFileGdb(0)
|
||||||
|
end
|
||||||
|
document dtf
|
||||||
|
Verilator: Dump AstNode tree to file
|
||||||
|
end
|
||||||
|
|
||||||
define watchedit
|
define watchedit
|
||||||
watch AstNode::s_editCntGbl==$arg0
|
watch AstNode::s_editCntGbl==$arg0
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -946,15 +946,19 @@ void AstNode::dumpGdb() { // For GDB only
|
||||||
dumpGdbHeader();
|
dumpGdbHeader();
|
||||||
cout<<" "; dump(cout); cout<<endl;
|
cout<<" "; dump(cout); cout<<endl;
|
||||||
}
|
}
|
||||||
|
void AstNode::dumpGdbHeader() const { // For GDB only
|
||||||
|
if (!this) { cout<<"This=NULL"<<endl; return; }
|
||||||
|
dumpPtrs(cout);
|
||||||
|
cout<<" Fileline = "<<fileline()<<endl;
|
||||||
|
}
|
||||||
void AstNode::dumpTreeGdb() { // For GDB only
|
void AstNode::dumpTreeGdb() { // For GDB only
|
||||||
if (!this) { cout<<"This=NULL"<<endl; return; }
|
if (!this) { cout<<"This=NULL"<<endl; return; }
|
||||||
dumpGdbHeader();
|
dumpGdbHeader();
|
||||||
dumpTree(cout);
|
dumpTree(cout);
|
||||||
}
|
}
|
||||||
void AstNode::dumpGdbHeader() const { // For GDB only
|
void AstNode::dumpTreeFileGdb(const char* filenamep) { // For GDB only
|
||||||
if (!this) { cout<<"This=NULL"<<endl; return; }
|
string filename = filenamep ? filenamep : v3Global.debugFilename("debug.tree",98);
|
||||||
dumpPtrs(cout);
|
v3Global.rootp()->dumpTreeFile(filename);
|
||||||
cout<<" Fileline = "<<fileline()<<endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AstNode::dumpPtrs(ostream& os) const {
|
void AstNode::dumpPtrs(ostream& os) const {
|
||||||
|
|
|
||||||
|
|
@ -1109,6 +1109,7 @@ public:
|
||||||
void dumpTreeGdb(); // For GDB only
|
void dumpTreeGdb(); // For GDB only
|
||||||
void dumpTreeAndNext(ostream& str=cout, const string& indent=" ", int maxDepth=0);
|
void dumpTreeAndNext(ostream& str=cout, const string& indent=" ", int maxDepth=0);
|
||||||
void dumpTreeFile(const string& filename, bool append=false);
|
void dumpTreeFile(const string& filename, bool append=false);
|
||||||
|
static void dumpTreeFileGdb(const char* filenamep=NULL);
|
||||||
|
|
||||||
// METHODS - queries
|
// METHODS - queries
|
||||||
virtual bool isPure() const { return true; } // Else a $display, etc, that must be ordered with other displays
|
virtual bool isPure() const { return true; } // Else a $display, etc, that must be ordered with other displays
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue