#include "prologue-value.h"
#include "arch/riscv.h"
#include "riscv-ravenscar-thread.h"
-#include "safe-ctype.h"
+#include "gdbsupport/gdb-safe-ctype.h"
/* The stack must be 16-byte aligned. */
#define SP_ALIGNMENT 16
enum tab_stops { value_column_1 = 15 };
gdb_puts (name, file);
- print_spaces (value_column_1 - strlen (name), file);
+ print_spaces (std::max<int> (1, value_column_1 - strlen (name)), file);
try
{
riscv_insn::fetch_instruction (struct gdbarch *gdbarch,
CORE_ADDR addr, int *len)
{
- enum bfd_endian byte_order = gdbarch_byte_order_for_code (gdbarch);
gdb_byte buf[RISCV_MAX_INSN_LEN];
int instlen, status;
memory_error (TARGET_XFER_E_IO, addr + 2);
}
- return extract_unsigned_integer (buf, instlen, byte_order);
+ /* RISC-V Specification states instructions are always little endian */
+ return extract_unsigned_integer (buf, instlen, BFD_ENDIAN_LITTLE);
}
/* Fetch from target memory an instruction at PC and decode it. This can