mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Nicer machine output in CLI
This commit is contained in:
parent
ca92bda886
commit
762bec9116
@ -1082,6 +1082,10 @@ bool CommandLineInterface::assemble(
|
|||||||
"eWasm";
|
"eWasm";
|
||||||
cout << endl << "======= " << src.first << " (" << machine << ") =======" << endl;
|
cout << endl << "======= " << src.first << " (" << machine << ") =======" << endl;
|
||||||
AssemblyStack& stack = assemblyStacks[src.first];
|
AssemblyStack& stack = assemblyStacks[src.first];
|
||||||
|
|
||||||
|
cout << endl << "Pretty printed source:" << endl;
|
||||||
|
cout << stack.print() << endl;
|
||||||
|
|
||||||
MachineAssemblyObject object;
|
MachineAssemblyObject object;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -1097,15 +1101,18 @@ bool CommandLineInterface::assemble(
|
|||||||
cerr << "Unknown exception while assembling." << endl;
|
cerr << "Unknown exception while assembling." << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cout << endl << "Binary representation:" << endl;
|
||||||
if (object.bytecode)
|
if (object.bytecode)
|
||||||
cout << object.bytecode->toHex() << endl;
|
cout << object.bytecode->toHex() << endl;
|
||||||
else
|
else
|
||||||
cerr << "No binary representation found." << endl;
|
cerr << "No binary representation found." << endl;
|
||||||
|
|
||||||
|
cout << endl << "Text representation:" << endl;
|
||||||
if (!object.assembly.empty())
|
if (!object.assembly.empty())
|
||||||
cout << object.assembly << endl;
|
cout << object.assembly << endl;
|
||||||
else
|
else
|
||||||
cerr << "No text representation found." << endl;
|
cerr << "No text representation found." << endl;
|
||||||
cout << stack.print() << endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user