Introduce typeid_operation
[deliverable/binutils-gdb.git] / gdb / disasm-selftests.c
index aa4d499206a970122e2d16ab99f391fbb5416680..ae71e711bba44373024cf83e0e36baa90602f70e 100644 (file)
@@ -1,6 +1,6 @@
 /* Self tests for disassembler for GDB, the GNU debugger.
 
-   Copyright (C) 2017-2019 Free Software Foundation, Inc.
+   Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 
 #include "defs.h"
 #include "disasm.h"
-
-#if GDB_SELF_TEST
-#include "common/selftest.h"
+#include "gdbsupport/selftest.h"
 #include "selftest-arch.h"
+#include "gdbarch.h"
 
 namespace selftests {
 
@@ -70,11 +69,6 @@ print_one_insn_test (struct gdbarch *gdbarch)
       insn = xstormy16_insn;
       len = sizeof (xstormy16_insn);
       break;
-    case bfd_arch_arc:
-      /* PR 21003 */
-      if (gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_arc_arc601)
-       return;
-      /* fall through */
     case bfd_arch_nios2:
     case bfd_arch_score:
     case bfd_arch_riscv:
@@ -87,6 +81,11 @@ print_one_insn_test (struct gdbarch *gdbarch)
        len = bplen;
       }
       break;
+    case bfd_arch_arc:
+      /* PR 21003 */
+      if (gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_arc_arc601)
+       return;
+      /* fall through */
     default:
       {
        /* Test disassemble breakpoint instruction.  */
@@ -196,7 +195,7 @@ memory_error_test (struct gdbarch *gdbarch)
     {
       di.print_insn (0);
     }
-  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const gdb_exception_error &ex)
     {
       if (ex.error == MEMORY_ERROR)
        saw_memory_error = true;
@@ -207,15 +206,13 @@ memory_error_test (struct gdbarch *gdbarch)
 }
 
 } // namespace selftests
-#endif /* GDB_SELF_TEST */
 
+void _initialize_disasm_selftests ();
 void
-_initialize_disasm_selftests (void)
+_initialize_disasm_selftests ()
 {
-#if GDB_SELF_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
 }
This page took 0.023855 seconds and 4 git commands to generate.