Browse Source

Always perform symbol lookup in debug

pull/1189/head
Jerry Zhao 3 years ago
parent
commit
9789b250f0
  1. 5
      riscv/execute.cc
  2. 7
      riscv/processor.cc

5
riscv/execute.cc

@ -60,11 +60,6 @@ static void commit_log_print_value(FILE *log_file, int width, uint64_t val)
commit_log_print_value(log_file, width, &val);
}
const char* processor_t::get_symbol(uint64_t addr)
{
return sim->get_symbol(addr);
}
static void commit_log_print_insn(processor_t *p, reg_t pc, insn_t insn)
{
FILE *log_file = p->get_log_file();

7
riscv/processor.cc

@ -891,20 +891,23 @@ void processor_t::take_trigger_action(triggers::action_t action, reg_t breakpoin
}
}
const char* processor_t::get_symbol(uint64_t addr)
{
return sim->get_symbol(addr);
}
void processor_t::disasm(insn_t insn)
{
uint64_t bits = insn.bits();
if (last_pc != state.pc || last_bits != bits) {
std::stringstream s; // first put everything in a string, later send it to output
#ifdef RISCV_ENABLE_COMMITLOG
const char* sym = get_symbol(state.pc);
if (sym != nullptr)
{
s << "core " << std::dec << std::setfill(' ') << std::setw(3) << id
<< ": >>>> " << sym << std::endl;
}
#endif
if (executions != 1) {
s << "core " << std::dec << std::setfill(' ') << std::setw(3) << id

Loading…
Cancel
Save