diff --git a/incl/iss/debugger/riscv_target_adapter.h b/incl/iss/debugger/riscv_target_adapter.h index 6d33e01..f134364 100644 --- a/incl/iss/debugger/riscv_target_adapter.h +++ b/incl/iss/debugger/riscv_target_adapter.h @@ -183,7 +183,8 @@ status riscv_target_adapter::read_registers(std::vector &data, st data.clear(); avail.clear(); const uint8_t *reg_base = core->get_regs_base_ptr(); - for (size_t reg_no = 0; reg_no < arch::traits::NUM_REGS; ++reg_no) { + auto start_reg=arch::traits::X0; + for (size_t reg_no = start_reg; reg_no < start_reg+33/*arch::traits::NUM_REGS*/; ++reg_no) { auto reg_width = arch::traits::reg_bit_widths[reg_no] / 8; unsigned offset = traits::reg_byte_offsets[reg_no]; for (size_t j = 0; j < reg_width; ++j) { @@ -210,11 +211,11 @@ status riscv_target_adapter::read_registers(std::vector &data, st } template status riscv_target_adapter::write_registers(const std::vector &data) { - auto reg_count = arch::traits::NUM_REGS; + auto start_reg=arch::traits::X0; auto *reg_base = core->get_regs_base_ptr(); auto iter = data.data(); - for (size_t reg_no = 0; reg_no < reg_count; ++reg_no) { - auto reg_width = arch::traits::reg_bit_widths[static_cast::reg_e>(reg_no)] / 8; + for (size_t reg_no = 0; reg_no < start_reg+33/*arch::traits::NUM_REGS*/; ++reg_no) { + auto reg_width = arch::traits::reg_bit_widths[reg_no] / 8; auto offset = traits::reg_byte_offsets[reg_no]; std::copy(iter, iter + reg_width, reg_base); iter += 4;