X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fdisasm-selftests.c;h=67fc4251c3ab5a9fee3fcec80d182a1ad56c97d3;hb=74792ff782431ec6113b9a8a8e85b95f46094c7f;hp=4d38ccf251b0c433656fffeeaa75c5d91874e67d;hpb=7649770c8e52afe2696a70bb50ac3039c844d381;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/disasm-selftests.c b/gdb/disasm-selftests.c index 4d38ccf251..67fc4251c3 100644 --- a/gdb/disasm-selftests.c +++ b/gdb/disasm-selftests.c @@ -1,6 +1,6 @@ /* Self tests for disassembler for GDB, the GNU debugger. - Copyright (C) 2017 Free Software Foundation, Inc. + Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of GDB. @@ -77,12 +77,15 @@ print_one_insn_test (struct gdbarch *gdbarch) /* fall through */ case bfd_arch_nios2: case bfd_arch_score: - /* nios2 and score need to know the current instruction to select - breakpoint instruction. Give the breakpoint instruction kind - explicitly. */ - int bplen; - insn = gdbarch_sw_breakpoint_from_kind (gdbarch, 4, &bplen); - len = bplen; + case bfd_arch_riscv: + /* nios2, riscv, and score need to know the current instruction + to select breakpoint instruction. Give the breakpoint + instruction kind explicitly. */ + { + int bplen; + insn = gdbarch_sw_breakpoint_from_kind (gdbarch, 4, &bplen); + len = bplen; + } break; default: { @@ -207,14 +210,13 @@ memory_error_test (struct gdbarch *gdbarch) } // namespace selftests #endif /* GDB_SELF_TEST */ -/* Suppress warning from -Wmissing-prototypes. */ -extern initialize_file_ftype _initialize_disasm_selftests; - void _initialize_disasm_selftests (void) { #if GDB_SELF_TEST - selftests::register_test_foreach_arch (selftests::print_one_insn_test); - selftests::register_test_foreach_arch (selftests::memory_error_test); + selftests::register_test_foreach_arch ("print_one_insn", + selftests::print_one_insn_test); + selftests::register_test_foreach_arch ("memory_error", + selftests::memory_error_test); #endif }