Browse Source

Other dumps.

cl-refactor
Gav Wood 11 years ago
parent
commit
0b893fd309
  1. 21
      eth/main.cpp

21
eth/main.cpp

@ -47,6 +47,8 @@ using namespace boost::algorithm;
using eth::Instruction;
using eth::c_instructionInfo;
#undef RETURN
bool isTrue(std::string const& _m)
{
return _m == "on" || _m == "yes" || _m == "true" || _m == "1";
@ -582,6 +584,8 @@ int main(int argc, char** argv)
state = state.fromPending(index);
bytes r = t.rlp();
e.setup(&r);
if (format == "pretty")
e.go([&](uint64_t steps, Instruction instr, unsigned newMemSize, bigint gasCost, void* vvm, void const* vextVM)
{
eth::VM* vm = (VM*)vvm;
@ -595,6 +599,23 @@ int main(int argc, char** argv)
f << showbase << hex << i.first << ": " << i.second << endl;
f << dec << ext->level << " | " << ext->myAddress << " | #" << steps << " | " << hex << setw(4) << setfill('0') << vm->curPC() << " : " << c_instructionInfo.at(instr).name << " | " << dec << vm->gas() << " | -" << dec << gasCost << " | " << newMemSize << "x32";
});
else if (format == "standard")
e.go([&](uint64_t, Instruction instr, unsigned, bigint, void* vvm, void const* vextVM)
{
eth::VM* vm = (VM*)vvm;
eth::ExtVM const* ext = (ExtVM const*)vextVM;
f << ext->myAddress << " " << hex << toHex(eth::toCompactBigEndian(vm->curPC(), 1)) << " " << hex << toHex(eth::toCompactBigEndian((int)(byte)instr, 1)) << " " << hex << toHex(eth::toCompactBigEndian((uint64_t)vm->gas(), 1)) << endl;
});
else if (format == "standard+")
e.go([&](uint64_t, Instruction instr, unsigned, bigint, void* vvm, void const* vextVM)
{
eth::VM* vm = (VM*)vvm;
eth::ExtVM const* ext = (ExtVM const*)vextVM;
if (instr == Instruction::STOP || instr == Instruction::RETURN || instr == Instruction::SUICIDE)
for (auto const& i: ext->state().storage(ext->myAddress))
f << toHex(eth::toCompactBigEndian(i.first, 1)) << " " << toHex(eth::toCompactBigEndian(i.second, 1)) << endl;
f << ext->myAddress << " " << hex << toHex(eth::toCompactBigEndian(vm->curPC(), 1)) << " " << hex << toHex(eth::toCompactBigEndian((int)(byte)instr, 1)) << " " << hex << toHex(eth::toCompactBigEndian((uint64_t)vm->gas(), 1)) << endl;
});
}
else if (cmd == "inspect")
{

Loading…
Cancel
Save