Make it easier to call AExpression::Dump from GDB.

Refs #5846
This commit is contained in:
Gunnar Beutner 2014-03-24 09:27:46 +01:00
parent db2f1b3398
commit 3032cf8100
2 changed files with 8 additions and 2 deletions

View File

@ -129,7 +129,7 @@ void AExpression::DumpOperand(std::ostream& stream, const Value& operand, int in
}
}
void AExpression::Dump(std::ostream& stream, int indent)
void AExpression::Dump(std::ostream& stream, int indent) const
{
String sym = Utility::GetSymbolName(reinterpret_cast<const void *>(m_Operator));
stream << String(indent, ' ') << "op: " << Utility::DemangleSymbolName(sym) << "\n";
@ -140,6 +140,11 @@ void AExpression::Dump(std::ostream& stream, int indent)
DumpOperand(stream, m_Operand2, indent + 1);
}
void AExpression::Dump(void) const
{
Dump(std::cerr);
}
Value AExpression::EvaluateOperand1(const Dictionary::Ptr& locals) const
{
return static_cast<AExpression::Ptr>(m_Operand1)->Evaluate(locals);

View File

@ -47,7 +47,8 @@ public:
void MakeInline(void);
void Dump(std::ostream& stream, int indent = 0);
void Dump(std::ostream& stream, int indent = 0) const;
void Dump(void) const;
static Value OpLiteral(const AExpression *expr, const Dictionary::Ptr& locals);
static Value OpVariable(const AExpression *expr, const Dictionary::Ptr& locals);