]> granicus.if.org Git - icinga2/commitdiff
Make it easier to call AExpression::Dump from GDB.
authorGunnar Beutner <gunnar.beutner@netways.de>
Mon, 24 Mar 2014 08:27:46 +0000 (09:27 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Mon, 24 Mar 2014 08:27:46 +0000 (09:27 +0100)
Refs #5846

lib/config/aexpression.cpp
lib/config/aexpression.h

index 0a1dabb2bd87f32e5cee006d8705dd65d11e5ec5..e09be8de8255843fa18f02d09cc8be1344c1e170 100644 (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);
index 35ff57c49ec2549038e85b45994713eb3e88bf92..181ba57402ca1833e3b6d453ddf3906bfdb28ea7 100644 (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);