Skip to content
This repository has been archived by the owner on Aug 17, 2022. It is now read-only.

Commit

Permalink
Don't cast riscv_fetch_instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
palmer-dabbelt committed Nov 14, 2016
1 parent 73656f2 commit 34a6a4b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gdb/riscv-tdep.c
Expand Up @@ -851,11 +851,12 @@ riscv_scan_prologue (struct gdbarch *gdbarch,
/* TODO: Handle compressed extensions. */
for (cur_pc = start_pc; cur_pc < limit_pc; cur_pc += 4)
{
unsigned long inst, opcode;
ULONGEST inst;
unsigned long opcode;
int reg, rs1, imm12, rs2, offset12, funct3;

/* Fetch the instruction. */
inst = (unsigned long) riscv_fetch_instruction (gdbarch, cur_pc);
inst = riscv_fetch_instruction (gdbarch, cur_pc);
opcode = inst & 0x7F;
reg = (inst >> 7) & 0x1F;
rs1 = (inst >> 15) & 0x1F;
Expand Down

0 comments on commit 34a6a4b

Please sign in to comment.