This repository was archived by the owner on Aug 17, 2022. It is now read-only.
File tree 1 file changed +19
-0
lines changed
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,23 @@ riscv_breakpoint_from_pc (struct gdbarch *gdbarch,
172
172
return sbreak_insn ;
173
173
}
174
174
175
+ static int
176
+ riscv_breakpoint_kind_from_pc (struct gdbarch * gdbarch , CORE_ADDR * pcptr )
177
+ {
178
+ /* TODO: Support C.EBREAK for compressed (16-bit) insns. */
179
+ /* TODO: Support NOPs for >=6 byte insns. */
180
+ return 4 ;
181
+ }
182
+
183
+ static const gdb_byte *
184
+ riscv_sw_breakpoint_from_kind (struct gdbarch * gdbarch , int kind , int * size )
185
+ {
186
+ /* TODO: Support C.EBREAK for compressed (16-bit) insns. */
187
+ /* TODO: Support NOPs for >=6 byte insns. */
188
+ gdb_assert (kind == 4 );
189
+ return riscv_breakpoint_from_pc (gdbarch , NULL , size );
190
+ }
191
+
175
192
static struct value *
176
193
value_of_riscv_user_reg (struct frame_info * frame , const void * baton )
177
194
{
@@ -1216,6 +1233,8 @@ riscv_gdbarch_init (struct gdbarch_info info,
1216
1233
/* Information about the target architecture. */
1217
1234
set_gdbarch_return_value (gdbarch , riscv_return_value );
1218
1235
set_gdbarch_breakpoint_from_pc (gdbarch , riscv_breakpoint_from_pc );
1236
+ set_gdbarch_breakpoint_kind_from_pc (gdbarch , riscv_breakpoint_kind_from_pc );
1237
+ set_gdbarch_sw_breakpoint_from_kind (gdbarch , riscv_sw_breakpoint_from_kind );
1219
1238
set_gdbarch_print_insn (gdbarch , print_insn_riscv );
1220
1239
1221
1240
/* Register architecture. */
You can’t perform that action at this time.
0 commit comments