X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=common%2Ftrace_dump.cpp;h=2b8c27a3780b28f57bb4ddad5ba14aebac9cdc97;hb=b70a86af10057c5b7fcf79b674cfe5abbeaadebb;hp=0f7ee3656e76288ccd12caca37ec5e62394ce76b;hpb=97ac28e65ca20b5649552597afaeee1d67766f6a;p=apitrace diff --git a/common/trace_dump.cpp b/common/trace_dump.cpp index 0f7ee36..2b8c27a 100644 --- a/common/trace_dump.cpp +++ b/common/trace_dump.cpp @@ -24,6 +24,8 @@ **************************************************************************/ +#include + #include "formatter.hpp" #include "trace_dump.hpp" @@ -73,7 +75,7 @@ public: } void visit(Null *) { - os << "NULL"; + os << literal << "NULL" << normal; } void visit(Bool *node) { @@ -89,11 +91,15 @@ public: } void visit(Float *node) { + std::streamsize oldPrecision = os.precision(std::numeric_limits::digits10 + 1); os << literal << node->value << normal; + os.precision(oldPrecision); } void visit(Double *node) { + std::streamsize oldPrecision = os.precision(std::numeric_limits::digits10 + 1); os << literal << node->value << normal; + os.precision(oldPrecision); } void visit(String *node) { @@ -142,6 +148,7 @@ public: const BitmaskSig *sig = bitmask->sig; bool first = true; for (const BitmaskFlag *it = sig->flags; it != sig->flags + sig->num_flags; ++it) { + assert(it->value || first); if ((it->value && (value & it->value) == it->value) || (!it->value && value == 0)) { if (!first) { @@ -199,6 +206,10 @@ public: os << pointer << "0x" << std::hex << p->value << std::dec << normal; } + void visit(Repr *r) { + _visit(r->humanValue); + } + void visit(Call *call) { CallFlags callFlags = call->flags;