Split gdbarch.h into two files
[binutils-gdb.git] / gdb / bpf-tdep.c
index 4854325cd1542a3f63b8a764c68ec6c6911eb8d6..6f07dce0bb65c8789be1b6ffe38cd8b47d5accb1 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for BPF.
 
-   Copyright (C) 2020 Free Software Foundation, Inc.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -34,6 +34,7 @@
 #include "osabi.h"
 #include "target-descriptions.h"
 #include "remote.h"
+#include "gdbarch.h"
 
 \f
 /* eBPF registers.  */
@@ -57,7 +58,7 @@ enum bpf_regnum
 #define BPF_NUM_REGS   (BPF_PC_REGNUM + 1)
 
 /* Target-dependent structure in gdbarch.  */
-struct gdbarch_tdep
+struct bpf_gdbarch_tdep : gdbarch_tdep
 {
 };
 
@@ -73,7 +74,7 @@ static unsigned int bpf_debug_flag = 0;
 
 static void
 show_bpf_debug (struct ui_file *file, int from_tty,
-               struct cmd_list_element *c, const char *value)
+               struct cmd_list_element *c, const char *value)
 {
   fprintf_filtered (file, _("Debugging of BPF is %s.\n"), value);
 }
@@ -184,6 +185,7 @@ bpf_frame_prev_register (struct frame_info *this_frame,
 
 static const struct frame_unwind bpf_frame_unwind =
 {
+  "bpf prologue",
   NORMAL_FRAME,
   bpf_frame_unwind_stop_reason,
   bpf_frame_this_id,
@@ -320,7 +322,7 @@ bpf_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
     return arches->gdbarch;
 
   /* Allocate space for the new architecture.  */
-  struct gdbarch_tdep *tdep = XCNEW (struct gdbarch_tdep);
+  bpf_gdbarch_tdep *tdep = new bpf_gdbarch_tdep;
   struct gdbarch *gdbarch = gdbarch_alloc (&info, tdep);
 
   /* Information about registers, etc.  */
@@ -370,7 +372,7 @@ bpf_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
 void _initialize_bpf_tdep ();
 void
-_initialize_bpf_tdep (void)
+_initialize_bpf_tdep ()
 {
   register_gdbarch_init (bfd_arch_bpf, bpf_gdbarch_init);