History

Added vm_id to vm_module_t that is used by the VM to uniquely identify a module Updated tool dispatcher to pass on the loaded_vm_module_t type as the module_vm_load event argument Debugger now uses symbol data to resolve stack IPs

arr committed 9 years ago

Commit 72f24ec1 parent a3c184b10 files · +160 −35Browse files

Showing the changes to src/asm/sbl_reader.cpp (1 of 10 files). Show all

Unified · Split

src/asm/sbl_reader.cpp+6−7
@@ -366,10 +366,7 @@ namespace · 365 unmodified lines
366366
367367 if (parts.size() == 3)
368368 {
369− item.size_in_bytes = std::strtol(parts[2].c_str(), nullptr, 10);
370− if (item.size_in_bytes == 0 && errno != 0)
371− throw std::runtime_error{ "Invalid adt size" };
372−
369+ item.size_in_bytes = std::stoi(parts[2]);
373370 item.id_table = read_id_table(r, tt, fc);
374371 }
375372
@@ -429,9 +426,6 @@ namespace · 53 unmodified lines
429426 {
430427 auto type_index = r.get_as_string_until('\n');
431428 const auto idx = std::stoi(type_index);
432− if (idx == 0)
433− throw std::runtime_error{ "Invalid type index" };
434−
435429 t.value_index_1 = type_table_t::types_mask | idx;
436430 break;
437431 }
@@ -681,6 +675,11 @@ namespace · 243 unmodified lines
681675 return _file->header.module_name;
682676 }
683677
678+ size_t get_instruction_count() const
679+ {
680+ return _file->pc_table.size();
681+ }
682+
684683 std::unique_ptr<symbol_debug_t> get_debug() override
685684 {
686685 return std::make_unique<sbl_symbol_debug>(_file);