summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2019-08-14 20:06:45 +0800
committerJohn Hodge <tpg@ucc.asn.au>2019-08-14 20:06:45 +0800
commit66a176784df8801a9ef6fabd2f489c125554e0f5 (patch)
tree80fa9225677114395501b5fd7f0ddaa150c65f35 /tools
parent386cd7f8102239c8ed6822aa7b1c8225fafcdc88 (diff)
downloadmrust-66a176784df8801a9ef6fabd2f489c125554e0f5.tar.gz
Standalone MIRI - Instruction counting
Diffstat (limited to 'tools')
-rw-r--r--tools/standalone_miri/miri.cpp3
-rw-r--r--tools/standalone_miri/miri.hpp4
2 files changed, 5 insertions, 2 deletions
diff --git a/tools/standalone_miri/miri.cpp b/tools/standalone_miri/miri.cpp
index 7407baf7..97343714 100644
--- a/tools/standalone_miri/miri.cpp
+++ b/tools/standalone_miri/miri.cpp
@@ -636,7 +636,8 @@ bool InterpreterThread::step_one(Value& out_thread_result)
assert( !this->m_stack.empty() );
assert( !this->m_stack.back().cb );
auto& cur_frame = this->m_stack.back();
- TRACE_FUNCTION_R(cur_frame.fcn->my_path << " BB" << cur_frame.bb_idx << "/" << cur_frame.stmt_idx, "");
+ auto instr_idx = this->m_instruction_count++;
+ TRACE_FUNCTION_R("#" << instr_idx << " " << cur_frame.fcn->my_path << " BB" << cur_frame.bb_idx << "/" << cur_frame.stmt_idx, "#" << instr_idx);
const auto& bb = cur_frame.fcn->m_mir.blocks.at( cur_frame.bb_idx );
const size_t MAX_STACK_DEPTH = 60;
diff --git a/tools/standalone_miri/miri.hpp b/tools/standalone_miri/miri.hpp
index 0b0f8f39..0b7fd4d6 100644
--- a/tools/standalone_miri/miri.hpp
+++ b/tools/standalone_miri/miri.hpp
@@ -62,11 +62,13 @@ class InterpreterThread
ModuleTree& m_modtree;
ThreadState m_thread;
+ size_t m_instruction_count;
::std::vector<StackFrame> m_stack;
public:
InterpreterThread(ModuleTree& modtree):
- m_modtree(modtree)
+ m_modtree(modtree),
+ m_instruction_count(0)
{
}
~InterpreterThread();