📝 change output info width from 6 -> 8
This commit is contained in:
parent
b02168fc55
commit
3b71c5fee4
|
@ -48,7 +48,7 @@ void codestream::dump(std::ostream& out) const {
|
||||||
|
|
||||||
// dump operand index and bytecode(hex format)
|
// dump operand index and bytecode(hex format)
|
||||||
out << hex << "0x"
|
out << hex << "0x"
|
||||||
<< setw(6) << setfill('0') << index << " "
|
<< setw(8) << setfill('0') << index << " "
|
||||||
<< setw(2) << setfill('0') << static_cast<u32>(op) << ":" << dec;
|
<< setw(2) << setfill('0') << static_cast<u32>(op) << ":" << dec;
|
||||||
|
|
||||||
// dump immediate number(hex format)
|
// dump immediate number(hex format)
|
||||||
|
|
|
@ -191,7 +191,7 @@ void vm::trace_back() {
|
||||||
}
|
}
|
||||||
if (same) {
|
if (same) {
|
||||||
std::clog << " 0x" << std::hex
|
std::clog << " 0x" << std::hex
|
||||||
<< std::setw(6) << std::setfill('0')
|
<< std::setw(8) << std::setfill('0')
|
||||||
<< prev << std::dec << " "
|
<< prev << std::dec << " "
|
||||||
<< same << " same call(s)\n";
|
<< same << " same call(s)\n";
|
||||||
same = 0;
|
same = 0;
|
||||||
|
@ -212,7 +212,7 @@ void vm::stack_info(const u64 limit = 16) {
|
||||||
|
|
||||||
for(u32 i = 0; i<limit && top>=bottom; ++i, --top) {
|
for(u32 i = 0; i<limit && top>=bottom; ++i, --top) {
|
||||||
std::clog << " 0x" << std::hex
|
std::clog << " 0x" << std::hex
|
||||||
<< std::setw(6) << std::setfill('0')
|
<< std::setw(8) << std::setfill('0')
|
||||||
<< static_cast<u64>(top-bottom) << std::dec
|
<< static_cast<u64>(top-bottom) << std::dec
|
||||||
<< " ";
|
<< " ";
|
||||||
value_info(top[0]);
|
value_info(top[0]);
|
||||||
|
@ -220,22 +220,22 @@ void vm::stack_info(const u64 limit = 16) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void vm::register_info() {
|
void vm::register_info() {
|
||||||
std::clog << "\nregisters (" << (ngc.cort? "coroutine":"main")
|
std::clog << "\nregisters (" << (ngc.cort? "coroutine":"main") << ")\n";
|
||||||
<< ")\n" << std::hex
|
std::clog << std::hex
|
||||||
<< " [pc ] | pc | 0x" << ctx.pc << "\n"
|
<< " [ pc ] | pc | 0x" << ctx.pc << "\n"
|
||||||
<< " [global] | addr | 0x"
|
<< " [ global ] | addr | 0x"
|
||||||
<< reinterpret_cast<u64>(global) << "\n"
|
<< reinterpret_cast<u64>(global) << "\n"
|
||||||
<< " [local ] | addr | 0x"
|
<< " [ local ] | addr | 0x"
|
||||||
<< reinterpret_cast<u64>(ctx.localr) << "\n"
|
<< reinterpret_cast<u64>(ctx.localr) << "\n"
|
||||||
<< " [memr ] | addr | 0x"
|
<< " [ memr ] | addr | 0x"
|
||||||
<< reinterpret_cast<u64>(ctx.memr) << "\n"
|
<< reinterpret_cast<u64>(ctx.memr) << "\n"
|
||||||
<< " [canary] | addr | 0x"
|
<< " [ canary ] | addr | 0x"
|
||||||
<< reinterpret_cast<u64>(ctx.canary) << "\n"
|
<< reinterpret_cast<u64>(ctx.canary) << "\n"
|
||||||
<< " [top ] | addr | 0x"
|
<< " [ top ] | addr | 0x"
|
||||||
<< reinterpret_cast<u64>(ctx.top) << "\n"
|
<< reinterpret_cast<u64>(ctx.top) << "\n"
|
||||||
<< std::dec;
|
<< std::dec;
|
||||||
std::clog << " [funcr ] "; value_info(ctx.funcr);
|
std::clog << " [ funcr ] "; value_info(ctx.funcr);
|
||||||
std::clog << " [upval ] "; value_info(ctx.upvalr);
|
std::clog << " [ upval ] "; value_info(ctx.upvalr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void vm::global_state() {
|
void vm::global_state() {
|
||||||
|
@ -245,7 +245,7 @@ void vm::global_state() {
|
||||||
std::clog << "\nglobal (0x" << std::hex
|
std::clog << "\nglobal (0x" << std::hex
|
||||||
<< reinterpret_cast<u64>(global) << ")\n" << std::dec;
|
<< reinterpret_cast<u64>(global) << ")\n" << std::dec;
|
||||||
for(usize i = 0; i<global_size; ++i) {
|
for(usize i = 0; i<global_size; ++i) {
|
||||||
std::clog << " 0x" << std::hex << std::setw(6)
|
std::clog << " 0x" << std::hex << std::setw(8)
|
||||||
<< std::setfill('0') << i << std::dec
|
<< std::setfill('0') << i << std::dec
|
||||||
<< " ";
|
<< " ";
|
||||||
value_info(global[i]);
|
value_info(global[i]);
|
||||||
|
@ -261,7 +261,7 @@ void vm::local_state() {
|
||||||
<< " <+" << static_cast<u64>(ctx.localr-ctx.stack)
|
<< " <+" << static_cast<u64>(ctx.localr-ctx.stack)
|
||||||
<< ">)\n" << std::dec;
|
<< ">)\n" << std::dec;
|
||||||
for(u32 i = 0; i<lsize; ++i) {
|
for(u32 i = 0; i<lsize; ++i) {
|
||||||
std::clog << " 0x" << std::hex << std::setw(6)
|
std::clog << " 0x" << std::hex << std::setw(8)
|
||||||
<< std::setfill('0') << i << std::dec
|
<< std::setfill('0') << i << std::dec
|
||||||
<< " ";
|
<< " ";
|
||||||
value_info(ctx.localr[i]);
|
value_info(ctx.localr[i]);
|
||||||
|
@ -278,7 +278,7 @@ void vm::upvalue_state() {
|
||||||
std::clog << " -> upval[" << i << "]:\n";
|
std::clog << " -> upval[" << i << "]:\n";
|
||||||
auto& uv = upval[i].upval();
|
auto& uv = upval[i].upval();
|
||||||
for(u32 j = 0; j<uv.size; ++j) {
|
for(u32 j = 0; j<uv.size; ++j) {
|
||||||
std::clog << " 0x" << std::hex << std::setw(6)
|
std::clog << " 0x" << std::hex << std::setw(8)
|
||||||
<< std::setfill('0') << j << std::dec
|
<< std::setfill('0') << j << std::dec
|
||||||
<< " ";
|
<< " ";
|
||||||
value_info(uv[j]);
|
value_info(uv[j]);
|
||||||
|
|
Loading…
Reference in New Issue