Internals: Rename gdb dump utilities, add fileline dump
This commit is contained in:
parent
f4ca4edc64
commit
764399256c
2
Changes
2
Changes
|
|
@ -6,6 +6,8 @@ indicates the contributor was also the author of the fix; Thanks!
|
|||
|
||||
* Verilator 3.832 devel
|
||||
|
||||
[run cppcheck]
|
||||
|
||||
*** Fix memory delayed assignments from multiple clock domains. [Andrew Ling]
|
||||
|
||||
*** Report MULTIDRIVEN on memories set in multiple clock domains.
|
||||
|
|
|
|||
|
|
@ -249,9 +249,8 @@ what made a <e####> line in the tree dumps):
|
|||
|
||||
To print a node:
|
||||
|
||||
call nodep->dumpCout() # aliased to "pn" in .gdbinit
|
||||
call nodep->dumpTreeCout() # aliased to "pnt" in .gdbinit
|
||||
call nodep->dumpPtrsCout() # aliased to "pnp" in .gdbinit
|
||||
call nodep->dumpGdb() # aliased to "pn" in .gdbinit
|
||||
call nodep->dumpTreeGdb() # aliased to "pnt" in .gdbinit
|
||||
|
||||
=head1 DISTRIBUTION
|
||||
|
||||
|
|
|
|||
11
src/.gdbinit
11
src/.gdbinit
|
|
@ -6,22 +6,15 @@
|
|||
# Version 2.0.
|
||||
|
||||
define pn
|
||||
call $arg0->dumpCout()
|
||||
call $arg0->dumpGdb()
|
||||
end
|
||||
document pn
|
||||
Verilator: Print single AstNode NODEP
|
||||
end
|
||||
|
||||
define pnt
|
||||
call $arg0->dumpTreeCout()
|
||||
call $arg0->dumpTreeGdb()
|
||||
end
|
||||
document pnt
|
||||
Verilator: Print AstNode NODEP's tree
|
||||
end
|
||||
|
||||
define pnp
|
||||
call $arg0->dumpPtrsCout()
|
||||
end
|
||||
document pnp
|
||||
Verilator: Print AstNode NODEP internal pointers
|
||||
end
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ inline void AstNode::debugTreeChange(const char* prefix, int lineno, bool next)
|
|||
// Called on all major tree changers.
|
||||
// Only for use for those really nasty bugs relating to internals
|
||||
// Note this may be null.
|
||||
//if (debug()) cout<<"-treeChange: V3Ast.cpp:"<<lineno<<" Tree Change for "<<prefix<<": "<<(void*)this<<endl;
|
||||
//if (debug()) cout<<"-treeChange: V3Ast.cpp:"<<lineno<<" Tree Change for "<<prefix<<": "<<(void*)this<<" <e"<<AstNode::s_editCntGbl<<">"<<endl;
|
||||
//if (debug()) {
|
||||
// cout<<"-treeChange: V3Ast.cpp:"<<lineno<<" Tree Change for "<<prefix<<endl;
|
||||
// v3Global.rootp()->dumpTree(cout,"-treeChange: ");
|
||||
|
|
@ -719,6 +719,7 @@ void AstNode::deleteTree() {
|
|||
if (!this) return;
|
||||
UASSERT(m_backp==NULL,"Delete called on node with backlink still set\n");
|
||||
this->debugTreeChange("-delTree: ", __LINE__, true);
|
||||
this->editCountInc();
|
||||
// MUST be depth first!
|
||||
deleteTreeIter();
|
||||
}
|
||||
|
|
@ -947,9 +948,21 @@ void AstNode::checkTree() {
|
|||
}
|
||||
}
|
||||
|
||||
void AstNode::dumpCout() { dump(cout); } // For GDB only
|
||||
void AstNode::dumpPtrsCout() const { dumpPtrs(cout); } // For GDB only
|
||||
void AstNode::dumpTreeCout() { dumpTree(cout); } // For GDB only
|
||||
void AstNode::dumpGdb() { // For GDB only
|
||||
if (!this) { cout<<"This=NULL"<<endl; return; }
|
||||
dumpGdbHeader();
|
||||
dump(cout);
|
||||
}
|
||||
void AstNode::dumpTreeGdb() { // For GDB only
|
||||
if (!this) { cout<<"This=NULL"<<endl; return; }
|
||||
dumpGdbHeader();
|
||||
dumpTree(cout);
|
||||
}
|
||||
void AstNode::dumpGdbHeader() const { // For GDB only
|
||||
if (!this) { cout<<"This=NULL"<<endl; return; }
|
||||
dumpPtrs(cout);
|
||||
cout<<" Fileline = "<<fileline()<<endl;
|
||||
}
|
||||
|
||||
void AstNode::dumpPtrs(ostream& os) const {
|
||||
os<<"This="<<typeName()<<" "<<(void*)this;
|
||||
|
|
|
|||
|
|
@ -944,7 +944,8 @@ public:
|
|||
// METHODS - dump and error
|
||||
void v3errorEnd(ostringstream& str) const;
|
||||
virtual void dump(ostream& str=cout);
|
||||
void dumpCout(); // For GDB only
|
||||
void dumpGdb(); // For GDB only
|
||||
void dumpGdbHeader() const;
|
||||
|
||||
// METHODS - Tree modifications
|
||||
AstNode* addNext(AstNode* newp); // Returns this, adds to end of list
|
||||
|
|
@ -968,9 +969,8 @@ public:
|
|||
void deleteTree(); // Always deletes the next link
|
||||
void checkTree(); // User Interface version
|
||||
void dumpPtrs(ostream& str=cout) const;
|
||||
void dumpPtrsCout() const;
|
||||
void dumpTree(ostream& str=cout, const string& indent=" ", int maxDepth=0);
|
||||
void dumpTreeCout(); // For GDB only
|
||||
void dumpTreeGdb(); // For GDB only
|
||||
void dumpTreeAndNext(ostream& str=cout, const string& indent=" ", int maxDepth=0);
|
||||
void dumpTreeFile(const string& filename, bool append=false);
|
||||
|
||||
|
|
|
|||
|
|
@ -523,8 +523,8 @@ void AstAttrOf::dump(ostream& str) {
|
|||
}
|
||||
void AstBasicDType::dump(ostream& str) {
|
||||
this->AstNodeDType::dump(str);
|
||||
str<<" ["<<keyword().ascii()<<"]";
|
||||
if (!rangep() && msb()) str<<" range["<<msb()<<":"<<lsb()<<"]";
|
||||
str<<" kwd="<<keyword().ascii();
|
||||
if (!rangep() && msb()) str<<" range=["<<msb()<<":"<<lsb()<<"]";
|
||||
if (implicit()) str<<" [IMPLICIT]";
|
||||
}
|
||||
void AstCCast::dump(ostream& str) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue