summaryrefslogtreecommitdiff
path: root/tools/standalone_miri/value.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2019-07-20 16:46:38 +0800
committerJohn Hodge <tpg@ucc.asn.au>2019-07-20 16:46:38 +0800
commitb105e1ef0310454a96899d5fb815257a7fda88f0 (patch)
tree3907f89ad928d4edcd6ca876ee0313378b00fe5b /tools/standalone_miri/value.cpp
parent49a3ab205b9fc5b6ae64c928071cb40ca1b0ce50 (diff)
downloadmrust-b105e1ef0310454a96899d5fb815257a7fda88f0.tar.gz
standalone_miri - Improved logging for allocation tags
Diffstat (limited to 'tools/standalone_miri/value.cpp')
-rw-r--r--tools/standalone_miri/value.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/tools/standalone_miri/value.cpp b/tools/standalone_miri/value.cpp
index 3a479bce..4318d289 100644
--- a/tools/standalone_miri/value.cpp
+++ b/tools/standalone_miri/value.cpp
@@ -13,6 +13,12 @@
#include <algorithm>
#include "debug.hpp"
+::std::ostream& operator<<(::std::ostream& os, const Allocation* x)
+{
+ os << "A(" << static_cast<const void*>(x) << " " << x->tag() << ")";
+ return os;
+}
+
FfiLayout FfiLayout::new_const_bytes(size_t s)
{
return FfiLayout {
@@ -53,6 +59,7 @@ AllocationHandle Allocation::new_alloc(size_t size, ::std::string tag)
rv->data.resize( (size + 8-1) / 8 ); // QWORDS
rv->mask.resize( (size + 8-1) / 8 ); // bitmap bytes
//LOG_DEBUG(rv << " ALLOC");
+ LOG_DEBUG(rv);
return AllocationHandle(rv);
}
AllocationHandle::AllocationHandle(const AllocationHandle& x):
@@ -319,11 +326,6 @@ void Allocation::check_bytes_valid(size_t ofs, size_t size) const
}
}
}
-::std::ostream& operator<<(::std::ostream& os, const Allocation* x)
-{
- os << static_cast<const void*>(x) << " A(" << x->tag() << ")";
- return os;
-}
void Allocation::mark_bytes_valid(size_t ofs, size_t size)
{
assert( ofs+size <= this->mask.size() * 8 );
@@ -868,7 +870,7 @@ extern ::std::ostream& operator<<(::std::ostream& os, const ValueRef& v)
case RelocationPtr::Ty::Allocation: {
const auto& alloc = alloc_ptr.alloc();
- os << "A(" << alloc.tag() << ")@" << v.m_offset << "+" << v.m_size << " ";
+ os << &alloc << "@" << v.m_offset << "+" << v.m_size << " ";
auto flags = os.flags();
os << ::std::hex;
@@ -923,7 +925,7 @@ extern ::std::ostream& operator<<(::std::ostream& os, const ValueRef& v)
{
const auto& alloc = *v.m_value->allocation;
- os << "A(" << alloc.tag() << ")@" << v.m_offset << "+" << v.m_size << " ";
+ os << &alloc << "@" << v.m_offset << "+" << v.m_size << " ";
auto flags = os.flags();
os << ::std::hex;