📝 delete useless report info

This commit is contained in:
ValKmjolnir 2024-06-14 00:35:20 +08:00
parent ce204352c6
commit 671b1ef212
2 changed files with 14 additions and 20 deletions

View File

@ -100,9 +100,8 @@ void codestream::dump(std::ostream& out) const {
case op_loadl: case op_loadl:
out << hex << "0x" << num << dec; break; out << hex << "0x" << num << dec; break;
case op_callb: case op_callb:
out << hex << "0x" << num << " <" << natives[num].name out << hex << "0x" << num << dec << " ["
<< "@0x" << reinterpret_cast<u64>(natives[num].func) << natives[num].name << "]"; break;
<< dec << ">"; break;
case op_upval: case op_upval:
case op_mupval: case op_mupval:
case op_loadu: case op_loadu:

View File

@ -98,34 +98,30 @@ void vm::value_info(var& val) {
case vm_type::vm_nil: std::clog << "| nil |"; break; case vm_type::vm_nil: std::clog << "| nil |"; break;
case vm_type::vm_num: std::clog << "| num | " << val.num(); break; case vm_type::vm_num: std::clog << "| num | " << val.num(); break;
case vm_type::vm_str: case vm_type::vm_str:
std::clog << "| str | <0x" << std::hex << p << "> " << std::dec; std::clog << "| str | \"" << util::rawstr(val.str(), 16) << "\"";
std::clog << "\"" << util::rawstr(val.str(), 16) << "\"";
break; break;
case vm_type::vm_func: case vm_type::vm_func:
std::clog << "| func | <0x" << std::hex << p << std::dec << "> "; std::clog << "| func | " << val.func();
std::clog << val.func();
break; break;
case vm_type::vm_upval: case vm_type::vm_upval:
std::clog << "| upval| <0x" << std::hex << p << std::dec; std::clog << "| upval| <0x" << std::hex << p << std::dec;
std::clog << "> [" << val.upval().size << " val]"; break; std::clog << "> [" << val.upval().size << " val]"; break;
case vm_type::vm_vec: case vm_type::vm_vec:
std::clog << "| vec | <0x" << std::hex << p << std::dec; std::clog << "| vec | [" << val.vec().size() << " val]"; break;
std::clog << "> [" << val.vec().size() << " val]"; break;
case vm_type::vm_hash: case vm_type::vm_hash:
std::clog << "| hash | <0x" << std::hex << p << std::dec << "> "; std::clog << "| hash | ";
hash_value_info(val); hash_value_info(val);
break; break;
case vm_type::vm_ghost: case vm_type::vm_ghost:
std::clog << "| obj | <0x" << std::hex << p << "> " << std::dec; std::clog << "| obj | <0x" << std::hex << p << "> " << std::dec;
std::clog << "obj:" << val.ghost().type_name; std::clog << "object:" << val.ghost().type_name;
break; break;
case vm_type::vm_co: case vm_type::vm_co:
std::clog << "| co | <0x" << std::hex << p << std::dec; std::clog << "| co | coroutine@0x" << std::hex << p << std::dec;
std::clog << "> coroutine";
break; break;
case vm_type::vm_map: case vm_type::vm_map:
std::clog << "| nmspc| <0x" << std::hex << p << std::dec; std::clog << "| nmspc| [";
std::clog << "> namespace [" << val.map().mapper.size() << " val]"; std::clog << val.map().mapper.size() << " val]";
break; break;
default: default:
std::clog << "| err | <0x" << std::hex << p << std::dec; std::clog << "| err | <0x" << std::hex << p << std::dec;
@ -136,8 +132,7 @@ void vm::value_info(var& val) {
} }
void vm::function_detail_info(const nas_func& func) { void vm::function_detail_info(const nas_func& func) {
std::clog << "func@0x"; std::clog << "func";
std::clog << std::hex << reinterpret_cast<u64>(&func) << std::dec;
std::vector<std::string> argument_list = {}; std::vector<std::string> argument_list = {};
argument_list.resize(func.keys.size()); argument_list.resize(func.keys.size());
@ -212,7 +207,7 @@ void vm::trace_back() {
} }
ret.push(ctx.pc); // store the position program crashed ret.push(ctx.pc); // store the position program crashed
std::clog << "\ntrace back " << (ngc.cort? "(coroutine)":"(main)") << "\n"; std::clog << "\nback trace " << (ngc.cort? "(coroutine)":"(main)") << "\n";
codestream::set(const_number, const_string, native_function.data(), files); codestream::set(const_number, const_string, native_function.data(), files);
for(u32 p = 0, same = 0, prev = 0xffffffff; !ret.empty(); prev = p, ret.pop()) { for(u32 p = 0, same = 0, prev = 0xffffffff; !ret.empty(); prev = p, ret.pop()) {
if ((p = ret.top())==prev) { if ((p = ret.top())==prev) {
@ -236,7 +231,7 @@ void vm::stack_info(const u64 limit = 16) {
var* bottom = ctx.stack; var* bottom = ctx.stack;
const auto stack_address = reinterpret_cast<u64>(bottom); const auto stack_address = reinterpret_cast<u64>(bottom);
std::clog << "\nvm stack (0x" << std::hex << stack_address << std::dec; std::clog << "\nstack (0x" << std::hex << stack_address << std::dec;
std::clog << ", limit " << limit << ", total "; std::clog << ", limit " << limit << ", total ";
std::clog << (top<bottom? 0:static_cast<i64>(top-bottom+1)) << ")\n"; std::clog << (top<bottom? 0:static_cast<i64>(top-bottom+1)) << ")\n";
@ -250,7 +245,7 @@ void vm::stack_info(const u64 limit = 16) {
} }
void vm::register_info() { void vm::register_info() {
std::clog << "\nregisters (" << (ngc.cort? "coroutine":"main") << ")\n"; std::clog << "\nregister (" << (ngc.cort? "coroutine":"main") << ")\n";
std::clog << std::hex std::clog << std::hex
<< " [ pc ] | pc | 0x" << ctx.pc << "\n" << " [ pc ] | pc | 0x" << ctx.pc << "\n"
<< " [ global ] | addr | 0x" << " [ global ] | addr | 0x"