From 481afc249eeb63de3f47700af505343a53ffd1b1 Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Mon, 12 Dec 2016 12:48:58 -0800 Subject: [PATCH] Reuse the ebreak constants in encoding.h. --- riscv/gdbserver.cc | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/riscv/gdbserver.cc b/riscv/gdbserver.cc index 141ffe5..dda120a 100644 --- a/riscv/gdbserver.cc +++ b/riscv/gdbserver.cc @@ -17,9 +17,7 @@ #include "sim.h" #include "gdbserver.h" #include "mmu.h" - -#define C_EBREAK 0x9002 -#define EBREAK 0x00100073 +#include "encoding.h" //////////////////////////////////////// Utility Functions @@ -1936,13 +1934,13 @@ void gdbserver_t::software_breakpoint_insert(reg_t vaddr, unsigned int size) add_operation(new collect_translation_info_op_t(*this, vaddr, size)); unsigned char* inst = new unsigned char[4]; if (size == 2) { - inst[0] = C_EBREAK & 0xff; - inst[1] = (C_EBREAK >> 8) & 0xff; + inst[0] = MATCH_C_EBREAK & 0xff; + inst[1] = (MATCH_C_EBREAK >> 8) & 0xff; } else { - inst[0] = EBREAK & 0xff; - inst[1] = (EBREAK >> 8) & 0xff; - inst[2] = (EBREAK >> 16) & 0xff; - inst[3] = (EBREAK >> 24) & 0xff; + inst[0] = MATCH_EBREAK & 0xff; + inst[1] = (MATCH_EBREAK >> 8) & 0xff; + inst[2] = (MATCH_EBREAK >> 16) & 0xff; + inst[3] = (MATCH_EBREAK >> 24) & 0xff; } software_breakpoint_t bp = { -- 2.30.2