public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2 0/8] Rewrite gdbarch.sh in Python
@ 2021-12-16 20:38 Tom Tromey
  2021-12-16 20:38 ` [PATCH v2 1/8] Move ordinary gdbarch code to arch-utils Tom Tromey
                   ` (8 more replies)
  0 siblings, 9 replies; 21+ messages in thread
From: Tom Tromey @ 2021-12-16 20:38 UTC (permalink / raw)
  To: gdb-patches

Here's v2 of the series to rewrite gdbarch.sh in Python.  I think this
version addresses all the review comments.

Let me know what you think.

Tom



^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v2 1/8] Move ordinary gdbarch code to arch-utils
  2021-12-16 20:38 [PATCH v2 0/8] Rewrite gdbarch.sh in Python Tom Tromey
@ 2021-12-16 20:38 ` Tom Tromey
  2021-12-16 20:38 ` [PATCH v2 2/8] Split gdbarch.h into two files Tom Tromey
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 21+ messages in thread
From: Tom Tromey @ 2021-12-16 20:38 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

While I think it makes sense to generate gdbarch.c, at the same time I
think it is better for ordinary code to be editable in a C file -- not
as a hunk of C code embedded in the generator.

This patch moves this sort of code out of gdbarch.sh and gdbarch.c and
into arch-utils.c, then has arch-utils.c include gdbarch.c.
---
 gdb/Makefile.in  |   1 -
 gdb/arch-utils.c | 488 ++++++++++++++++++++++++++++++++++++++++++++
 gdb/gdbarch.c    | 508 ----------------------------------------------
 gdb/gdbarch.sh   | 519 -----------------------------------------------
 4 files changed, 488 insertions(+), 1028 deletions(-)

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index f2966cf6c00..d9db4245f40 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1075,7 +1075,6 @@ COMMON_SFILES = \
 	gdb_bfd.c \
 	gdb_obstack.c \
 	gdb_regex.c \
-	gdbarch.c \
 	gdbtypes.c \
 	gmp-utils.c \
 	gnu-v2-abi.c \
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 6c6dca22d63..4442ec9b82f 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -31,6 +31,11 @@
 #include "objfiles.h"
 #include "language.h"
 #include "symtab.h"
+#include "dummy-frame.h"
+#include "frame-unwind.h"
+#include "reggroups.h"
+#include "auxv.h"
+#include "observable.h"
 
 #include "gdbsupport/version.h"
 
@@ -1083,6 +1088,482 @@ default_read_core_file_mappings
 {
 }
 
+/* Static function declarations */
+
+static void alloc_gdbarch_data (struct gdbarch *);
+
+/* Non-zero if we want to trace architecture code.  */
+
+#ifndef GDBARCH_DEBUG
+#define GDBARCH_DEBUG 0
+#endif
+unsigned int gdbarch_debug = GDBARCH_DEBUG;
+static void
+show_gdbarch_debug (struct ui_file *file, int from_tty,
+		    struct cmd_list_element *c, const char *value)
+{
+  fprintf_filtered (file, _("Architecture debugging is %s.\n"), value);
+}
+
+static const char *
+pformat (const struct floatformat **format)
+{
+  if (format == NULL)
+    return "(null)";
+  else
+    /* Just print out one of them - this is only for diagnostics.  */
+    return format[0]->name;
+}
+
+static const char *
+pstring (const char *string)
+{
+  if (string == NULL)
+    return "(null)";
+  return string;
+}
+
+static const char *
+pstring_ptr (char **string)
+{
+  if (string == NULL || *string == NULL)
+    return "(null)";
+  return *string;
+}
+
+/* Helper function to print a list of strings, represented as "const
+   char *const *".  The list is printed comma-separated.  */
+
+static const char *
+pstring_list (const char *const *list)
+{
+  static char ret[100];
+  const char *const *p;
+  size_t offset = 0;
+
+  if (list == NULL)
+    return "(null)";
+
+  ret[0] = '\0';
+  for (p = list; *p != NULL && offset < sizeof (ret); ++p)
+    {
+      size_t s = xsnprintf (ret + offset, sizeof (ret) - offset, "%s, ", *p);
+      offset += 2 + s;
+    }
+
+  if (offset > 0)
+    {
+      gdb_assert (offset - 2 < sizeof (ret));
+      ret[offset - 2] = '\0';
+    }
+
+  return ret;
+}
+
+#include "gdbarch.c"
+
+obstack *gdbarch_obstack (gdbarch *arch)
+{
+  return arch->obstack;
+}
+
+/* See gdbarch.h.  */
+
+char *
+gdbarch_obstack_strdup (struct gdbarch *arch, const char *string)
+{
+  return obstack_strdup (arch->obstack, string);
+}
+
+
+/* Free a gdbarch struct.  This should never happen in normal
+   operation --- once you've created a gdbarch, you keep it around.
+   However, if an architecture's init function encounters an error
+   building the structure, it may need to clean up a partially
+   constructed gdbarch.  */
+
+void
+gdbarch_free (struct gdbarch *arch)
+{
+  struct obstack *obstack;
+
+  gdb_assert (arch != NULL);
+  gdb_assert (!arch->initialized_p);
+  obstack = arch->obstack;
+  obstack_free (obstack, 0); /* Includes the ARCH.  */
+  xfree (obstack);
+}
+
+struct gdbarch_tdep *
+gdbarch_tdep (struct gdbarch *gdbarch)
+{
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
+  return gdbarch->tdep;
+}
+
+/* Keep a registry of per-architecture data-pointers required by GDB
+   modules.  */
+
+struct gdbarch_data
+{
+  unsigned index;
+  int init_p;
+  gdbarch_data_pre_init_ftype *pre_init;
+  gdbarch_data_post_init_ftype *post_init;
+};
+
+struct gdbarch_data_registration
+{
+  struct gdbarch_data *data;
+  struct gdbarch_data_registration *next;
+};
+
+struct gdbarch_data_registry
+{
+  unsigned nr;
+  struct gdbarch_data_registration *registrations;
+};
+
+static struct gdbarch_data_registry gdbarch_data_registry =
+{
+  0, NULL,
+};
+
+static struct gdbarch_data *
+gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
+		       gdbarch_data_post_init_ftype *post_init)
+{
+  struct gdbarch_data_registration **curr;
+
+  /* Append the new registration.  */
+  for (curr = &gdbarch_data_registry.registrations;
+       (*curr) != NULL;
+       curr = &(*curr)->next);
+  (*curr) = XNEW (struct gdbarch_data_registration);
+  (*curr)->next = NULL;
+  (*curr)->data = XNEW (struct gdbarch_data);
+  (*curr)->data->index = gdbarch_data_registry.nr++;
+  (*curr)->data->pre_init = pre_init;
+  (*curr)->data->post_init = post_init;
+  (*curr)->data->init_p = 1;
+  return (*curr)->data;
+}
+
+struct gdbarch_data *
+gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init)
+{
+  return gdbarch_data_register (pre_init, NULL);
+}
+
+struct gdbarch_data *
+gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
+{
+  return gdbarch_data_register (NULL, post_init);
+}
+
+/* Create/delete the gdbarch data vector.  */
+
+static void
+alloc_gdbarch_data (struct gdbarch *gdbarch)
+{
+  gdb_assert (gdbarch->data == NULL);
+  gdbarch->nr_data = gdbarch_data_registry.nr;
+  gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *);
+}
+
+/* Return the current value of the specified per-architecture
+   data-pointer.  */
+
+void *
+gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
+{
+  gdb_assert (data->index < gdbarch->nr_data);
+  if (gdbarch->data[data->index] == NULL)
+    {
+      /* The data-pointer isn't initialized, call init() to get a
+	 value.  */
+      if (data->pre_init != NULL)
+	/* Mid architecture creation: pass just the obstack, and not
+	   the entire architecture, as that way it isn't possible for
+	   pre-init code to refer to undefined architecture
+	   fields.  */
+	gdbarch->data[data->index] = data->pre_init (gdbarch->obstack);
+      else if (gdbarch->initialized_p
+	       && data->post_init != NULL)
+	/* Post architecture creation: pass the entire architecture
+	   (as all fields are valid), but be careful to also detect
+	   recursive references.  */
+	{
+	  gdb_assert (data->init_p);
+	  data->init_p = 0;
+	  gdbarch->data[data->index] = data->post_init (gdbarch);
+	  data->init_p = 1;
+	}
+      else
+	internal_error (__FILE__, __LINE__,
+			_("gdbarch post-init data field can only be used "
+			  "after gdbarch is fully initialised"));
+      gdb_assert (gdbarch->data[data->index] != NULL);
+    }
+  return gdbarch->data[data->index];
+}
+
+
+/* Keep a registry of the architectures known by GDB.  */
+
+struct gdbarch_registration
+{
+  enum bfd_architecture bfd_architecture;
+  gdbarch_init_ftype *init;
+  gdbarch_dump_tdep_ftype *dump_tdep;
+  struct gdbarch_list *arches;
+  struct gdbarch_registration *next;
+};
+
+static struct gdbarch_registration *gdbarch_registry = NULL;
+
+std::vector<const char *>
+gdbarch_printable_names ()
+{
+  /* Accumulate a list of names based on the registed list of
+     architectures.  */
+  std::vector<const char *> arches;
+
+  for (gdbarch_registration *rego = gdbarch_registry;
+       rego != nullptr;
+       rego = rego->next)
+    {
+      const struct bfd_arch_info *ap
+	= bfd_lookup_arch (rego->bfd_architecture, 0);
+      if (ap == nullptr)
+	internal_error (__FILE__, __LINE__,
+			_("gdbarch_architecture_names: multi-arch unknown"));
+      do
+	{
+	  arches.push_back (ap->printable_name);
+	  ap = ap->next;
+	}
+      while (ap != NULL);
+    }
+
+  return arches;
+}
+
+
+void
+gdbarch_register (enum bfd_architecture bfd_architecture,
+		  gdbarch_init_ftype *init,
+		  gdbarch_dump_tdep_ftype *dump_tdep)
+{
+  struct gdbarch_registration **curr;
+  const struct bfd_arch_info *bfd_arch_info;
+
+  /* Check that BFD recognizes this architecture */
+  bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
+  if (bfd_arch_info == NULL)
+    {
+      internal_error (__FILE__, __LINE__,
+		      _("gdbarch: Attempt to register "
+			"unknown architecture (%d)"),
+		      bfd_architecture);
+    }
+  /* Check that we haven't seen this architecture before.  */
+  for (curr = &gdbarch_registry;
+       (*curr) != NULL;
+       curr = &(*curr)->next)
+    {
+      if (bfd_architecture == (*curr)->bfd_architecture)
+	internal_error (__FILE__, __LINE__,
+			_("gdbarch: Duplicate registration "
+			  "of architecture (%s)"),
+			bfd_arch_info->printable_name);
+    }
+  /* log it */
+  if (gdbarch_debug)
+    fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, %s)\n",
+			bfd_arch_info->printable_name,
+			host_address_to_string (init));
+  /* Append it */
+  (*curr) = XNEW (struct gdbarch_registration);
+  (*curr)->bfd_architecture = bfd_architecture;
+  (*curr)->init = init;
+  (*curr)->dump_tdep = dump_tdep;
+  (*curr)->arches = NULL;
+  (*curr)->next = NULL;
+}
+
+void
+register_gdbarch_init (enum bfd_architecture bfd_architecture,
+		       gdbarch_init_ftype *init)
+{
+  gdbarch_register (bfd_architecture, init, NULL);
+}
+
+
+/* Look for an architecture using gdbarch_info.  */
+
+struct gdbarch_list *
+gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
+			     const struct gdbarch_info *info)
+{
+  for (; arches != NULL; arches = arches->next)
+    {
+      if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
+	continue;
+      if (info->byte_order != arches->gdbarch->byte_order)
+	continue;
+      if (info->osabi != arches->gdbarch->osabi)
+	continue;
+      if (info->target_desc != arches->gdbarch->target_desc)
+	continue;
+      return arches;
+    }
+  return NULL;
+}
+
+
+/* Find an architecture that matches the specified INFO.  Create a new
+   architecture if needed.  Return that new architecture.  */
+
+struct gdbarch *
+gdbarch_find_by_info (struct gdbarch_info info)
+{
+  struct gdbarch *new_gdbarch;
+  struct gdbarch_registration *rego;
+
+  /* Fill in missing parts of the INFO struct using a number of
+     sources: "set ..."; INFOabfd supplied; and the global
+     defaults.  */
+  gdbarch_info_fill (&info);
+
+  /* Must have found some sort of architecture.  */
+  gdb_assert (info.bfd_arch_info != NULL);
+
+  if (gdbarch_debug)
+    {
+      fprintf_unfiltered (gdb_stdlog,
+			  "gdbarch_find_by_info: info.bfd_arch_info %s\n",
+			  (info.bfd_arch_info != NULL
+			   ? info.bfd_arch_info->printable_name
+			   : "(null)"));
+      fprintf_unfiltered (gdb_stdlog,
+			  "gdbarch_find_by_info: info.byte_order %d (%s)\n",
+			  info.byte_order,
+			  (info.byte_order == BFD_ENDIAN_BIG ? "big"
+			   : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
+			   : "default"));
+      fprintf_unfiltered (gdb_stdlog,
+			  "gdbarch_find_by_info: info.osabi %d (%s)\n",
+			  info.osabi, gdbarch_osabi_name (info.osabi));
+      fprintf_unfiltered (gdb_stdlog,
+			  "gdbarch_find_by_info: info.abfd %s\n",
+			  host_address_to_string (info.abfd));
+    }
+
+  /* Find the tdep code that knows about this architecture.  */
+  for (rego = gdbarch_registry;
+       rego != NULL;
+       rego = rego->next)
+    if (rego->bfd_architecture == info.bfd_arch_info->arch)
+      break;
+  if (rego == NULL)
+    {
+      if (gdbarch_debug)
+	fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
+			    "No matching architecture\n");
+      return 0;
+    }
+
+  /* Ask the tdep code for an architecture that matches "info".  */
+  new_gdbarch = rego->init (info, rego->arches);
+
+  /* Did the tdep code like it?  No.  Reject the change and revert to
+     the old architecture.  */
+  if (new_gdbarch == NULL)
+    {
+      if (gdbarch_debug)
+	fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
+			    "Target rejected architecture\n");
+      return NULL;
+    }
+
+  /* Is this a pre-existing architecture (as determined by already
+     being initialized)?  Move it to the front of the architecture
+     list (keeping the list sorted Most Recently Used).  */
+  if (new_gdbarch->initialized_p)
+    {
+      struct gdbarch_list **list;
+      struct gdbarch_list *self;
+      if (gdbarch_debug)
+	fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
+			    "Previous architecture %s (%s) selected\n",
+			    host_address_to_string (new_gdbarch),
+			    new_gdbarch->bfd_arch_info->printable_name);
+      /* Find the existing arch in the list.  */
+      for (list = &rego->arches;
+	   (*list) != NULL && (*list)->gdbarch != new_gdbarch;
+	   list = &(*list)->next);
+      /* It had better be in the list of architectures.  */
+      gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
+      /* Unlink SELF.  */
+      self = (*list);
+      (*list) = self->next;
+      /* Insert SELF at the front.  */
+      self->next = rego->arches;
+      rego->arches = self;
+      /* Return it.  */
+      return new_gdbarch;
+    }
+
+  /* It's a new architecture.  */
+  if (gdbarch_debug)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
+			"New architecture %s (%s) selected\n",
+			host_address_to_string (new_gdbarch),
+			new_gdbarch->bfd_arch_info->printable_name);
+
+  /* Insert the new architecture into the front of the architecture
+     list (keep the list sorted Most Recently Used).  */
+  {
+    struct gdbarch_list *self = XNEW (struct gdbarch_list);
+    self->next = rego->arches;
+    self->gdbarch = new_gdbarch;
+    rego->arches = self;
+  }
+
+  /* Check that the newly installed architecture is valid.  Plug in
+     any post init values.  */
+  new_gdbarch->dump_tdep = rego->dump_tdep;
+  verify_gdbarch (new_gdbarch);
+  new_gdbarch->initialized_p = 1;
+
+  if (gdbarch_debug)
+    gdbarch_dump (new_gdbarch, gdb_stdlog);
+
+  return new_gdbarch;
+}
+
+/* Make the specified architecture current.  */
+
+void
+set_target_gdbarch (struct gdbarch *new_gdbarch)
+{
+  gdb_assert (new_gdbarch != NULL);
+  gdb_assert (new_gdbarch->initialized_p);
+  current_inferior ()->gdbarch = new_gdbarch;
+  gdb::observers::architecture_changed.notify (new_gdbarch);
+  registers_changed ();
+}
+
+/* Return the current inferior's arch.  */
+
+struct gdbarch *
+target_gdbarch (void)
+{
+  return current_inferior ()->gdbarch;
+}
+
 void _initialize_gdbarch_utils ();
 void
 _initialize_gdbarch_utils ()
@@ -1093,4 +1574,11 @@ _initialize_gdbarch_utils ()
 			_("Show endianness of target."),
 			NULL, set_endian, show_endian,
 			&setlist, &showlist);
+  add_setshow_zuinteger_cmd ("arch", class_maintenance, &gdbarch_debug, _("\
+Set architecture debugging."), _("\
+Show architecture debugging."), _("\
+When non-zero, architecture debugging is enabled."),
+			    NULL,
+			    show_gdbarch_debug,
+			    &setdebuglist, &showdebuglist);
 }
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 689187f8b1e..f4460a6e616 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -23,97 +23,6 @@
 /* This file was created with the aid of ``gdbarch.sh''.  */
 
 
-#include "defs.h"
-#include "arch-utils.h"
-
-#include "gdbcmd.h"
-#include "inferior.h" 
-#include "symcat.h"
-
-#include "floatformat.h"
-#include "reggroups.h"
-#include "osabi.h"
-#include "gdb_obstack.h"
-#include "observable.h"
-#include "regcache.h"
-#include "objfiles.h"
-#include "auxv.h"
-#include "frame-unwind.h"
-#include "dummy-frame.h"
-
-/* Static function declarations */
-
-static void alloc_gdbarch_data (struct gdbarch *);
-
-/* Non-zero if we want to trace architecture code.  */
-
-#ifndef GDBARCH_DEBUG
-#define GDBARCH_DEBUG 0
-#endif
-unsigned int gdbarch_debug = GDBARCH_DEBUG;
-static void
-show_gdbarch_debug (struct ui_file *file, int from_tty,
-		    struct cmd_list_element *c, const char *value)
-{
-  fprintf_filtered (file, _("Architecture debugging is %s.\n"), value);
-}
-
-static const char *
-pformat (const struct floatformat **format)
-{
-  if (format == NULL)
-    return "(null)";
-  else
-    /* Just print out one of them - this is only for diagnostics.  */
-    return format[0]->name;
-}
-
-static const char *
-pstring (const char *string)
-{
-  if (string == NULL)
-    return "(null)";
-  return string;
-}
-
-static const char *
-pstring_ptr (char **string)
-{
-  if (string == NULL || *string == NULL)
-    return "(null)";
-  return *string;
-}
-
-/* Helper function to print a list of strings, represented as "const
-   char *const *".  The list is printed comma-separated.  */
-
-static const char *
-pstring_list (const char *const *list)
-{
-  static char ret[100];
-  const char *const *p;
-  size_t offset = 0;
-
-  if (list == NULL)
-    return "(null)";
-
-  ret[0] = '\0';
-  for (p = list; *p != NULL && offset < sizeof (ret); ++p)
-    {
-      size_t s = xsnprintf (ret + offset, sizeof (ret) - offset, "%s, ", *p);
-      offset += 2 + s;
-    }
-
-  if (offset > 0)
-    {
-      gdb_assert (offset - 2 < sizeof (ret));
-      ret[offset - 2] = '\0';
-    }
-
-  return ret;
-}
-
-
 /* Maintain the struct gdbarch object.  */
 
 struct gdbarch
@@ -490,39 +399,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
 
 
 
-obstack *gdbarch_obstack (gdbarch *arch)
-{
-  return arch->obstack;
-}
-
-/* See gdbarch.h.  */
-
-char *
-gdbarch_obstack_strdup (struct gdbarch *arch, const char *string)
-{
-  return obstack_strdup (arch->obstack, string);
-}
-
-
-/* Free a gdbarch struct.  This should never happen in normal
-   operation --- once you've created a gdbarch, you keep it around.
-   However, if an architecture's init function encounters an error
-   building the structure, it may need to clean up a partially
-   constructed gdbarch.  */
-
-void
-gdbarch_free (struct gdbarch *arch)
-{
-  struct obstack *obstack;
-
-  gdb_assert (arch != NULL);
-  gdb_assert (!arch->initialized_p);
-  obstack = arch->obstack;
-  obstack_free (obstack, 0); /* Includes the ARCH.  */
-  xfree (obstack);
-}
-
-
 /* Ensure that all values in a GDBARCH are reasonable.  */
 
 static void
@@ -1565,14 +1441,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
     gdbarch->dump_tdep (gdbarch, file);
 }
 
-struct gdbarch_tdep *
-gdbarch_tdep (struct gdbarch *gdbarch)
-{
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
-  return gdbarch->tdep;
-}
-
 
 const struct bfd_arch_info *
 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
@@ -5426,379 +5294,3 @@ set_gdbarch_read_core_file_mappings (struct gdbarch *gdbarch,
 {
   gdbarch->read_core_file_mappings = read_core_file_mappings;
 }
-
-
-/* Keep a registry of per-architecture data-pointers required by GDB
-   modules.  */
-
-struct gdbarch_data
-{
-  unsigned index;
-  int init_p;
-  gdbarch_data_pre_init_ftype *pre_init;
-  gdbarch_data_post_init_ftype *post_init;
-};
-
-struct gdbarch_data_registration
-{
-  struct gdbarch_data *data;
-  struct gdbarch_data_registration *next;
-};
-
-struct gdbarch_data_registry
-{
-  unsigned nr;
-  struct gdbarch_data_registration *registrations;
-};
-
-static struct gdbarch_data_registry gdbarch_data_registry =
-{
-  0, NULL,
-};
-
-static struct gdbarch_data *
-gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
-		       gdbarch_data_post_init_ftype *post_init)
-{
-  struct gdbarch_data_registration **curr;
-
-  /* Append the new registration.  */
-  for (curr = &gdbarch_data_registry.registrations;
-       (*curr) != NULL;
-       curr = &(*curr)->next);
-  (*curr) = XNEW (struct gdbarch_data_registration);
-  (*curr)->next = NULL;
-  (*curr)->data = XNEW (struct gdbarch_data);
-  (*curr)->data->index = gdbarch_data_registry.nr++;
-  (*curr)->data->pre_init = pre_init;
-  (*curr)->data->post_init = post_init;
-  (*curr)->data->init_p = 1;
-  return (*curr)->data;
-}
-
-struct gdbarch_data *
-gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init)
-{
-  return gdbarch_data_register (pre_init, NULL);
-}
-
-struct gdbarch_data *
-gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
-{
-  return gdbarch_data_register (NULL, post_init);
-}
-
-/* Create/delete the gdbarch data vector.  */
-
-static void
-alloc_gdbarch_data (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch->data == NULL);
-  gdbarch->nr_data = gdbarch_data_registry.nr;
-  gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *);
-}
-
-/* Return the current value of the specified per-architecture
-   data-pointer.  */
-
-void *
-gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
-{
-  gdb_assert (data->index < gdbarch->nr_data);
-  if (gdbarch->data[data->index] == NULL)
-    {
-      /* The data-pointer isn't initialized, call init() to get a
-	 value.  */
-      if (data->pre_init != NULL)
-	/* Mid architecture creation: pass just the obstack, and not
-	   the entire architecture, as that way it isn't possible for
-	   pre-init code to refer to undefined architecture
-	   fields.  */
-	gdbarch->data[data->index] = data->pre_init (gdbarch->obstack);
-      else if (gdbarch->initialized_p
-	       && data->post_init != NULL)
-	/* Post architecture creation: pass the entire architecture
-	   (as all fields are valid), but be careful to also detect
-	   recursive references.  */
-	{
-	  gdb_assert (data->init_p);
-	  data->init_p = 0;
-	  gdbarch->data[data->index] = data->post_init (gdbarch);
-	  data->init_p = 1;
-	}
-      else
-	internal_error (__FILE__, __LINE__,
-			_("gdbarch post-init data field can only be used "
-			  "after gdbarch is fully initialised"));
-      gdb_assert (gdbarch->data[data->index] != NULL);
-    }
-  return gdbarch->data[data->index];
-}
-
-
-/* Keep a registry of the architectures known by GDB.  */
-
-struct gdbarch_registration
-{
-  enum bfd_architecture bfd_architecture;
-  gdbarch_init_ftype *init;
-  gdbarch_dump_tdep_ftype *dump_tdep;
-  struct gdbarch_list *arches;
-  struct gdbarch_registration *next;
-};
-
-static struct gdbarch_registration *gdbarch_registry = NULL;
-
-std::vector<const char *>
-gdbarch_printable_names ()
-{
-  /* Accumulate a list of names based on the registed list of
-     architectures.  */
-  std::vector<const char *> arches;
-
-  for (gdbarch_registration *rego = gdbarch_registry;
-       rego != nullptr;
-       rego = rego->next)
-    {
-      const struct bfd_arch_info *ap
-	= bfd_lookup_arch (rego->bfd_architecture, 0);
-      if (ap == nullptr)
-	internal_error (__FILE__, __LINE__,
-			_("gdbarch_architecture_names: multi-arch unknown"));
-      do
-	{
-	  arches.push_back (ap->printable_name);
-	  ap = ap->next;
-	}
-      while (ap != NULL);
-    }
-
-  return arches;
-}
-
-
-void
-gdbarch_register (enum bfd_architecture bfd_architecture,
-		  gdbarch_init_ftype *init,
-		  gdbarch_dump_tdep_ftype *dump_tdep)
-{
-  struct gdbarch_registration **curr;
-  const struct bfd_arch_info *bfd_arch_info;
-
-  /* Check that BFD recognizes this architecture */
-  bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
-  if (bfd_arch_info == NULL)
-    {
-      internal_error (__FILE__, __LINE__,
-		      _("gdbarch: Attempt to register "
-			"unknown architecture (%d)"),
-		      bfd_architecture);
-    }
-  /* Check that we haven't seen this architecture before.  */
-  for (curr = &gdbarch_registry;
-       (*curr) != NULL;
-       curr = &(*curr)->next)
-    {
-      if (bfd_architecture == (*curr)->bfd_architecture)
-	internal_error (__FILE__, __LINE__,
-			_("gdbarch: Duplicate registration "
-			  "of architecture (%s)"),
-			bfd_arch_info->printable_name);
-    }
-  /* log it */
-  if (gdbarch_debug)
-    fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, %s)\n",
-			bfd_arch_info->printable_name,
-			host_address_to_string (init));
-  /* Append it */
-  (*curr) = XNEW (struct gdbarch_registration);
-  (*curr)->bfd_architecture = bfd_architecture;
-  (*curr)->init = init;
-  (*curr)->dump_tdep = dump_tdep;
-  (*curr)->arches = NULL;
-  (*curr)->next = NULL;
-}
-
-void
-register_gdbarch_init (enum bfd_architecture bfd_architecture,
-		       gdbarch_init_ftype *init)
-{
-  gdbarch_register (bfd_architecture, init, NULL);
-}
-
-
-/* Look for an architecture using gdbarch_info.  */
-
-struct gdbarch_list *
-gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
-			     const struct gdbarch_info *info)
-{
-  for (; arches != NULL; arches = arches->next)
-    {
-      if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
-	continue;
-      if (info->byte_order != arches->gdbarch->byte_order)
-	continue;
-      if (info->osabi != arches->gdbarch->osabi)
-	continue;
-      if (info->target_desc != arches->gdbarch->target_desc)
-	continue;
-      return arches;
-    }
-  return NULL;
-}
-
-
-/* Find an architecture that matches the specified INFO.  Create a new
-   architecture if needed.  Return that new architecture.  */
-
-struct gdbarch *
-gdbarch_find_by_info (struct gdbarch_info info)
-{
-  struct gdbarch *new_gdbarch;
-  struct gdbarch_registration *rego;
-
-  /* Fill in missing parts of the INFO struct using a number of
-     sources: "set ..."; INFOabfd supplied; and the global
-     defaults.  */
-  gdbarch_info_fill (&info);
-
-  /* Must have found some sort of architecture.  */
-  gdb_assert (info.bfd_arch_info != NULL);
-
-  if (gdbarch_debug)
-    {
-      fprintf_unfiltered (gdb_stdlog,
-			  "gdbarch_find_by_info: info.bfd_arch_info %s\n",
-			  (info.bfd_arch_info != NULL
-			   ? info.bfd_arch_info->printable_name
-			   : "(null)"));
-      fprintf_unfiltered (gdb_stdlog,
-			  "gdbarch_find_by_info: info.byte_order %d (%s)\n",
-			  info.byte_order,
-			  (info.byte_order == BFD_ENDIAN_BIG ? "big"
-			   : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
-			   : "default"));
-      fprintf_unfiltered (gdb_stdlog,
-			  "gdbarch_find_by_info: info.osabi %d (%s)\n",
-			  info.osabi, gdbarch_osabi_name (info.osabi));
-      fprintf_unfiltered (gdb_stdlog,
-			  "gdbarch_find_by_info: info.abfd %s\n",
-			  host_address_to_string (info.abfd));
-    }
-
-  /* Find the tdep code that knows about this architecture.  */
-  for (rego = gdbarch_registry;
-       rego != NULL;
-       rego = rego->next)
-    if (rego->bfd_architecture == info.bfd_arch_info->arch)
-      break;
-  if (rego == NULL)
-    {
-      if (gdbarch_debug)
-	fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
-			    "No matching architecture\n");
-      return 0;
-    }
-
-  /* Ask the tdep code for an architecture that matches "info".  */
-  new_gdbarch = rego->init (info, rego->arches);
-
-  /* Did the tdep code like it?  No.  Reject the change and revert to
-     the old architecture.  */
-  if (new_gdbarch == NULL)
-    {
-      if (gdbarch_debug)
-	fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
-			    "Target rejected architecture\n");
-      return NULL;
-    }
-
-  /* Is this a pre-existing architecture (as determined by already
-     being initialized)?  Move it to the front of the architecture
-     list (keeping the list sorted Most Recently Used).  */
-  if (new_gdbarch->initialized_p)
-    {
-      struct gdbarch_list **list;
-      struct gdbarch_list *self;
-      if (gdbarch_debug)
-	fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
-			    "Previous architecture %s (%s) selected\n",
-			    host_address_to_string (new_gdbarch),
-			    new_gdbarch->bfd_arch_info->printable_name);
-      /* Find the existing arch in the list.  */
-      for (list = &rego->arches;
-	   (*list) != NULL && (*list)->gdbarch != new_gdbarch;
-	   list = &(*list)->next);
-      /* It had better be in the list of architectures.  */
-      gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
-      /* Unlink SELF.  */
-      self = (*list);
-      (*list) = self->next;
-      /* Insert SELF at the front.  */
-      self->next = rego->arches;
-      rego->arches = self;
-      /* Return it.  */
-      return new_gdbarch;
-    }
-
-  /* It's a new architecture.  */
-  if (gdbarch_debug)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
-			"New architecture %s (%s) selected\n",
-			host_address_to_string (new_gdbarch),
-			new_gdbarch->bfd_arch_info->printable_name);
-  
-  /* Insert the new architecture into the front of the architecture
-     list (keep the list sorted Most Recently Used).  */
-  {
-    struct gdbarch_list *self = XNEW (struct gdbarch_list);
-    self->next = rego->arches;
-    self->gdbarch = new_gdbarch;
-    rego->arches = self;
-  }    
-
-  /* Check that the newly installed architecture is valid.  Plug in
-     any post init values.  */
-  new_gdbarch->dump_tdep = rego->dump_tdep;
-  verify_gdbarch (new_gdbarch);
-  new_gdbarch->initialized_p = 1;
-
-  if (gdbarch_debug)
-    gdbarch_dump (new_gdbarch, gdb_stdlog);
-
-  return new_gdbarch;
-}
-
-/* Make the specified architecture current.  */
-
-void
-set_target_gdbarch (struct gdbarch *new_gdbarch)
-{
-  gdb_assert (new_gdbarch != NULL);
-  gdb_assert (new_gdbarch->initialized_p);
-  current_inferior ()->gdbarch = new_gdbarch;
-  gdb::observers::architecture_changed.notify (new_gdbarch);
-  registers_changed ();
-}
-
-/* Return the current inferior's arch.  */
-
-struct gdbarch *
-target_gdbarch (void)
-{
-  return current_inferior ()->gdbarch;
-}
-
-void _initialize_gdbarch ();
-void
-_initialize_gdbarch ()
-{
-  add_setshow_zuinteger_cmd ("arch", class_maintenance, &gdbarch_debug, _("\
-Set architecture debugging."), _("\
-Show architecture debugging."), _("\
-When non-zero, architecture debugging is enabled."),
-			    NULL,
-			    show_gdbarch_debug,
-			    &setdebuglist, &showdebuglist);
-}
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 83a359b4f59..0d63462d7bb 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -1729,99 +1729,6 @@ rm -f new-gdbarch.h
 
 exec > new-gdbarch.c
 copyright
-cat <<EOF
-
-#include "defs.h"
-#include "arch-utils.h"
-
-#include "gdbcmd.h"
-#include "inferior.h" 
-#include "symcat.h"
-
-#include "floatformat.h"
-#include "reggroups.h"
-#include "osabi.h"
-#include "gdb_obstack.h"
-#include "observable.h"
-#include "regcache.h"
-#include "objfiles.h"
-#include "auxv.h"
-#include "frame-unwind.h"
-#include "dummy-frame.h"
-
-/* Static function declarations */
-
-static void alloc_gdbarch_data (struct gdbarch *);
-
-/* Non-zero if we want to trace architecture code.  */
-
-#ifndef GDBARCH_DEBUG
-#define GDBARCH_DEBUG 0
-#endif
-unsigned int gdbarch_debug = GDBARCH_DEBUG;
-static void
-show_gdbarch_debug (struct ui_file *file, int from_tty,
-		    struct cmd_list_element *c, const char *value)
-{
-  fprintf_filtered (file, _("Architecture debugging is %s.\\n"), value);
-}
-
-static const char *
-pformat (const struct floatformat **format)
-{
-  if (format == NULL)
-    return "(null)";
-  else
-    /* Just print out one of them - this is only for diagnostics.  */
-    return format[0]->name;
-}
-
-static const char *
-pstring (const char *string)
-{
-  if (string == NULL)
-    return "(null)";
-  return string;
-}
-
-static const char *
-pstring_ptr (char **string)
-{
-  if (string == NULL || *string == NULL)
-    return "(null)";
-  return *string;
-}
-
-/* Helper function to print a list of strings, represented as "const
-   char *const *".  The list is printed comma-separated.  */
-
-static const char *
-pstring_list (const char *const *list)
-{
-  static char ret[100];
-  const char *const *p;
-  size_t offset = 0;
-
-  if (list == NULL)
-    return "(null)";
-
-  ret[0] = '\0';
-  for (p = list; *p != NULL && offset < sizeof (ret); ++p)
-    {
-      size_t s = xsnprintf (ret + offset, sizeof (ret) - offset, "%s, ", *p);
-      offset += 2 + s;
-    }
-
-  if (offset > 0)
-    {
-      gdb_assert (offset - 2 < sizeof (ret));
-      ret[offset - 2] = '\0';
-    }
-
-  return ret;
-}
-
-EOF
 
 # gdbarch open the gdbarch object
 printf "\n"
@@ -1944,41 +1851,6 @@ EOF
 
 # Free a gdbarch struct.
 printf "\n"
-printf "\n"
-cat <<EOF
-
-obstack *gdbarch_obstack (gdbarch *arch)
-{
-  return arch->obstack;
-}
-
-/* See gdbarch.h.  */
-
-char *
-gdbarch_obstack_strdup (struct gdbarch *arch, const char *string)
-{
-  return obstack_strdup (arch->obstack, string);
-}
-
-
-/* Free a gdbarch struct.  This should never happen in normal
-   operation --- once you've created a gdbarch, you keep it around.
-   However, if an architecture's init function encounters an error
-   building the structure, it may need to clean up a partially
-   constructed gdbarch.  */
-
-void
-gdbarch_free (struct gdbarch *arch)
-{
-  struct obstack *obstack;
-
-  gdb_assert (arch != NULL);
-  gdb_assert (!arch->initialized_p);
-  obstack = arch->obstack;
-  obstack_free (obstack, 0); /* Includes the ARCH.  */
-  xfree (obstack);
-}
-EOF
 
 # verify a new architecture
 cat <<EOF
@@ -2100,17 +1972,6 @@ cat <<EOF
 EOF
 
 
-# GET/SET
-printf "\n"
-cat <<EOF
-struct gdbarch_tdep *
-gdbarch_tdep (struct gdbarch *gdbarch)
-{
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\\n");
-  return gdbarch->tdep;
-}
-EOF
 printf "\n"
 function_list | while do_read
 do
@@ -2218,386 +2079,6 @@ do
     fi
 done
 
-# All the trailing guff
-cat <<EOF
-
-
-/* Keep a registry of per-architecture data-pointers required by GDB
-   modules.  */
-
-struct gdbarch_data
-{
-  unsigned index;
-  int init_p;
-  gdbarch_data_pre_init_ftype *pre_init;
-  gdbarch_data_post_init_ftype *post_init;
-};
-
-struct gdbarch_data_registration
-{
-  struct gdbarch_data *data;
-  struct gdbarch_data_registration *next;
-};
-
-struct gdbarch_data_registry
-{
-  unsigned nr;
-  struct gdbarch_data_registration *registrations;
-};
-
-static struct gdbarch_data_registry gdbarch_data_registry =
-{
-  0, NULL,
-};
-
-static struct gdbarch_data *
-gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
-		       gdbarch_data_post_init_ftype *post_init)
-{
-  struct gdbarch_data_registration **curr;
-
-  /* Append the new registration.  */
-  for (curr = &gdbarch_data_registry.registrations;
-       (*curr) != NULL;
-       curr = &(*curr)->next);
-  (*curr) = XNEW (struct gdbarch_data_registration);
-  (*curr)->next = NULL;
-  (*curr)->data = XNEW (struct gdbarch_data);
-  (*curr)->data->index = gdbarch_data_registry.nr++;
-  (*curr)->data->pre_init = pre_init;
-  (*curr)->data->post_init = post_init;
-  (*curr)->data->init_p = 1;
-  return (*curr)->data;
-}
-
-struct gdbarch_data *
-gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init)
-{
-  return gdbarch_data_register (pre_init, NULL);
-}
-
-struct gdbarch_data *
-gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
-{
-  return gdbarch_data_register (NULL, post_init);
-}
-
-/* Create/delete the gdbarch data vector.  */
-
-static void
-alloc_gdbarch_data (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch->data == NULL);
-  gdbarch->nr_data = gdbarch_data_registry.nr;
-  gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *);
-}
-
-/* Return the current value of the specified per-architecture
-   data-pointer.  */
-
-void *
-gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
-{
-  gdb_assert (data->index < gdbarch->nr_data);
-  if (gdbarch->data[data->index] == NULL)
-    {
-      /* The data-pointer isn't initialized, call init() to get a
-	 value.  */
-      if (data->pre_init != NULL)
-	/* Mid architecture creation: pass just the obstack, and not
-	   the entire architecture, as that way it isn't possible for
-	   pre-init code to refer to undefined architecture
-	   fields.  */
-	gdbarch->data[data->index] = data->pre_init (gdbarch->obstack);
-      else if (gdbarch->initialized_p
-	       && data->post_init != NULL)
-	/* Post architecture creation: pass the entire architecture
-	   (as all fields are valid), but be careful to also detect
-	   recursive references.  */
-	{
-	  gdb_assert (data->init_p);
-	  data->init_p = 0;
-	  gdbarch->data[data->index] = data->post_init (gdbarch);
-	  data->init_p = 1;
-	}
-      else
-	internal_error (__FILE__, __LINE__,
-			_("gdbarch post-init data field can only be used "
-			  "after gdbarch is fully initialised"));
-      gdb_assert (gdbarch->data[data->index] != NULL);
-    }
-  return gdbarch->data[data->index];
-}
-
-
-/* Keep a registry of the architectures known by GDB.  */
-
-struct gdbarch_registration
-{
-  enum bfd_architecture bfd_architecture;
-  gdbarch_init_ftype *init;
-  gdbarch_dump_tdep_ftype *dump_tdep;
-  struct gdbarch_list *arches;
-  struct gdbarch_registration *next;
-};
-
-static struct gdbarch_registration *gdbarch_registry = NULL;
-
-std::vector<const char *>
-gdbarch_printable_names ()
-{
-  /* Accumulate a list of names based on the registed list of
-     architectures.  */
-  std::vector<const char *> arches;
-
-  for (gdbarch_registration *rego = gdbarch_registry;
-       rego != nullptr;
-       rego = rego->next)
-    {
-      const struct bfd_arch_info *ap
-	= bfd_lookup_arch (rego->bfd_architecture, 0);
-      if (ap == nullptr)
-	internal_error (__FILE__, __LINE__,
-			_("gdbarch_architecture_names: multi-arch unknown"));
-      do
-	{
-	  arches.push_back (ap->printable_name);
-	  ap = ap->next;
-	}
-      while (ap != NULL);
-    }
-
-  return arches;
-}
-
-
-void
-gdbarch_register (enum bfd_architecture bfd_architecture,
-		  gdbarch_init_ftype *init,
-		  gdbarch_dump_tdep_ftype *dump_tdep)
-{
-  struct gdbarch_registration **curr;
-  const struct bfd_arch_info *bfd_arch_info;
-
-  /* Check that BFD recognizes this architecture */
-  bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
-  if (bfd_arch_info == NULL)
-    {
-      internal_error (__FILE__, __LINE__,
-		      _("gdbarch: Attempt to register "
-			"unknown architecture (%d)"),
-		      bfd_architecture);
-    }
-  /* Check that we haven't seen this architecture before.  */
-  for (curr = &gdbarch_registry;
-       (*curr) != NULL;
-       curr = &(*curr)->next)
-    {
-      if (bfd_architecture == (*curr)->bfd_architecture)
-	internal_error (__FILE__, __LINE__,
-			_("gdbarch: Duplicate registration "
-			  "of architecture (%s)"),
-			bfd_arch_info->printable_name);
-    }
-  /* log it */
-  if (gdbarch_debug)
-    fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, %s)\n",
-			bfd_arch_info->printable_name,
-			host_address_to_string (init));
-  /* Append it */
-  (*curr) = XNEW (struct gdbarch_registration);
-  (*curr)->bfd_architecture = bfd_architecture;
-  (*curr)->init = init;
-  (*curr)->dump_tdep = dump_tdep;
-  (*curr)->arches = NULL;
-  (*curr)->next = NULL;
-}
-
-void
-register_gdbarch_init (enum bfd_architecture bfd_architecture,
-		       gdbarch_init_ftype *init)
-{
-  gdbarch_register (bfd_architecture, init, NULL);
-}
-
-
-/* Look for an architecture using gdbarch_info.  */
-
-struct gdbarch_list *
-gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
-			     const struct gdbarch_info *info)
-{
-  for (; arches != NULL; arches = arches->next)
-    {
-      if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
-	continue;
-      if (info->byte_order != arches->gdbarch->byte_order)
-	continue;
-      if (info->osabi != arches->gdbarch->osabi)
-	continue;
-      if (info->target_desc != arches->gdbarch->target_desc)
-	continue;
-      return arches;
-    }
-  return NULL;
-}
-
-
-/* Find an architecture that matches the specified INFO.  Create a new
-   architecture if needed.  Return that new architecture.  */
-
-struct gdbarch *
-gdbarch_find_by_info (struct gdbarch_info info)
-{
-  struct gdbarch *new_gdbarch;
-  struct gdbarch_registration *rego;
-
-  /* Fill in missing parts of the INFO struct using a number of
-     sources: "set ..."; INFOabfd supplied; and the global
-     defaults.  */
-  gdbarch_info_fill (&info);
-
-  /* Must have found some sort of architecture.  */
-  gdb_assert (info.bfd_arch_info != NULL);
-
-  if (gdbarch_debug)
-    {
-      fprintf_unfiltered (gdb_stdlog,
-			  "gdbarch_find_by_info: info.bfd_arch_info %s\n",
-			  (info.bfd_arch_info != NULL
-			   ? info.bfd_arch_info->printable_name
-			   : "(null)"));
-      fprintf_unfiltered (gdb_stdlog,
-			  "gdbarch_find_by_info: info.byte_order %d (%s)\n",
-			  info.byte_order,
-			  (info.byte_order == BFD_ENDIAN_BIG ? "big"
-			   : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
-			   : "default"));
-      fprintf_unfiltered (gdb_stdlog,
-			  "gdbarch_find_by_info: info.osabi %d (%s)\n",
-			  info.osabi, gdbarch_osabi_name (info.osabi));
-      fprintf_unfiltered (gdb_stdlog,
-			  "gdbarch_find_by_info: info.abfd %s\n",
-			  host_address_to_string (info.abfd));
-    }
-
-  /* Find the tdep code that knows about this architecture.  */
-  for (rego = gdbarch_registry;
-       rego != NULL;
-       rego = rego->next)
-    if (rego->bfd_architecture == info.bfd_arch_info->arch)
-      break;
-  if (rego == NULL)
-    {
-      if (gdbarch_debug)
-	fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
-			    "No matching architecture\n");
-      return 0;
-    }
-
-  /* Ask the tdep code for an architecture that matches "info".  */
-  new_gdbarch = rego->init (info, rego->arches);
-
-  /* Did the tdep code like it?  No.  Reject the change and revert to
-     the old architecture.  */
-  if (new_gdbarch == NULL)
-    {
-      if (gdbarch_debug)
-	fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
-			    "Target rejected architecture\n");
-      return NULL;
-    }
-
-  /* Is this a pre-existing architecture (as determined by already
-     being initialized)?  Move it to the front of the architecture
-     list (keeping the list sorted Most Recently Used).  */
-  if (new_gdbarch->initialized_p)
-    {
-      struct gdbarch_list **list;
-      struct gdbarch_list *self;
-      if (gdbarch_debug)
-	fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
-			    "Previous architecture %s (%s) selected\n",
-			    host_address_to_string (new_gdbarch),
-			    new_gdbarch->bfd_arch_info->printable_name);
-      /* Find the existing arch in the list.  */
-      for (list = &rego->arches;
-	   (*list) != NULL && (*list)->gdbarch != new_gdbarch;
-	   list = &(*list)->next);
-      /* It had better be in the list of architectures.  */
-      gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
-      /* Unlink SELF.  */
-      self = (*list);
-      (*list) = self->next;
-      /* Insert SELF at the front.  */
-      self->next = rego->arches;
-      rego->arches = self;
-      /* Return it.  */
-      return new_gdbarch;
-    }
-
-  /* It's a new architecture.  */
-  if (gdbarch_debug)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
-			"New architecture %s (%s) selected\n",
-			host_address_to_string (new_gdbarch),
-			new_gdbarch->bfd_arch_info->printable_name);
-  
-  /* Insert the new architecture into the front of the architecture
-     list (keep the list sorted Most Recently Used).  */
-  {
-    struct gdbarch_list *self = XNEW (struct gdbarch_list);
-    self->next = rego->arches;
-    self->gdbarch = new_gdbarch;
-    rego->arches = self;
-  }    
-
-  /* Check that the newly installed architecture is valid.  Plug in
-     any post init values.  */
-  new_gdbarch->dump_tdep = rego->dump_tdep;
-  verify_gdbarch (new_gdbarch);
-  new_gdbarch->initialized_p = 1;
-
-  if (gdbarch_debug)
-    gdbarch_dump (new_gdbarch, gdb_stdlog);
-
-  return new_gdbarch;
-}
-
-/* Make the specified architecture current.  */
-
-void
-set_target_gdbarch (struct gdbarch *new_gdbarch)
-{
-  gdb_assert (new_gdbarch != NULL);
-  gdb_assert (new_gdbarch->initialized_p);
-  current_inferior ()->gdbarch = new_gdbarch;
-  gdb::observers::architecture_changed.notify (new_gdbarch);
-  registers_changed ();
-}
-
-/* Return the current inferior's arch.  */
-
-struct gdbarch *
-target_gdbarch (void)
-{
-  return current_inferior ()->gdbarch;
-}
-
-void _initialize_gdbarch ();
-void
-_initialize_gdbarch ()
-{
-  add_setshow_zuinteger_cmd ("arch", class_maintenance, &gdbarch_debug, _("\\
-Set architecture debugging."), _("\\
-Show architecture debugging."), _("\\
-When non-zero, architecture debugging is enabled."),
-			    NULL,
-			    show_gdbarch_debug,
-			    &setdebuglist, &showdebuglist);
-}
-EOF
-
 # close things off
 exec 1>&2
 ../move-if-change new-gdbarch.c gdbarch.c
-- 
2.31.1


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v2 2/8] Split gdbarch.h into two files
  2021-12-16 20:38 [PATCH v2 0/8] Rewrite gdbarch.sh in Python Tom Tromey
  2021-12-16 20:38 ` [PATCH v2 1/8] Move ordinary gdbarch code to arch-utils Tom Tromey
@ 2021-12-16 20:38 ` Tom Tromey
  2021-12-16 20:38 ` [PATCH v2 3/8] Do not generate gdbarch.h Tom Tromey
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 21+ messages in thread
From: Tom Tromey @ 2021-12-16 20:38 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This patch splits gdbarch.h into two files -- gdbarch.h now is
editable and hand-maintained, and the new gdbarch-gen.h file is the
only thing generated by gdbarch.sh.  This lets us avoid maintaining
boilerplate in the gdbarch.sh file.

Note that gdbarch.sh still generates gdbarch.h after this patch.  This
makes it easier to re-run when rebasing.  This code is removed in a
subsequent patch.
---
 gdb/gdbarch-gen.h | 1608 +++++++++++++++++++++++++++++++++++++++++++++
 gdb/gdbarch.h     | 1588 +-------------------------------------------
 gdb/gdbarch.sh    |  135 ++--
 3 files changed, 1681 insertions(+), 1650 deletions(-)
 create mode 100644 gdb/gdbarch-gen.h

diff --git a/gdb/gdbarch-gen.h b/gdb/gdbarch-gen.h
new file mode 100644
index 00000000000..3edf9708d06
--- /dev/null
+++ b/gdb/gdbarch-gen.h
@@ -0,0 +1,1608 @@
+/* *INDENT-OFF* */ /* THIS FILE IS GENERATED -*- buffer-read-only: t -*- */
+/* vi:set ro: */
+
+/* Dynamic architecture support for GDB, the GNU debugger.
+
+   Copyright (C) 1998-2021 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* This file was created with the aid of ``gdbarch.sh''.  */
+
+
+
+/* The following are pre-initialized by GDBARCH.  */
+
+extern const struct bfd_arch_info * gdbarch_bfd_arch_info (struct gdbarch *gdbarch);
+/* set_gdbarch_bfd_arch_info() - not applicable - pre-initialized.  */
+
+extern enum bfd_endian gdbarch_byte_order (struct gdbarch *gdbarch);
+/* set_gdbarch_byte_order() - not applicable - pre-initialized.  */
+
+extern enum bfd_endian gdbarch_byte_order_for_code (struct gdbarch *gdbarch);
+/* set_gdbarch_byte_order_for_code() - not applicable - pre-initialized.  */
+
+extern enum gdb_osabi gdbarch_osabi (struct gdbarch *gdbarch);
+/* set_gdbarch_osabi() - not applicable - pre-initialized.  */
+
+extern const struct target_desc * gdbarch_target_desc (struct gdbarch *gdbarch);
+/* set_gdbarch_target_desc() - not applicable - pre-initialized.  */
+
+
+/* The following are initialized by the target dependent code.  */
+
+/* Number of bits in a short or unsigned short for the target machine. */
+
+extern int gdbarch_short_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_short_bit (struct gdbarch *gdbarch, int short_bit);
+
+/* Number of bits in an int or unsigned int for the target machine. */
+
+extern int gdbarch_int_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_int_bit (struct gdbarch *gdbarch, int int_bit);
+
+/* Number of bits in a long or unsigned long for the target machine. */
+
+extern int gdbarch_long_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_long_bit (struct gdbarch *gdbarch, int long_bit);
+
+/* Number of bits in a long long or unsigned long long for the target
+   machine. */
+
+extern int gdbarch_long_long_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_long_long_bit (struct gdbarch *gdbarch, int long_long_bit);
+
+/* The ABI default bit-size and format for "bfloat16", "half", "float", "double", and
+   "long double".  These bit/format pairs should eventually be combined
+   into a single object.  For the moment, just initialize them as a pair.
+   Each format describes both the big and little endian layouts (if
+   useful). */
+
+extern int gdbarch_bfloat16_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_bfloat16_bit (struct gdbarch *gdbarch, int bfloat16_bit);
+
+extern const struct floatformat ** gdbarch_bfloat16_format (struct gdbarch *gdbarch);
+extern void set_gdbarch_bfloat16_format (struct gdbarch *gdbarch, const struct floatformat ** bfloat16_format);
+
+extern int gdbarch_half_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_half_bit (struct gdbarch *gdbarch, int half_bit);
+
+extern const struct floatformat ** gdbarch_half_format (struct gdbarch *gdbarch);
+extern void set_gdbarch_half_format (struct gdbarch *gdbarch, const struct floatformat ** half_format);
+
+extern int gdbarch_float_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_float_bit (struct gdbarch *gdbarch, int float_bit);
+
+extern const struct floatformat ** gdbarch_float_format (struct gdbarch *gdbarch);
+extern void set_gdbarch_float_format (struct gdbarch *gdbarch, const struct floatformat ** float_format);
+
+extern int gdbarch_double_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_double_bit (struct gdbarch *gdbarch, int double_bit);
+
+extern const struct floatformat ** gdbarch_double_format (struct gdbarch *gdbarch);
+extern void set_gdbarch_double_format (struct gdbarch *gdbarch, const struct floatformat ** double_format);
+
+extern int gdbarch_long_double_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_long_double_bit (struct gdbarch *gdbarch, int long_double_bit);
+
+extern const struct floatformat ** gdbarch_long_double_format (struct gdbarch *gdbarch);
+extern void set_gdbarch_long_double_format (struct gdbarch *gdbarch, const struct floatformat ** long_double_format);
+
+/* The ABI default bit-size for "wchar_t".  wchar_t is a built-in type
+   starting with C++11. */
+
+extern int gdbarch_wchar_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_wchar_bit (struct gdbarch *gdbarch, int wchar_bit);
+
+/* One if `wchar_t' is signed, zero if unsigned. */
+
+extern int gdbarch_wchar_signed (struct gdbarch *gdbarch);
+extern void set_gdbarch_wchar_signed (struct gdbarch *gdbarch, int wchar_signed);
+
+/* Returns the floating-point format to be used for values of length LENGTH.
+   NAME, if non-NULL, is the type name, which may be used to distinguish
+   different target formats of the same length. */
+
+typedef const struct floatformat ** (gdbarch_floatformat_for_type_ftype) (struct gdbarch *gdbarch, const char *name, int length);
+extern const struct floatformat ** gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, int length);
+extern void set_gdbarch_floatformat_for_type (struct gdbarch *gdbarch, gdbarch_floatformat_for_type_ftype *floatformat_for_type);
+
+/* For most targets, a pointer on the target and its representation as an
+   address in GDB have the same size and "look the same".  For such a
+   target, you need only set gdbarch_ptr_bit and gdbarch_addr_bit
+   / addr_bit will be set from it.
+  
+   If gdbarch_ptr_bit and gdbarch_addr_bit are different, you'll probably
+   also need to set gdbarch_dwarf2_addr_size, gdbarch_pointer_to_address and
+   gdbarch_address_to_pointer as well.
+  
+   ptr_bit is the size of a pointer on the target */
+
+extern int gdbarch_ptr_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_ptr_bit (struct gdbarch *gdbarch, int ptr_bit);
+
+/* addr_bit is the size of a target address as represented in gdb */
+
+extern int gdbarch_addr_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_addr_bit (struct gdbarch *gdbarch, int addr_bit);
+
+/* dwarf2_addr_size is the target address size as used in the Dwarf debug
+   info.  For .debug_frame FDEs, this is supposed to be the target address
+   size from the associated CU header, and which is equivalent to the
+   DWARF2_ADDR_SIZE as defined by the target specific GCC back-end.
+   Unfortunately there is no good way to determine this value.  Therefore
+   dwarf2_addr_size simply defaults to the target pointer size.
+  
+   dwarf2_addr_size is not used for .eh_frame FDEs, which are generally
+   defined using the target's pointer size so far.
+  
+   Note that dwarf2_addr_size only needs to be redefined by a target if the
+   GCC back-end defines a DWARF2_ADDR_SIZE other than the target pointer size,
+   and if Dwarf versions < 4 need to be supported. */
+
+extern int gdbarch_dwarf2_addr_size (struct gdbarch *gdbarch);
+extern void set_gdbarch_dwarf2_addr_size (struct gdbarch *gdbarch, int dwarf2_addr_size);
+
+/* One if `char' acts like `signed char', zero if `unsigned char'. */
+
+extern int gdbarch_char_signed (struct gdbarch *gdbarch);
+extern void set_gdbarch_char_signed (struct gdbarch *gdbarch, int char_signed);
+
+extern bool gdbarch_read_pc_p (struct gdbarch *gdbarch);
+
+typedef CORE_ADDR (gdbarch_read_pc_ftype) (readable_regcache *regcache);
+extern CORE_ADDR gdbarch_read_pc (struct gdbarch *gdbarch, readable_regcache *regcache);
+extern void set_gdbarch_read_pc (struct gdbarch *gdbarch, gdbarch_read_pc_ftype *read_pc);
+
+extern bool gdbarch_write_pc_p (struct gdbarch *gdbarch);
+
+typedef void (gdbarch_write_pc_ftype) (struct regcache *regcache, CORE_ADDR val);
+extern void gdbarch_write_pc (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR val);
+extern void set_gdbarch_write_pc (struct gdbarch *gdbarch, gdbarch_write_pc_ftype *write_pc);
+
+/* Function for getting target's idea of a frame pointer.  FIXME: GDB's
+   whole scheme for dealing with "frames" and "frame pointers" needs a
+   serious shakedown. */
+
+typedef void (gdbarch_virtual_frame_pointer_ftype) (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset);
+extern void gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset);
+extern void set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer);
+
+extern bool gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch);
+
+typedef enum register_status (gdbarch_pseudo_register_read_ftype) (struct gdbarch *gdbarch, readable_regcache *regcache, int cookednum, gdb_byte *buf);
+extern enum register_status gdbarch_pseudo_register_read (struct gdbarch *gdbarch, readable_regcache *regcache, int cookednum, gdb_byte *buf);
+extern void set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch, gdbarch_pseudo_register_read_ftype *pseudo_register_read);
+
+/* Read a register into a new struct value.  If the register is wholly
+   or partly unavailable, this should call mark_value_bytes_unavailable
+   as appropriate.  If this is defined, then pseudo_register_read will
+   never be called. */
+
+extern bool gdbarch_pseudo_register_read_value_p (struct gdbarch *gdbarch);
+
+typedef struct value * (gdbarch_pseudo_register_read_value_ftype) (struct gdbarch *gdbarch, readable_regcache *regcache, int cookednum);
+extern struct value * gdbarch_pseudo_register_read_value (struct gdbarch *gdbarch, readable_regcache *regcache, int cookednum);
+extern void set_gdbarch_pseudo_register_read_value (struct gdbarch *gdbarch, gdbarch_pseudo_register_read_value_ftype *pseudo_register_read_value);
+
+extern bool gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch);
+
+typedef void (gdbarch_pseudo_register_write_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf);
+extern void gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf);
+extern void set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch, gdbarch_pseudo_register_write_ftype *pseudo_register_write);
+
+extern int gdbarch_num_regs (struct gdbarch *gdbarch);
+extern void set_gdbarch_num_regs (struct gdbarch *gdbarch, int num_regs);
+
+/* This macro gives the number of pseudo-registers that live in the
+   register namespace but do not get fetched or stored on the target.
+   These pseudo-registers may be aliases for other registers,
+   combinations of other registers, or they may be computed by GDB. */
+
+extern int gdbarch_num_pseudo_regs (struct gdbarch *gdbarch);
+extern void set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, int num_pseudo_regs);
+
+/* Assemble agent expression bytecode to collect pseudo-register REG.
+   Return -1 if something goes wrong, 0 otherwise. */
+
+extern bool gdbarch_ax_pseudo_register_collect_p (struct gdbarch *gdbarch);
+
+typedef int (gdbarch_ax_pseudo_register_collect_ftype) (struct gdbarch *gdbarch, struct agent_expr *ax, int reg);
+extern int gdbarch_ax_pseudo_register_collect (struct gdbarch *gdbarch, struct agent_expr *ax, int reg);
+extern void set_gdbarch_ax_pseudo_register_collect (struct gdbarch *gdbarch, gdbarch_ax_pseudo_register_collect_ftype *ax_pseudo_register_collect);
+
+/* Assemble agent expression bytecode to push the value of pseudo-register
+   REG on the interpreter stack.
+   Return -1 if something goes wrong, 0 otherwise. */
+
+extern bool gdbarch_ax_pseudo_register_push_stack_p (struct gdbarch *gdbarch);
+
+typedef int (gdbarch_ax_pseudo_register_push_stack_ftype) (struct gdbarch *gdbarch, struct agent_expr *ax, int reg);
+extern int gdbarch_ax_pseudo_register_push_stack (struct gdbarch *gdbarch, struct agent_expr *ax, int reg);
+extern void set_gdbarch_ax_pseudo_register_push_stack (struct gdbarch *gdbarch, gdbarch_ax_pseudo_register_push_stack_ftype *ax_pseudo_register_push_stack);
+
+/* Some architectures can display additional information for specific
+   signals.
+   UIOUT is the output stream where the handler will place information. */
+
+extern bool gdbarch_report_signal_info_p (struct gdbarch *gdbarch);
+
+typedef void (gdbarch_report_signal_info_ftype) (struct gdbarch *gdbarch, struct ui_out *uiout, enum gdb_signal siggnal);
+extern void gdbarch_report_signal_info (struct gdbarch *gdbarch, struct ui_out *uiout, enum gdb_signal siggnal);
+extern void set_gdbarch_report_signal_info (struct gdbarch *gdbarch, gdbarch_report_signal_info_ftype *report_signal_info);
+
+/* GDB's standard (or well known) register numbers.  These can map onto
+   a real register or a pseudo (computed) register or not be defined at
+   all (-1).
+   gdbarch_sp_regnum will hopefully be replaced by UNWIND_SP. */
+
+extern int gdbarch_sp_regnum (struct gdbarch *gdbarch);
+extern void set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int sp_regnum);
+
+extern int gdbarch_pc_regnum (struct gdbarch *gdbarch);
+extern void set_gdbarch_pc_regnum (struct gdbarch *gdbarch, int pc_regnum);
+
+extern int gdbarch_ps_regnum (struct gdbarch *gdbarch);
+extern void set_gdbarch_ps_regnum (struct gdbarch *gdbarch, int ps_regnum);
+
+extern int gdbarch_fp0_regnum (struct gdbarch *gdbarch);
+extern void set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, int fp0_regnum);
+
+/* Convert stab register number (from `r' declaration) to a gdb REGNUM. */
+
+typedef int (gdbarch_stab_reg_to_regnum_ftype) (struct gdbarch *gdbarch, int stab_regnr);
+extern int gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr);
+extern void set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum);
+
+/* Provide a default mapping from a ecoff register number to a gdb REGNUM. */
+
+typedef int (gdbarch_ecoff_reg_to_regnum_ftype) (struct gdbarch *gdbarch, int ecoff_regnr);
+extern int gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr);
+extern void set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum);
+
+/* Convert from an sdb register number to an internal gdb register number. */
+
+typedef int (gdbarch_sdb_reg_to_regnum_ftype) (struct gdbarch *gdbarch, int sdb_regnr);
+extern int gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr);
+extern void set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum);
+
+/* Provide a default mapping from a DWARF2 register number to a gdb REGNUM.
+   Return -1 for bad REGNUM.  Note: Several targets get this wrong. */
+
+typedef int (gdbarch_dwarf2_reg_to_regnum_ftype) (struct gdbarch *gdbarch, int dwarf2_regnr);
+extern int gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr);
+extern void set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum);
+
+typedef const char * (gdbarch_register_name_ftype) (struct gdbarch *gdbarch, int regnr);
+extern const char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr);
+extern void set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name);
+
+/* Return the type of a register specified by the architecture.  Only
+   the register cache should call this function directly; others should
+   use "register_type". */
+
+extern bool gdbarch_register_type_p (struct gdbarch *gdbarch);
+
+typedef struct type * (gdbarch_register_type_ftype) (struct gdbarch *gdbarch, int reg_nr);
+extern struct type * gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr);
+extern void set_gdbarch_register_type (struct gdbarch *gdbarch, gdbarch_register_type_ftype *register_type);
+
+/* Generate a dummy frame_id for THIS_FRAME assuming that the frame is
+   a dummy frame.  A dummy frame is created before an inferior call,
+   the frame_id returned here must match the frame_id that was built
+   for the inferior call.  Usually this means the returned frame_id's
+   stack address should match the address returned by
+   gdbarch_push_dummy_call, and the returned frame_id's code address
+   should match the address at which the breakpoint was set in the dummy
+   frame. */
+
+typedef struct frame_id (gdbarch_dummy_id_ftype) (struct gdbarch *gdbarch, struct frame_info *this_frame);
+extern struct frame_id gdbarch_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame);
+extern void set_gdbarch_dummy_id (struct gdbarch *gdbarch, gdbarch_dummy_id_ftype *dummy_id);
+
+/* Implement DUMMY_ID and PUSH_DUMMY_CALL, then delete
+   deprecated_fp_regnum. */
+
+extern int gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch);
+extern void set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch, int deprecated_fp_regnum);
+
+extern bool gdbarch_push_dummy_call_p (struct gdbarch *gdbarch);
+
+typedef CORE_ADDR (gdbarch_push_dummy_call_ftype) (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, function_call_return_method return_method, CORE_ADDR struct_addr);
+extern CORE_ADDR gdbarch_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, function_call_return_method return_method, CORE_ADDR struct_addr);
+extern void set_gdbarch_push_dummy_call (struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype *push_dummy_call);
+
+extern int gdbarch_call_dummy_location (struct gdbarch *gdbarch);
+extern void set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, int call_dummy_location);
+
+extern bool gdbarch_push_dummy_code_p (struct gdbarch *gdbarch);
+
+typedef CORE_ADDR (gdbarch_push_dummy_code_ftype) (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache);
+extern CORE_ADDR gdbarch_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache);
+extern void set_gdbarch_push_dummy_code (struct gdbarch *gdbarch, gdbarch_push_dummy_code_ftype *push_dummy_code);
+
+/* Return true if the code of FRAME is writable. */
+
+typedef int (gdbarch_code_of_frame_writable_ftype) (struct gdbarch *gdbarch, struct frame_info *frame);
+extern int gdbarch_code_of_frame_writable (struct gdbarch *gdbarch, struct frame_info *frame);
+extern void set_gdbarch_code_of_frame_writable (struct gdbarch *gdbarch, gdbarch_code_of_frame_writable_ftype *code_of_frame_writable);
+
+typedef void (gdbarch_print_registers_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all);
+extern void gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all);
+extern void set_gdbarch_print_registers_info (struct gdbarch *gdbarch, gdbarch_print_registers_info_ftype *print_registers_info);
+
+typedef void (gdbarch_print_float_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
+extern void gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
+extern void set_gdbarch_print_float_info (struct gdbarch *gdbarch, gdbarch_print_float_info_ftype *print_float_info);
+
+extern bool gdbarch_print_vector_info_p (struct gdbarch *gdbarch);
+
+typedef void (gdbarch_print_vector_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
+extern void gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
+extern void set_gdbarch_print_vector_info (struct gdbarch *gdbarch, gdbarch_print_vector_info_ftype *print_vector_info);
+
+/* MAP a GDB RAW register number onto a simulator register number.  See
+   also include/...-sim.h. */
+
+typedef int (gdbarch_register_sim_regno_ftype) (struct gdbarch *gdbarch, int reg_nr);
+extern int gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr);
+extern void set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, gdbarch_register_sim_regno_ftype *register_sim_regno);
+
+typedef int (gdbarch_cannot_fetch_register_ftype) (struct gdbarch *gdbarch, int regnum);
+extern int gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum);
+extern void set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, gdbarch_cannot_fetch_register_ftype *cannot_fetch_register);
+
+typedef int (gdbarch_cannot_store_register_ftype) (struct gdbarch *gdbarch, int regnum);
+extern int gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum);
+extern void set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, gdbarch_cannot_store_register_ftype *cannot_store_register);
+
+/* Determine the address where a longjmp will land and save this address
+   in PC.  Return nonzero on success.
+  
+   FRAME corresponds to the longjmp frame. */
+
+extern bool gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch);
+
+typedef int (gdbarch_get_longjmp_target_ftype) (struct frame_info *frame, CORE_ADDR *pc);
+extern int gdbarch_get_longjmp_target (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR *pc);
+extern void set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch, gdbarch_get_longjmp_target_ftype *get_longjmp_target);
+
+extern int gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch);
+extern void set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, int believe_pcc_promotion);
+
+typedef int (gdbarch_convert_register_p_ftype) (struct gdbarch *gdbarch, int regnum, struct type *type);
+extern int gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type);
+extern void set_gdbarch_convert_register_p (struct gdbarch *gdbarch, gdbarch_convert_register_p_ftype *convert_register_p);
+
+typedef int (gdbarch_register_to_value_ftype) (struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf, int *optimizedp, int *unavailablep);
+extern int gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf, int *optimizedp, int *unavailablep);
+extern void set_gdbarch_register_to_value (struct gdbarch *gdbarch, gdbarch_register_to_value_ftype *register_to_value);
+
+typedef void (gdbarch_value_to_register_ftype) (struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf);
+extern void gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf);
+extern void set_gdbarch_value_to_register (struct gdbarch *gdbarch, gdbarch_value_to_register_ftype *value_to_register);
+
+/* Construct a value representing the contents of register REGNUM in
+   frame FRAME_ID, interpreted as type TYPE.  The routine needs to
+   allocate and return a struct value with all value attributes
+   (but not the value contents) filled in. */
+
+typedef struct value * (gdbarch_value_from_register_ftype) (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_id frame_id);
+extern struct value * gdbarch_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_id frame_id);
+extern void set_gdbarch_value_from_register (struct gdbarch *gdbarch, gdbarch_value_from_register_ftype *value_from_register);
+
+typedef CORE_ADDR (gdbarch_pointer_to_address_ftype) (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf);
+extern CORE_ADDR gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf);
+extern void set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, gdbarch_pointer_to_address_ftype *pointer_to_address);
+
+typedef void (gdbarch_address_to_pointer_ftype) (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr);
+extern void gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr);
+extern void set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, gdbarch_address_to_pointer_ftype *address_to_pointer);
+
+extern bool gdbarch_integer_to_address_p (struct gdbarch *gdbarch);
+
+typedef CORE_ADDR (gdbarch_integer_to_address_ftype) (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf);
+extern CORE_ADDR gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf);
+extern void set_gdbarch_integer_to_address (struct gdbarch *gdbarch, gdbarch_integer_to_address_ftype *integer_to_address);
+
+/* Return the return-value convention that will be used by FUNCTION
+   to return a value of type VALTYPE.  FUNCTION may be NULL in which
+   case the return convention is computed based only on VALTYPE.
+  
+   If READBUF is not NULL, extract the return value and save it in this buffer.
+  
+   If WRITEBUF is not NULL, it contains a return value which will be
+   stored into the appropriate register.  This can be used when we want
+   to force the value returned by a function (see the "return" command
+   for instance). */
+
+extern bool gdbarch_return_value_p (struct gdbarch *gdbarch);
+
+typedef enum return_value_convention (gdbarch_return_value_ftype) (struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf);
+extern enum return_value_convention gdbarch_return_value (struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf);
+extern void set_gdbarch_return_value (struct gdbarch *gdbarch, gdbarch_return_value_ftype *return_value);
+
+/* Return true if the return value of function is stored in the first hidden
+   parameter.  In theory, this feature should be language-dependent, specified
+   by language and its ABI, such as C++.  Unfortunately, compiler may
+   implement it to a target-dependent feature.  So that we need such hook here
+   to be aware of this in GDB. */
+
+typedef int (gdbarch_return_in_first_hidden_param_p_ftype) (struct gdbarch *gdbarch, struct type *type);
+extern int gdbarch_return_in_first_hidden_param_p (struct gdbarch *gdbarch, struct type *type);
+extern void set_gdbarch_return_in_first_hidden_param_p (struct gdbarch *gdbarch, gdbarch_return_in_first_hidden_param_p_ftype *return_in_first_hidden_param_p);
+
+typedef CORE_ADDR (gdbarch_skip_prologue_ftype) (struct gdbarch *gdbarch, CORE_ADDR ip);
+extern CORE_ADDR gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip);
+extern void set_gdbarch_skip_prologue (struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype *skip_prologue);
+
+extern bool gdbarch_skip_main_prologue_p (struct gdbarch *gdbarch);
+
+typedef CORE_ADDR (gdbarch_skip_main_prologue_ftype) (struct gdbarch *gdbarch, CORE_ADDR ip);
+extern CORE_ADDR gdbarch_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR ip);
+extern void set_gdbarch_skip_main_prologue (struct gdbarch *gdbarch, gdbarch_skip_main_prologue_ftype *skip_main_prologue);
+
+/* On some platforms, a single function may provide multiple entry points,
+   e.g. one that is used for function-pointer calls and a different one
+   that is used for direct function calls.
+   In order to ensure that breakpoints set on the function will trigger
+   no matter via which entry point the function is entered, a platform
+   may provide the skip_entrypoint callback.  It is called with IP set
+   to the main entry point of a function (as determined by the symbol table),
+   and should return the address of the innermost entry point, where the
+   actual breakpoint needs to be set.  Note that skip_entrypoint is used
+   by GDB common code even when debugging optimized code, where skip_prologue
+   is not used. */
+
+extern bool gdbarch_skip_entrypoint_p (struct gdbarch *gdbarch);
+
+typedef CORE_ADDR (gdbarch_skip_entrypoint_ftype) (struct gdbarch *gdbarch, CORE_ADDR ip);
+extern CORE_ADDR gdbarch_skip_entrypoint (struct gdbarch *gdbarch, CORE_ADDR ip);
+extern void set_gdbarch_skip_entrypoint (struct gdbarch *gdbarch, gdbarch_skip_entrypoint_ftype *skip_entrypoint);
+
+typedef int (gdbarch_inner_than_ftype) (CORE_ADDR lhs, CORE_ADDR rhs);
+extern int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs);
+extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than);
+
+typedef const gdb_byte * (gdbarch_breakpoint_from_pc_ftype) (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr);
+extern const gdb_byte * gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr);
+extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc);
+
+/* Return the breakpoint kind for this target based on *PCPTR. */
+
+typedef int (gdbarch_breakpoint_kind_from_pc_ftype) (struct gdbarch *gdbarch, CORE_ADDR *pcptr);
+extern int gdbarch_breakpoint_kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr);
+extern void set_gdbarch_breakpoint_kind_from_pc (struct gdbarch *gdbarch, gdbarch_breakpoint_kind_from_pc_ftype *breakpoint_kind_from_pc);
+
+/* Return the software breakpoint from KIND.  KIND can have target
+   specific meaning like the Z0 kind parameter.
+   SIZE is set to the software breakpoint's length in memory. */
+
+typedef const gdb_byte * (gdbarch_sw_breakpoint_from_kind_ftype) (struct gdbarch *gdbarch, int kind, int *size);
+extern const gdb_byte * gdbarch_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size);
+extern void set_gdbarch_sw_breakpoint_from_kind (struct gdbarch *gdbarch, gdbarch_sw_breakpoint_from_kind_ftype *sw_breakpoint_from_kind);
+
+/* Return the breakpoint kind for this target based on the current
+   processor state (e.g. the current instruction mode on ARM) and the
+   *PCPTR.  In default, it is gdbarch->breakpoint_kind_from_pc. */
+
+typedef int (gdbarch_breakpoint_kind_from_current_state_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR *pcptr);
+extern int gdbarch_breakpoint_kind_from_current_state (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR *pcptr);
+extern void set_gdbarch_breakpoint_kind_from_current_state (struct gdbarch *gdbarch, gdbarch_breakpoint_kind_from_current_state_ftype *breakpoint_kind_from_current_state);
+
+extern bool gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch);
+
+typedef CORE_ADDR (gdbarch_adjust_breakpoint_address_ftype) (struct gdbarch *gdbarch, CORE_ADDR bpaddr);
+extern CORE_ADDR gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr);
+extern void set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address);
+
+typedef int (gdbarch_memory_insert_breakpoint_ftype) (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt);
+extern int gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt);
+extern void set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint);
+
+typedef int (gdbarch_memory_remove_breakpoint_ftype) (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt);
+extern int gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt);
+extern void set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint);
+
+extern CORE_ADDR gdbarch_decr_pc_after_break (struct gdbarch *gdbarch);
+extern void set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, CORE_ADDR decr_pc_after_break);
+
+/* A function can be addressed by either it's "pointer" (possibly a
+   descriptor address) or "entry point" (first executable instruction).
+   The method "convert_from_func_ptr_addr" converting the former to the
+   latter.  gdbarch_deprecated_function_start_offset is being used to implement
+   a simplified subset of that functionality - the function's address
+   corresponds to the "function pointer" and the function's start
+   corresponds to the "function entry point" - and hence is redundant. */
+
+extern CORE_ADDR gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch);
+extern void set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch, CORE_ADDR deprecated_function_start_offset);
+
+/* Return the remote protocol register number associated with this
+   register.  Normally the identity mapping. */
+
+typedef int (gdbarch_remote_register_number_ftype) (struct gdbarch *gdbarch, int regno);
+extern int gdbarch_remote_register_number (struct gdbarch *gdbarch, int regno);
+extern void set_gdbarch_remote_register_number (struct gdbarch *gdbarch, gdbarch_remote_register_number_ftype *remote_register_number);
+
+/* Fetch the target specific address used to represent a load module. */
+
+extern bool gdbarch_fetch_tls_load_module_address_p (struct gdbarch *gdbarch);
+
+typedef CORE_ADDR (gdbarch_fetch_tls_load_module_address_ftype) (struct objfile *objfile);
+extern CORE_ADDR gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, struct objfile *objfile);
+extern void set_gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, gdbarch_fetch_tls_load_module_address_ftype *fetch_tls_load_module_address);
+
+/* Return the thread-local address at OFFSET in the thread-local
+   storage for the thread PTID and the shared library or executable
+   file given by LM_ADDR.  If that block of thread-local storage hasn't
+   been allocated yet, this function may throw an error.  LM_ADDR may
+   be zero for statically linked multithreaded inferiors. */
+
+extern bool gdbarch_get_thread_local_address_p (struct gdbarch *gdbarch);
+
+typedef CORE_ADDR (gdbarch_get_thread_local_address_ftype) (struct gdbarch *gdbarch, ptid_t ptid, CORE_ADDR lm_addr, CORE_ADDR offset);
+extern CORE_ADDR gdbarch_get_thread_local_address (struct gdbarch *gdbarch, ptid_t ptid, CORE_ADDR lm_addr, CORE_ADDR offset);
+extern void set_gdbarch_get_thread_local_address (struct gdbarch *gdbarch, gdbarch_get_thread_local_address_ftype *get_thread_local_address);
+
+extern CORE_ADDR gdbarch_frame_args_skip (struct gdbarch *gdbarch);
+extern void set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, CORE_ADDR frame_args_skip);
+
+typedef CORE_ADDR (gdbarch_unwind_pc_ftype) (struct gdbarch *gdbarch, struct frame_info *next_frame);
+extern CORE_ADDR gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame);
+extern void set_gdbarch_unwind_pc (struct gdbarch *gdbarch, gdbarch_unwind_pc_ftype *unwind_pc);
+
+typedef CORE_ADDR (gdbarch_unwind_sp_ftype) (struct gdbarch *gdbarch, struct frame_info *next_frame);
+extern CORE_ADDR gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame);
+extern void set_gdbarch_unwind_sp (struct gdbarch *gdbarch, gdbarch_unwind_sp_ftype *unwind_sp);
+
+/* DEPRECATED_FRAME_LOCALS_ADDRESS as been replaced by the per-frame
+   frame-base.  Enable frame-base before frame-unwind. */
+
+extern bool gdbarch_frame_num_args_p (struct gdbarch *gdbarch);
+
+typedef int (gdbarch_frame_num_args_ftype) (struct frame_info *frame);
+extern int gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame);
+extern void set_gdbarch_frame_num_args (struct gdbarch *gdbarch, gdbarch_frame_num_args_ftype *frame_num_args);
+
+extern bool gdbarch_frame_align_p (struct gdbarch *gdbarch);
+
+typedef CORE_ADDR (gdbarch_frame_align_ftype) (struct gdbarch *gdbarch, CORE_ADDR address);
+extern CORE_ADDR gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address);
+extern void set_gdbarch_frame_align (struct gdbarch *gdbarch, gdbarch_frame_align_ftype *frame_align);
+
+typedef int (gdbarch_stabs_argument_has_addr_ftype) (struct gdbarch *gdbarch, struct type *type);
+extern int gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type);
+extern void set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr);
+
+extern int gdbarch_frame_red_zone_size (struct gdbarch *gdbarch);
+extern void set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch, int frame_red_zone_size);
+
+typedef CORE_ADDR (gdbarch_convert_from_func_ptr_addr_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ);
+extern CORE_ADDR gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ);
+extern void set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr);
+
+/* On some machines there are bits in addresses which are not really
+   part of the address, but are used by the kernel, the hardware, etc.
+   for special purposes.  gdbarch_addr_bits_remove takes out any such bits so
+   we get a "real" address such as one would find in a symbol table.
+   This is used only for addresses of instructions, and even then I'm
+   not sure it's used in all contexts.  It exists to deal with there
+   being a few stray bits in the PC which would mislead us, not as some
+   sort of generic thing to handle alignment or segmentation (it's
+   possible it should be in TARGET_READ_PC instead). */
+
+typedef CORE_ADDR (gdbarch_addr_bits_remove_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern CORE_ADDR gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern void set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, gdbarch_addr_bits_remove_ftype *addr_bits_remove);
+
+/* On some machines, not all bits of an address word are significant.
+   For example, on AArch64, the top bits of an address known as the "tag"
+   are ignored by the kernel, the hardware, etc. and can be regarded as
+   additional data associated with the address. */
+
+extern int gdbarch_significant_addr_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_significant_addr_bit (struct gdbarch *gdbarch, int significant_addr_bit);
+
+/* Return a string representation of the memory tag TAG. */
+
+typedef std::string (gdbarch_memtag_to_string_ftype) (struct gdbarch *gdbarch, struct value *tag);
+extern std::string gdbarch_memtag_to_string (struct gdbarch *gdbarch, struct value *tag);
+extern void set_gdbarch_memtag_to_string (struct gdbarch *gdbarch, gdbarch_memtag_to_string_ftype *memtag_to_string);
+
+/* Return true if ADDRESS contains a tag and false otherwise.  ADDRESS
+   must be either a pointer or a reference type. */
+
+typedef bool (gdbarch_tagged_address_p_ftype) (struct gdbarch *gdbarch, struct value *address);
+extern bool gdbarch_tagged_address_p (struct gdbarch *gdbarch, struct value *address);
+extern void set_gdbarch_tagged_address_p (struct gdbarch *gdbarch, gdbarch_tagged_address_p_ftype *tagged_address_p);
+
+/* Return true if the tag from ADDRESS matches the memory tag for that
+   particular address.  Return false otherwise. */
+
+typedef bool (gdbarch_memtag_matches_p_ftype) (struct gdbarch *gdbarch, struct value *address);
+extern bool gdbarch_memtag_matches_p (struct gdbarch *gdbarch, struct value *address);
+extern void set_gdbarch_memtag_matches_p (struct gdbarch *gdbarch, gdbarch_memtag_matches_p_ftype *memtag_matches_p);
+
+/* Set the tags of type TAG_TYPE, for the memory address range
+   [ADDRESS, ADDRESS + LENGTH) to TAGS.
+   Return true if successful and false otherwise. */
+
+typedef bool (gdbarch_set_memtags_ftype) (struct gdbarch *gdbarch, struct value *address, size_t length, const gdb::byte_vector &tags, memtag_type tag_type);
+extern bool gdbarch_set_memtags (struct gdbarch *gdbarch, struct value *address, size_t length, const gdb::byte_vector &tags, memtag_type tag_type);
+extern void set_gdbarch_set_memtags (struct gdbarch *gdbarch, gdbarch_set_memtags_ftype *set_memtags);
+
+/* Return the tag of type TAG_TYPE associated with the memory address ADDRESS,
+   assuming ADDRESS is tagged. */
+
+typedef struct value * (gdbarch_get_memtag_ftype) (struct gdbarch *gdbarch, struct value *address, memtag_type tag_type);
+extern struct value * gdbarch_get_memtag (struct gdbarch *gdbarch, struct value *address, memtag_type tag_type);
+extern void set_gdbarch_get_memtag (struct gdbarch *gdbarch, gdbarch_get_memtag_ftype *get_memtag);
+
+/* memtag_granule_size is the size of the allocation tag granule, for
+   architectures that support memory tagging.
+   This is 0 for architectures that do not support memory tagging.
+   For a non-zero value, this represents the number of bytes of memory per tag. */
+
+extern CORE_ADDR gdbarch_memtag_granule_size (struct gdbarch *gdbarch);
+extern void set_gdbarch_memtag_granule_size (struct gdbarch *gdbarch, CORE_ADDR memtag_granule_size);
+
+/* FIXME/cagney/2001-01-18: This should be split in two.  A target method that
+   indicates if the target needs software single step.  An ISA method to
+   implement it.
+  
+   FIXME/cagney/2001-01-18: The logic is backwards.  It should be asking if the
+   target can single step.  If not, then implement single step using breakpoints.
+  
+   Return a vector of addresses on which the software single step
+   breakpoints should be inserted.  NULL means software single step is
+   not used.
+   Multiple breakpoints may be inserted for some instructions such as
+   conditional branch.  However, each implementation must always evaluate
+   the condition and only put the breakpoint at the branch destination if
+   the condition is true, so that we ensure forward progress when stepping
+   past a conditional branch to self. */
+
+extern bool gdbarch_software_single_step_p (struct gdbarch *gdbarch);
+
+typedef std::vector<CORE_ADDR> (gdbarch_software_single_step_ftype) (struct regcache *regcache);
+extern std::vector<CORE_ADDR> gdbarch_software_single_step (struct gdbarch *gdbarch, struct regcache *regcache);
+extern void set_gdbarch_software_single_step (struct gdbarch *gdbarch, gdbarch_software_single_step_ftype *software_single_step);
+
+/* Return non-zero if the processor is executing a delay slot and a
+   further single-step is needed before the instruction finishes. */
+
+extern bool gdbarch_single_step_through_delay_p (struct gdbarch *gdbarch);
+
+typedef int (gdbarch_single_step_through_delay_ftype) (struct gdbarch *gdbarch, struct frame_info *frame);
+extern int gdbarch_single_step_through_delay (struct gdbarch *gdbarch, struct frame_info *frame);
+extern void set_gdbarch_single_step_through_delay (struct gdbarch *gdbarch, gdbarch_single_step_through_delay_ftype *single_step_through_delay);
+
+/* FIXME: cagney/2003-08-28: Need to find a better way of selecting the
+   disassembler.  Perhaps objdump can handle it? */
+
+typedef int (gdbarch_print_insn_ftype) (bfd_vma vma, struct disassemble_info *info);
+extern int gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info);
+extern void set_gdbarch_print_insn (struct gdbarch *gdbarch, gdbarch_print_insn_ftype *print_insn);
+
+typedef CORE_ADDR (gdbarch_skip_trampoline_code_ftype) (struct frame_info *frame, CORE_ADDR pc);
+extern CORE_ADDR gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR pc);
+extern void set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, gdbarch_skip_trampoline_code_ftype *skip_trampoline_code);
+
+/* If in_solib_dynsym_resolve_code() returns true, and SKIP_SOLIB_RESOLVER
+   evaluates non-zero, this is the address where the debugger will place
+   a step-resume breakpoint to get us past the dynamic linker. */
+
+typedef CORE_ADDR (gdbarch_skip_solib_resolver_ftype) (struct gdbarch *gdbarch, CORE_ADDR pc);
+extern CORE_ADDR gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc);
+extern void set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, gdbarch_skip_solib_resolver_ftype *skip_solib_resolver);
+
+/* Some systems also have trampoline code for returning from shared libs. */
+
+typedef int (gdbarch_in_solib_return_trampoline_ftype) (struct gdbarch *gdbarch, CORE_ADDR pc, const char *name);
+extern int gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, const char *name);
+extern void set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline);
+
+/* Return true if PC lies inside an indirect branch thunk. */
+
+typedef bool (gdbarch_in_indirect_branch_thunk_ftype) (struct gdbarch *gdbarch, CORE_ADDR pc);
+extern bool gdbarch_in_indirect_branch_thunk (struct gdbarch *gdbarch, CORE_ADDR pc);
+extern void set_gdbarch_in_indirect_branch_thunk (struct gdbarch *gdbarch, gdbarch_in_indirect_branch_thunk_ftype *in_indirect_branch_thunk);
+
+/* A target might have problems with watchpoints as soon as the stack
+   frame of the current function has been destroyed.  This mostly happens
+   as the first action in a function's epilogue.  stack_frame_destroyed_p()
+   is defined to return a non-zero value if either the given addr is one
+   instruction after the stack destroying instruction up to the trailing
+   return instruction or if we can figure out that the stack frame has
+   already been invalidated regardless of the value of addr.  Targets
+   which don't suffer from that problem could just let this functionality
+   untouched. */
+
+typedef int (gdbarch_stack_frame_destroyed_p_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern int gdbarch_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern void set_gdbarch_stack_frame_destroyed_p (struct gdbarch *gdbarch, gdbarch_stack_frame_destroyed_p_ftype *stack_frame_destroyed_p);
+
+/* Process an ELF symbol in the minimal symbol table in a backend-specific
+   way.  Normally this hook is supposed to do nothing, however if required,
+   then this hook can be used to apply tranformations to symbols that are
+   considered special in some way.  For example the MIPS backend uses it
+   to interpret `st_other' information to mark compressed code symbols so
+   that they can be treated in the appropriate manner in the processing of
+   the main symbol table and DWARF-2 records. */
+
+extern bool gdbarch_elf_make_msymbol_special_p (struct gdbarch *gdbarch);
+
+typedef void (gdbarch_elf_make_msymbol_special_ftype) (asymbol *sym, struct minimal_symbol *msym);
+extern void gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym);
+extern void set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special);
+
+typedef void (gdbarch_coff_make_msymbol_special_ftype) (int val, struct minimal_symbol *msym);
+extern void gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym);
+extern void set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special);
+
+/* Process a symbol in the main symbol table in a backend-specific way.
+   Normally this hook is supposed to do nothing, however if required,
+   then this hook can be used to apply tranformations to symbols that
+   are considered special in some way.  This is currently used by the
+   MIPS backend to make sure compressed code symbols have the ISA bit
+   set.  This in turn is needed for symbol values seen in GDB to match
+   the values used at the runtime by the program itself, for function
+   and label references. */
+
+typedef void (gdbarch_make_symbol_special_ftype) (struct symbol *sym, struct objfile *objfile);
+extern void gdbarch_make_symbol_special (struct gdbarch *gdbarch, struct symbol *sym, struct objfile *objfile);
+extern void set_gdbarch_make_symbol_special (struct gdbarch *gdbarch, gdbarch_make_symbol_special_ftype *make_symbol_special);
+
+/* Adjust the address retrieved from a DWARF-2 record other than a line
+   entry in a backend-specific way.  Normally this hook is supposed to
+   return the address passed unchanged, however if that is incorrect for
+   any reason, then this hook can be used to fix the address up in the
+   required manner.  This is currently used by the MIPS backend to make
+   sure addresses in FDE, range records, etc. referring to compressed
+   code have the ISA bit set, matching line information and the symbol
+   table. */
+
+typedef CORE_ADDR (gdbarch_adjust_dwarf2_addr_ftype) (CORE_ADDR pc);
+extern CORE_ADDR gdbarch_adjust_dwarf2_addr (struct gdbarch *gdbarch, CORE_ADDR pc);
+extern void set_gdbarch_adjust_dwarf2_addr (struct gdbarch *gdbarch, gdbarch_adjust_dwarf2_addr_ftype *adjust_dwarf2_addr);
+
+/* Adjust the address updated by a line entry in a backend-specific way.
+   Normally this hook is supposed to return the address passed unchanged,
+   however in the case of inconsistencies in these records, this hook can
+   be used to fix them up in the required manner.  This is currently used
+   by the MIPS backend to make sure all line addresses in compressed code
+   are presented with the ISA bit set, which is not always the case.  This
+   in turn ensures breakpoint addresses are correctly matched against the
+   stop PC. */
+
+typedef CORE_ADDR (gdbarch_adjust_dwarf2_line_ftype) (CORE_ADDR addr, int rel);
+extern CORE_ADDR gdbarch_adjust_dwarf2_line (struct gdbarch *gdbarch, CORE_ADDR addr, int rel);
+extern void set_gdbarch_adjust_dwarf2_line (struct gdbarch *gdbarch, gdbarch_adjust_dwarf2_line_ftype *adjust_dwarf2_line);
+
+extern int gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch);
+extern void set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch, int cannot_step_breakpoint);
+
+/* See comment in target.h about continuable, steppable and
+   non-steppable watchpoints. */
+
+extern int gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch);
+extern void set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch, int have_nonsteppable_watchpoint);
+
+extern bool gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch);
+
+typedef type_instance_flags (gdbarch_address_class_type_flags_ftype) (int byte_size, int dwarf2_addr_class);
+extern type_instance_flags gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class);
+extern void set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch, gdbarch_address_class_type_flags_ftype *address_class_type_flags);
+
+extern bool gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch);
+
+typedef const char * (gdbarch_address_class_type_flags_to_name_ftype) (struct gdbarch *gdbarch, type_instance_flags type_flags);
+extern const char * gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, type_instance_flags type_flags);
+extern void set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name);
+
+/* Execute vendor-specific DWARF Call Frame Instruction.  OP is the instruction.
+   FS are passed from the generic execute_cfa_program function. */
+
+typedef bool (gdbarch_execute_dwarf_cfa_vendor_op_ftype) (struct gdbarch *gdbarch, gdb_byte op, struct dwarf2_frame_state *fs);
+extern bool gdbarch_execute_dwarf_cfa_vendor_op (struct gdbarch *gdbarch, gdb_byte op, struct dwarf2_frame_state *fs);
+extern void set_gdbarch_execute_dwarf_cfa_vendor_op (struct gdbarch *gdbarch, gdbarch_execute_dwarf_cfa_vendor_op_ftype *execute_dwarf_cfa_vendor_op);
+
+/* Return the appropriate type_flags for the supplied address class.
+   This function should return true if the address class was recognized and
+   type_flags was set, false otherwise. */
+
+extern bool gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch);
+
+typedef bool (gdbarch_address_class_name_to_type_flags_ftype) (struct gdbarch *gdbarch, const char *name, type_instance_flags *type_flags_ptr);
+extern bool gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, type_instance_flags *type_flags_ptr);
+extern void set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags);
+
+/* Is a register in a group */
+
+typedef int (gdbarch_register_reggroup_p_ftype) (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup);
+extern int gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup);
+extern void set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch, gdbarch_register_reggroup_p_ftype *register_reggroup_p);
+
+/* Fetch the pointer to the ith function argument. */
+
+extern bool gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch);
+
+typedef CORE_ADDR (gdbarch_fetch_pointer_argument_ftype) (struct frame_info *frame, int argi, struct type *type);
+extern CORE_ADDR gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type);
+extern void set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument);
+
+/* Iterate over all supported register notes in a core file.  For each
+   supported register note section, the iterator must call CB and pass
+   CB_DATA unchanged.  If REGCACHE is not NULL, the iterator can limit
+   the supported register note sections based on the current register
+   values.  Otherwise it should enumerate all supported register note
+   sections. */
+
+extern bool gdbarch_iterate_over_regset_sections_p (struct gdbarch *gdbarch);
+
+typedef void (gdbarch_iterate_over_regset_sections_ftype) (struct gdbarch *gdbarch, iterate_over_regset_sections_cb *cb, void *cb_data, const struct regcache *regcache);
+extern void gdbarch_iterate_over_regset_sections (struct gdbarch *gdbarch, iterate_over_regset_sections_cb *cb, void *cb_data, const struct regcache *regcache);
+extern void set_gdbarch_iterate_over_regset_sections (struct gdbarch *gdbarch, gdbarch_iterate_over_regset_sections_ftype *iterate_over_regset_sections);
+
+/* Create core file notes */
+
+extern bool gdbarch_make_corefile_notes_p (struct gdbarch *gdbarch);
+
+typedef gdb::unique_xmalloc_ptr<char> (gdbarch_make_corefile_notes_ftype) (struct gdbarch *gdbarch, bfd *obfd, int *note_size);
+extern gdb::unique_xmalloc_ptr<char> gdbarch_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size);
+extern void set_gdbarch_make_corefile_notes (struct gdbarch *gdbarch, gdbarch_make_corefile_notes_ftype *make_corefile_notes);
+
+/* Find core file memory regions */
+
+extern bool gdbarch_find_memory_regions_p (struct gdbarch *gdbarch);
+
+typedef int (gdbarch_find_memory_regions_ftype) (struct gdbarch *gdbarch, find_memory_region_ftype func, void *data);
+extern int gdbarch_find_memory_regions (struct gdbarch *gdbarch, find_memory_region_ftype func, void *data);
+extern void set_gdbarch_find_memory_regions (struct gdbarch *gdbarch, gdbarch_find_memory_regions_ftype *find_memory_regions);
+
+/* Read offset OFFSET of TARGET_OBJECT_LIBRARIES formatted shared libraries list from
+   core file into buffer READBUF with length LEN.  Return the number of bytes read
+   (zero indicates failure).
+   failed, otherwise, return the red length of READBUF. */
+
+extern bool gdbarch_core_xfer_shared_libraries_p (struct gdbarch *gdbarch);
+
+typedef ULONGEST (gdbarch_core_xfer_shared_libraries_ftype) (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len);
+extern ULONGEST gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len);
+extern void set_gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch, gdbarch_core_xfer_shared_libraries_ftype *core_xfer_shared_libraries);
+
+/* Read offset OFFSET of TARGET_OBJECT_LIBRARIES_AIX formatted shared
+   libraries list from core file into buffer READBUF with length LEN.
+   Return the number of bytes read (zero indicates failure). */
+
+extern bool gdbarch_core_xfer_shared_libraries_aix_p (struct gdbarch *gdbarch);
+
+typedef ULONGEST (gdbarch_core_xfer_shared_libraries_aix_ftype) (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len);
+extern ULONGEST gdbarch_core_xfer_shared_libraries_aix (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len);
+extern void set_gdbarch_core_xfer_shared_libraries_aix (struct gdbarch *gdbarch, gdbarch_core_xfer_shared_libraries_aix_ftype *core_xfer_shared_libraries_aix);
+
+/* How the core target converts a PTID from a core file to a string. */
+
+extern bool gdbarch_core_pid_to_str_p (struct gdbarch *gdbarch);
+
+typedef std::string (gdbarch_core_pid_to_str_ftype) (struct gdbarch *gdbarch, ptid_t ptid);
+extern std::string gdbarch_core_pid_to_str (struct gdbarch *gdbarch, ptid_t ptid);
+extern void set_gdbarch_core_pid_to_str (struct gdbarch *gdbarch, gdbarch_core_pid_to_str_ftype *core_pid_to_str);
+
+/* How the core target extracts the name of a thread from a core file. */
+
+extern bool gdbarch_core_thread_name_p (struct gdbarch *gdbarch);
+
+typedef const char * (gdbarch_core_thread_name_ftype) (struct gdbarch *gdbarch, struct thread_info *thr);
+extern const char * gdbarch_core_thread_name (struct gdbarch *gdbarch, struct thread_info *thr);
+extern void set_gdbarch_core_thread_name (struct gdbarch *gdbarch, gdbarch_core_thread_name_ftype *core_thread_name);
+
+/* Read offset OFFSET of TARGET_OBJECT_SIGNAL_INFO signal information
+   from core file into buffer READBUF with length LEN.  Return the number
+   of bytes read (zero indicates EOF, a negative value indicates failure). */
+
+extern bool gdbarch_core_xfer_siginfo_p (struct gdbarch *gdbarch);
+
+typedef LONGEST (gdbarch_core_xfer_siginfo_ftype) (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len);
+extern LONGEST gdbarch_core_xfer_siginfo (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len);
+extern void set_gdbarch_core_xfer_siginfo (struct gdbarch *gdbarch, gdbarch_core_xfer_siginfo_ftype *core_xfer_siginfo);
+
+/* BFD target to use when generating a core file. */
+
+extern bool gdbarch_gcore_bfd_target_p (struct gdbarch *gdbarch);
+
+extern const char * gdbarch_gcore_bfd_target (struct gdbarch *gdbarch);
+extern void set_gdbarch_gcore_bfd_target (struct gdbarch *gdbarch, const char * gcore_bfd_target);
+
+/* If the elements of C++ vtables are in-place function descriptors rather
+   than normal function pointers (which may point to code or a descriptor),
+   set this to one. */
+
+extern int gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch);
+extern void set_gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch, int vtable_function_descriptors);
+
+/* Set if the least significant bit of the delta is used instead of the least
+   significant bit of the pfn for pointers to virtual member functions. */
+
+extern int gdbarch_vbit_in_delta (struct gdbarch *gdbarch);
+extern void set_gdbarch_vbit_in_delta (struct gdbarch *gdbarch, int vbit_in_delta);
+
+/* Advance PC to next instruction in order to skip a permanent breakpoint. */
+
+typedef void (gdbarch_skip_permanent_breakpoint_ftype) (struct regcache *regcache);
+extern void gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, struct regcache *regcache);
+extern void set_gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint);
+
+/* The maximum length of an instruction on this architecture in bytes. */
+
+extern bool gdbarch_max_insn_length_p (struct gdbarch *gdbarch);
+
+extern ULONGEST gdbarch_max_insn_length (struct gdbarch *gdbarch);
+extern void set_gdbarch_max_insn_length (struct gdbarch *gdbarch, ULONGEST max_insn_length);
+
+/* Copy the instruction at FROM to TO, and make any adjustments
+   necessary to single-step it at that address.
+  
+   REGS holds the state the thread's registers will have before
+   executing the copied instruction; the PC in REGS will refer to FROM,
+   not the copy at TO.  The caller should update it to point at TO later.
+  
+   Return a pointer to data of the architecture's choice to be passed
+   to gdbarch_displaced_step_fixup.
+  
+   For a general explanation of displaced stepping and how GDB uses it,
+   see the comments in infrun.c.
+  
+   The TO area is only guaranteed to have space for
+   gdbarch_max_insn_length (arch) bytes, so this function must not
+   write more bytes than that to that area.
+  
+   If you do not provide this function, GDB assumes that the
+   architecture does not support displaced stepping.
+  
+   If the instruction cannot execute out of line, return NULL.  The
+   core falls back to stepping past the instruction in-line instead in
+   that case. */
+
+extern bool gdbarch_displaced_step_copy_insn_p (struct gdbarch *gdbarch);
+
+typedef displaced_step_copy_insn_closure_up (gdbarch_displaced_step_copy_insn_ftype) (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs);
+extern displaced_step_copy_insn_closure_up gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs);
+extern void set_gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch, gdbarch_displaced_step_copy_insn_ftype *displaced_step_copy_insn);
+
+/* Return true if GDB should use hardware single-stepping to execute a displaced
+   step instruction.  If false, GDB will simply restart execution at the
+   displaced instruction location, and it is up to the target to ensure GDB will
+   receive control again (e.g. by placing a software breakpoint instruction into
+   the displaced instruction buffer).
+  
+   The default implementation returns false on all targets that provide a
+   gdbarch_software_single_step routine, and true otherwise. */
+
+typedef bool (gdbarch_displaced_step_hw_singlestep_ftype) (struct gdbarch *gdbarch);
+extern bool gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch);
+extern void set_gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, gdbarch_displaced_step_hw_singlestep_ftype *displaced_step_hw_singlestep);
+
+/* Fix up the state resulting from successfully single-stepping a
+   displaced instruction, to give the result we would have gotten from
+   stepping the instruction in its original location.
+  
+   REGS is the register state resulting from single-stepping the
+   displaced instruction.
+  
+   CLOSURE is the result from the matching call to
+   gdbarch_displaced_step_copy_insn.
+  
+   If you provide gdbarch_displaced_step_copy_insn.but not this
+   function, then GDB assumes that no fixup is needed after
+   single-stepping the instruction.
+  
+   For a general explanation of displaced stepping and how GDB uses it,
+   see the comments in infrun.c. */
+
+extern bool gdbarch_displaced_step_fixup_p (struct gdbarch *gdbarch);
+
+typedef void (gdbarch_displaced_step_fixup_ftype) (struct gdbarch *gdbarch, struct displaced_step_copy_insn_closure *closure, CORE_ADDR from, CORE_ADDR to, struct regcache *regs);
+extern void gdbarch_displaced_step_fixup (struct gdbarch *gdbarch, struct displaced_step_copy_insn_closure *closure, CORE_ADDR from, CORE_ADDR to, struct regcache *regs);
+extern void set_gdbarch_displaced_step_fixup (struct gdbarch *gdbarch, gdbarch_displaced_step_fixup_ftype *displaced_step_fixup);
+
+/* Prepare THREAD for it to displaced step the instruction at its current PC.
+  
+   Throw an exception if any unexpected error happens. */
+
+extern bool gdbarch_displaced_step_prepare_p (struct gdbarch *gdbarch);
+
+typedef displaced_step_prepare_status (gdbarch_displaced_step_prepare_ftype) (struct gdbarch *gdbarch, thread_info *thread, CORE_ADDR &displaced_pc);
+extern displaced_step_prepare_status gdbarch_displaced_step_prepare (struct gdbarch *gdbarch, thread_info *thread, CORE_ADDR &displaced_pc);
+extern void set_gdbarch_displaced_step_prepare (struct gdbarch *gdbarch, gdbarch_displaced_step_prepare_ftype *displaced_step_prepare);
+
+/* Clean up after a displaced step of THREAD. */
+
+typedef displaced_step_finish_status (gdbarch_displaced_step_finish_ftype) (struct gdbarch *gdbarch, thread_info *thread, gdb_signal sig);
+extern displaced_step_finish_status gdbarch_displaced_step_finish (struct gdbarch *gdbarch, thread_info *thread, gdb_signal sig);
+extern void set_gdbarch_displaced_step_finish (struct gdbarch *gdbarch, gdbarch_displaced_step_finish_ftype *displaced_step_finish);
+
+/* Return the closure associated to the displaced step buffer that is at ADDR. */
+
+extern bool gdbarch_displaced_step_copy_insn_closure_by_addr_p (struct gdbarch *gdbarch);
+
+typedef const displaced_step_copy_insn_closure * (gdbarch_displaced_step_copy_insn_closure_by_addr_ftype) (inferior *inf, CORE_ADDR addr);
+extern const displaced_step_copy_insn_closure * gdbarch_displaced_step_copy_insn_closure_by_addr (struct gdbarch *gdbarch, inferior *inf, CORE_ADDR addr);
+extern void set_gdbarch_displaced_step_copy_insn_closure_by_addr (struct gdbarch *gdbarch, gdbarch_displaced_step_copy_insn_closure_by_addr_ftype *displaced_step_copy_insn_closure_by_addr);
+
+/* PARENT_INF has forked and CHILD_PTID is the ptid of the child.  Restore the
+   contents of all displaced step buffers in the child's address space. */
+
+typedef void (gdbarch_displaced_step_restore_all_in_ptid_ftype) (inferior *parent_inf, ptid_t child_ptid);
+extern void gdbarch_displaced_step_restore_all_in_ptid (struct gdbarch *gdbarch, inferior *parent_inf, ptid_t child_ptid);
+extern void set_gdbarch_displaced_step_restore_all_in_ptid (struct gdbarch *gdbarch, gdbarch_displaced_step_restore_all_in_ptid_ftype *displaced_step_restore_all_in_ptid);
+
+/* Relocate an instruction to execute at a different address.  OLDLOC
+   is the address in the inferior memory where the instruction to
+   relocate is currently at.  On input, TO points to the destination
+   where we want the instruction to be copied (and possibly adjusted)
+   to.  On output, it points to one past the end of the resulting
+   instruction(s).  The effect of executing the instruction at TO shall
+   be the same as if executing it at FROM.  For example, call
+   instructions that implicitly push the return address on the stack
+   should be adjusted to return to the instruction after OLDLOC;
+   relative branches, and other PC-relative instructions need the
+   offset adjusted; etc. */
+
+extern bool gdbarch_relocate_instruction_p (struct gdbarch *gdbarch);
+
+typedef void (gdbarch_relocate_instruction_ftype) (struct gdbarch *gdbarch, CORE_ADDR *to, CORE_ADDR from);
+extern void gdbarch_relocate_instruction (struct gdbarch *gdbarch, CORE_ADDR *to, CORE_ADDR from);
+extern void set_gdbarch_relocate_instruction (struct gdbarch *gdbarch, gdbarch_relocate_instruction_ftype *relocate_instruction);
+
+/* Refresh overlay mapped state for section OSECT. */
+
+extern bool gdbarch_overlay_update_p (struct gdbarch *gdbarch);
+
+typedef void (gdbarch_overlay_update_ftype) (struct obj_section *osect);
+extern void gdbarch_overlay_update (struct gdbarch *gdbarch, struct obj_section *osect);
+extern void set_gdbarch_overlay_update (struct gdbarch *gdbarch, gdbarch_overlay_update_ftype *overlay_update);
+
+extern bool gdbarch_core_read_description_p (struct gdbarch *gdbarch);
+
+typedef const struct target_desc * (gdbarch_core_read_description_ftype) (struct gdbarch *gdbarch, struct target_ops *target, bfd *abfd);
+extern const struct target_desc * gdbarch_core_read_description (struct gdbarch *gdbarch, struct target_ops *target, bfd *abfd);
+extern void set_gdbarch_core_read_description (struct gdbarch *gdbarch, gdbarch_core_read_description_ftype *core_read_description);
+
+/* Set if the address in N_SO or N_FUN stabs may be zero. */
+
+extern int gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch);
+extern void set_gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch, int sofun_address_maybe_missing);
+
+/* Parse the instruction at ADDR storing in the record execution log
+   the registers REGCACHE and memory ranges that will be affected when
+   the instruction executes, along with their current values.
+   Return -1 if something goes wrong, 0 otherwise. */
+
+extern bool gdbarch_process_record_p (struct gdbarch *gdbarch);
+
+typedef int (gdbarch_process_record_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr);
+extern int gdbarch_process_record (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr);
+extern void set_gdbarch_process_record (struct gdbarch *gdbarch, gdbarch_process_record_ftype *process_record);
+
+/* Save process state after a signal.
+   Return -1 if something goes wrong, 0 otherwise. */
+
+extern bool gdbarch_process_record_signal_p (struct gdbarch *gdbarch);
+
+typedef int (gdbarch_process_record_signal_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, enum gdb_signal signal);
+extern int gdbarch_process_record_signal (struct gdbarch *gdbarch, struct regcache *regcache, enum gdb_signal signal);
+extern void set_gdbarch_process_record_signal (struct gdbarch *gdbarch, gdbarch_process_record_signal_ftype *process_record_signal);
+
+/* Signal translation: translate inferior's signal (target's) number
+   into GDB's representation.  The implementation of this method must
+   be host independent.  IOW, don't rely on symbols of the NAT_FILE
+   header (the nm-*.h files), the host <signal.h> header, or similar
+   headers.  This is mainly used when cross-debugging core files ---
+   "Live" targets hide the translation behind the target interface
+   (target_wait, target_resume, etc.). */
+
+extern bool gdbarch_gdb_signal_from_target_p (struct gdbarch *gdbarch);
+
+typedef enum gdb_signal (gdbarch_gdb_signal_from_target_ftype) (struct gdbarch *gdbarch, int signo);
+extern enum gdb_signal gdbarch_gdb_signal_from_target (struct gdbarch *gdbarch, int signo);
+extern void set_gdbarch_gdb_signal_from_target (struct gdbarch *gdbarch, gdbarch_gdb_signal_from_target_ftype *gdb_signal_from_target);
+
+/* Signal translation: translate the GDB's internal signal number into
+   the inferior's signal (target's) representation.  The implementation
+   of this method must be host independent.  IOW, don't rely on symbols
+   of the NAT_FILE header (the nm-*.h files), the host <signal.h>
+   header, or similar headers.
+   Return the target signal number if found, or -1 if the GDB internal
+   signal number is invalid. */
+
+extern bool gdbarch_gdb_signal_to_target_p (struct gdbarch *gdbarch);
+
+typedef int (gdbarch_gdb_signal_to_target_ftype) (struct gdbarch *gdbarch, enum gdb_signal signal);
+extern int gdbarch_gdb_signal_to_target (struct gdbarch *gdbarch, enum gdb_signal signal);
+extern void set_gdbarch_gdb_signal_to_target (struct gdbarch *gdbarch, gdbarch_gdb_signal_to_target_ftype *gdb_signal_to_target);
+
+/* Extra signal info inspection.
+  
+   Return a type suitable to inspect extra signal information. */
+
+extern bool gdbarch_get_siginfo_type_p (struct gdbarch *gdbarch);
+
+typedef struct type * (gdbarch_get_siginfo_type_ftype) (struct gdbarch *gdbarch);
+extern struct type * gdbarch_get_siginfo_type (struct gdbarch *gdbarch);
+extern void set_gdbarch_get_siginfo_type (struct gdbarch *gdbarch, gdbarch_get_siginfo_type_ftype *get_siginfo_type);
+
+/* Record architecture-specific information from the symbol table. */
+
+extern bool gdbarch_record_special_symbol_p (struct gdbarch *gdbarch);
+
+typedef void (gdbarch_record_special_symbol_ftype) (struct gdbarch *gdbarch, struct objfile *objfile, asymbol *sym);
+extern void gdbarch_record_special_symbol (struct gdbarch *gdbarch, struct objfile *objfile, asymbol *sym);
+extern void set_gdbarch_record_special_symbol (struct gdbarch *gdbarch, gdbarch_record_special_symbol_ftype *record_special_symbol);
+
+/* Function for the 'catch syscall' feature.
+   Get architecture-specific system calls information from registers. */
+
+extern bool gdbarch_get_syscall_number_p (struct gdbarch *gdbarch);
+
+typedef LONGEST (gdbarch_get_syscall_number_ftype) (struct gdbarch *gdbarch, thread_info *thread);
+extern LONGEST gdbarch_get_syscall_number (struct gdbarch *gdbarch, thread_info *thread);
+extern void set_gdbarch_get_syscall_number (struct gdbarch *gdbarch, gdbarch_get_syscall_number_ftype *get_syscall_number);
+
+/* The filename of the XML syscall for this architecture. */
+
+extern const char * gdbarch_xml_syscall_file (struct gdbarch *gdbarch);
+extern void set_gdbarch_xml_syscall_file (struct gdbarch *gdbarch, const char * xml_syscall_file);
+
+/* Information about system calls from this architecture */
+
+extern struct syscalls_info * gdbarch_syscalls_info (struct gdbarch *gdbarch);
+extern void set_gdbarch_syscalls_info (struct gdbarch *gdbarch, struct syscalls_info * syscalls_info);
+
+/* SystemTap related fields and functions.
+   A NULL-terminated array of prefixes used to mark an integer constant
+   on the architecture's assembly.
+   For example, on x86 integer constants are written as:
+  
+    $10 ;; integer constant 10
+  
+   in this case, this prefix would be the character `$'. */
+
+extern const char *const * gdbarch_stap_integer_prefixes (struct gdbarch *gdbarch);
+extern void set_gdbarch_stap_integer_prefixes (struct gdbarch *gdbarch, const char *const * stap_integer_prefixes);
+
+/* A NULL-terminated array of suffixes used to mark an integer constant
+   on the architecture's assembly. */
+
+extern const char *const * gdbarch_stap_integer_suffixes (struct gdbarch *gdbarch);
+extern void set_gdbarch_stap_integer_suffixes (struct gdbarch *gdbarch, const char *const * stap_integer_suffixes);
+
+/* A NULL-terminated array of prefixes used to mark a register name on
+   the architecture's assembly.
+   For example, on x86 the register name is written as:
+  
+    %eax ;; register eax
+  
+   in this case, this prefix would be the character `%'. */
+
+extern const char *const * gdbarch_stap_register_prefixes (struct gdbarch *gdbarch);
+extern void set_gdbarch_stap_register_prefixes (struct gdbarch *gdbarch, const char *const * stap_register_prefixes);
+
+/* A NULL-terminated array of suffixes used to mark a register name on
+   the architecture's assembly. */
+
+extern const char *const * gdbarch_stap_register_suffixes (struct gdbarch *gdbarch);
+extern void set_gdbarch_stap_register_suffixes (struct gdbarch *gdbarch, const char *const * stap_register_suffixes);
+
+/* A NULL-terminated array of prefixes used to mark a register
+   indirection on the architecture's assembly.
+   For example, on x86 the register indirection is written as:
+  
+    (%eax) ;; indirecting eax
+  
+   in this case, this prefix would be the charater `('.
+  
+   Please note that we use the indirection prefix also for register
+   displacement, e.g., `4(%eax)' on x86. */
+
+extern const char *const * gdbarch_stap_register_indirection_prefixes (struct gdbarch *gdbarch);
+extern void set_gdbarch_stap_register_indirection_prefixes (struct gdbarch *gdbarch, const char *const * stap_register_indirection_prefixes);
+
+/* A NULL-terminated array of suffixes used to mark a register
+   indirection on the architecture's assembly.
+   For example, on x86 the register indirection is written as:
+  
+    (%eax) ;; indirecting eax
+  
+   in this case, this prefix would be the charater `)'.
+  
+   Please note that we use the indirection suffix also for register
+   displacement, e.g., `4(%eax)' on x86. */
+
+extern const char *const * gdbarch_stap_register_indirection_suffixes (struct gdbarch *gdbarch);
+extern void set_gdbarch_stap_register_indirection_suffixes (struct gdbarch *gdbarch, const char *const * stap_register_indirection_suffixes);
+
+/* Prefix(es) used to name a register using GDB's nomenclature.
+  
+   For example, on PPC a register is represented by a number in the assembly
+   language (e.g., `10' is the 10th general-purpose register).  However,
+   inside GDB this same register has an `r' appended to its name, so the 10th
+   register would be represented as `r10' internally. */
+
+extern const char * gdbarch_stap_gdb_register_prefix (struct gdbarch *gdbarch);
+extern void set_gdbarch_stap_gdb_register_prefix (struct gdbarch *gdbarch, const char * stap_gdb_register_prefix);
+
+/* Suffix used to name a register using GDB's nomenclature. */
+
+extern const char * gdbarch_stap_gdb_register_suffix (struct gdbarch *gdbarch);
+extern void set_gdbarch_stap_gdb_register_suffix (struct gdbarch *gdbarch, const char * stap_gdb_register_suffix);
+
+/* Check if S is a single operand.
+  
+   Single operands can be:
+    - Literal integers, e.g. `$10' on x86
+    - Register access, e.g. `%eax' on x86
+    - Register indirection, e.g. `(%eax)' on x86
+    - Register displacement, e.g. `4(%eax)' on x86
+  
+   This function should check for these patterns on the string
+   and return 1 if some were found, or zero otherwise.  Please try to match
+   as much info as you can from the string, i.e., if you have to match
+   something like `(%', do not match just the `('. */
+
+extern bool gdbarch_stap_is_single_operand_p (struct gdbarch *gdbarch);
+
+typedef int (gdbarch_stap_is_single_operand_ftype) (struct gdbarch *gdbarch, const char *s);
+extern int gdbarch_stap_is_single_operand (struct gdbarch *gdbarch, const char *s);
+extern void set_gdbarch_stap_is_single_operand (struct gdbarch *gdbarch, gdbarch_stap_is_single_operand_ftype *stap_is_single_operand);
+
+/* Function used to handle a "special case" in the parser.
+  
+   A "special case" is considered to be an unknown token, i.e., a token
+   that the parser does not know how to parse.  A good example of special
+   case would be ARM's register displacement syntax:
+  
+    [R0, #4]  ;; displacing R0 by 4
+  
+   Since the parser assumes that a register displacement is of the form:
+  
+    <number> <indirection_prefix> <register_name> <indirection_suffix>
+  
+   it means that it will not be able to recognize and parse this odd syntax.
+   Therefore, we should add a special case function that will handle this token.
+  
+   This function should generate the proper expression form of the expression
+   using GDB's internal expression mechanism (e.g., `write_exp_elt_opcode'
+   and so on).  It should also return 1 if the parsing was successful, or zero
+   if the token was not recognized as a special token (in this case, returning
+   zero means that the special parser is deferring the parsing to the generic
+   parser), and should advance the buffer pointer (p->arg). */
+
+extern bool gdbarch_stap_parse_special_token_p (struct gdbarch *gdbarch);
+
+typedef expr::operation_up (gdbarch_stap_parse_special_token_ftype) (struct gdbarch *gdbarch, struct stap_parse_info *p);
+extern expr::operation_up gdbarch_stap_parse_special_token (struct gdbarch *gdbarch, struct stap_parse_info *p);
+extern void set_gdbarch_stap_parse_special_token (struct gdbarch *gdbarch, gdbarch_stap_parse_special_token_ftype *stap_parse_special_token);
+
+/* Perform arch-dependent adjustments to a register name.
+  
+   In very specific situations, it may be necessary for the register
+   name present in a SystemTap probe's argument to be handled in a
+   special way.  For example, on i386, GCC may over-optimize the
+   register allocation and use smaller registers than necessary.  In
+   such cases, the client that is reading and evaluating the SystemTap
+   probe (ourselves) will need to actually fetch values from the wider
+   version of the register in question.
+  
+   To illustrate the example, consider the following probe argument
+   (i386):
+  
+      4@%ax
+  
+   This argument says that its value can be found at the %ax register,
+   which is a 16-bit register.  However, the argument's prefix says
+   that its type is "uint32_t", which is 32-bit in size.  Therefore, in
+   this case, GDB should actually fetch the probe's value from register
+   %eax, not %ax.  In this scenario, this function would actually
+   replace the register name from %ax to %eax.
+  
+   The rationale for this can be found at PR breakpoints/24541. */
+
+extern bool gdbarch_stap_adjust_register_p (struct gdbarch *gdbarch);
+
+typedef std::string (gdbarch_stap_adjust_register_ftype) (struct gdbarch *gdbarch, struct stap_parse_info *p, const std::string &regname, int regnum);
+extern std::string gdbarch_stap_adjust_register (struct gdbarch *gdbarch, struct stap_parse_info *p, const std::string &regname, int regnum);
+extern void set_gdbarch_stap_adjust_register (struct gdbarch *gdbarch, gdbarch_stap_adjust_register_ftype *stap_adjust_register);
+
+/* DTrace related functions.
+   The expression to compute the NARTGth+1 argument to a DTrace USDT probe.
+   NARG must be >= 0. */
+
+extern bool gdbarch_dtrace_parse_probe_argument_p (struct gdbarch *gdbarch);
+
+typedef expr::operation_up (gdbarch_dtrace_parse_probe_argument_ftype) (struct gdbarch *gdbarch, int narg);
+extern expr::operation_up gdbarch_dtrace_parse_probe_argument (struct gdbarch *gdbarch, int narg);
+extern void set_gdbarch_dtrace_parse_probe_argument (struct gdbarch *gdbarch, gdbarch_dtrace_parse_probe_argument_ftype *dtrace_parse_probe_argument);
+
+/* True if the given ADDR does not contain the instruction sequence
+   corresponding to a disabled DTrace is-enabled probe. */
+
+extern bool gdbarch_dtrace_probe_is_enabled_p (struct gdbarch *gdbarch);
+
+typedef int (gdbarch_dtrace_probe_is_enabled_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern int gdbarch_dtrace_probe_is_enabled (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern void set_gdbarch_dtrace_probe_is_enabled (struct gdbarch *gdbarch, gdbarch_dtrace_probe_is_enabled_ftype *dtrace_probe_is_enabled);
+
+/* Enable a DTrace is-enabled probe at ADDR. */
+
+extern bool gdbarch_dtrace_enable_probe_p (struct gdbarch *gdbarch);
+
+typedef void (gdbarch_dtrace_enable_probe_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern void gdbarch_dtrace_enable_probe (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern void set_gdbarch_dtrace_enable_probe (struct gdbarch *gdbarch, gdbarch_dtrace_enable_probe_ftype *dtrace_enable_probe);
+
+/* Disable a DTrace is-enabled probe at ADDR. */
+
+extern bool gdbarch_dtrace_disable_probe_p (struct gdbarch *gdbarch);
+
+typedef void (gdbarch_dtrace_disable_probe_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern void gdbarch_dtrace_disable_probe (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern void set_gdbarch_dtrace_disable_probe (struct gdbarch *gdbarch, gdbarch_dtrace_disable_probe_ftype *dtrace_disable_probe);
+
+/* True if the list of shared libraries is one and only for all
+   processes, as opposed to a list of shared libraries per inferior.
+   This usually means that all processes, although may or may not share
+   an address space, will see the same set of symbols at the same
+   addresses. */
+
+extern int gdbarch_has_global_solist (struct gdbarch *gdbarch);
+extern void set_gdbarch_has_global_solist (struct gdbarch *gdbarch, int has_global_solist);
+
+/* On some targets, even though each inferior has its own private
+   address space, the debug interface takes care of making breakpoints
+   visible to all address spaces automatically.  For such cases,
+   this property should be set to true. */
+
+extern int gdbarch_has_global_breakpoints (struct gdbarch *gdbarch);
+extern void set_gdbarch_has_global_breakpoints (struct gdbarch *gdbarch, int has_global_breakpoints);
+
+/* True if inferiors share an address space (e.g., uClinux). */
+
+typedef int (gdbarch_has_shared_address_space_ftype) (struct gdbarch *gdbarch);
+extern int gdbarch_has_shared_address_space (struct gdbarch *gdbarch);
+extern void set_gdbarch_has_shared_address_space (struct gdbarch *gdbarch, gdbarch_has_shared_address_space_ftype *has_shared_address_space);
+
+/* True if a fast tracepoint can be set at an address. */
+
+typedef int (gdbarch_fast_tracepoint_valid_at_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr, std::string *msg);
+extern int gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr, std::string *msg);
+extern void set_gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch, gdbarch_fast_tracepoint_valid_at_ftype *fast_tracepoint_valid_at);
+
+/* Guess register state based on tracepoint location.  Used for tracepoints
+   where no registers have been collected, but there's only one location,
+   allowing us to guess the PC value, and perhaps some other registers.
+   On entry, regcache has all registers marked as unavailable. */
+
+typedef void (gdbarch_guess_tracepoint_registers_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr);
+extern void gdbarch_guess_tracepoint_registers (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr);
+extern void set_gdbarch_guess_tracepoint_registers (struct gdbarch *gdbarch, gdbarch_guess_tracepoint_registers_ftype *guess_tracepoint_registers);
+
+/* Return the "auto" target charset. */
+
+typedef const char * (gdbarch_auto_charset_ftype) (void);
+extern const char * gdbarch_auto_charset (struct gdbarch *gdbarch);
+extern void set_gdbarch_auto_charset (struct gdbarch *gdbarch, gdbarch_auto_charset_ftype *auto_charset);
+
+/* Return the "auto" target wide charset. */
+
+typedef const char * (gdbarch_auto_wide_charset_ftype) (void);
+extern const char * gdbarch_auto_wide_charset (struct gdbarch *gdbarch);
+extern void set_gdbarch_auto_wide_charset (struct gdbarch *gdbarch, gdbarch_auto_wide_charset_ftype *auto_wide_charset);
+
+/* If non-empty, this is a file extension that will be opened in place
+   of the file extension reported by the shared library list.
+  
+   This is most useful for toolchains that use a post-linker tool,
+   where the names of the files run on the target differ in extension
+   compared to the names of the files GDB should load for debug info. */
+
+extern const char * gdbarch_solib_symbols_extension (struct gdbarch *gdbarch);
+extern void set_gdbarch_solib_symbols_extension (struct gdbarch *gdbarch, const char * solib_symbols_extension);
+
+/* If true, the target OS has DOS-based file system semantics.  That
+   is, absolute paths include a drive name, and the backslash is
+   considered a directory separator. */
+
+extern int gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch);
+extern void set_gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch, int has_dos_based_file_system);
+
+/* Generate bytecodes to collect the return address in a frame.
+   Since the bytecodes run on the target, possibly with GDB not even
+   connected, the full unwinding machinery is not available, and
+   typically this function will issue bytecodes for one or more likely
+   places that the return address may be found. */
+
+typedef void (gdbarch_gen_return_address_ftype) (struct gdbarch *gdbarch, struct agent_expr *ax, struct axs_value *value, CORE_ADDR scope);
+extern void gdbarch_gen_return_address (struct gdbarch *gdbarch, struct agent_expr *ax, struct axs_value *value, CORE_ADDR scope);
+extern void set_gdbarch_gen_return_address (struct gdbarch *gdbarch, gdbarch_gen_return_address_ftype *gen_return_address);
+
+/* Implement the "info proc" command. */
+
+extern bool gdbarch_info_proc_p (struct gdbarch *gdbarch);
+
+typedef void (gdbarch_info_proc_ftype) (struct gdbarch *gdbarch, const char *args, enum info_proc_what what);
+extern void gdbarch_info_proc (struct gdbarch *gdbarch, const char *args, enum info_proc_what what);
+extern void set_gdbarch_info_proc (struct gdbarch *gdbarch, gdbarch_info_proc_ftype *info_proc);
+
+/* Implement the "info proc" command for core files.  Noe that there
+   are two "info_proc"-like methods on gdbarch -- one for core files,
+   one for live targets. */
+
+extern bool gdbarch_core_info_proc_p (struct gdbarch *gdbarch);
+
+typedef void (gdbarch_core_info_proc_ftype) (struct gdbarch *gdbarch, const char *args, enum info_proc_what what);
+extern void gdbarch_core_info_proc (struct gdbarch *gdbarch, const char *args, enum info_proc_what what);
+extern void set_gdbarch_core_info_proc (struct gdbarch *gdbarch, gdbarch_core_info_proc_ftype *core_info_proc);
+
+/* Iterate over all objfiles in the order that makes the most sense
+   for the architecture to make global symbol searches.
+  
+   CB is a callback function where OBJFILE is the objfile to be searched,
+   and CB_DATA a pointer to user-defined data (the same data that is passed
+   when calling this gdbarch method).  The iteration stops if this function
+   returns nonzero.
+  
+   CB_DATA is a pointer to some user-defined data to be passed to
+   the callback.
+  
+   If not NULL, CURRENT_OBJFILE corresponds to the objfile being
+   inspected when the symbol search was requested. */
+
+typedef void (gdbarch_iterate_over_objfiles_in_search_order_ftype) (struct gdbarch *gdbarch, iterate_over_objfiles_in_search_order_cb_ftype *cb, void *cb_data, struct objfile *current_objfile);
+extern void gdbarch_iterate_over_objfiles_in_search_order (struct gdbarch *gdbarch, iterate_over_objfiles_in_search_order_cb_ftype *cb, void *cb_data, struct objfile *current_objfile);
+extern void set_gdbarch_iterate_over_objfiles_in_search_order (struct gdbarch *gdbarch, gdbarch_iterate_over_objfiles_in_search_order_ftype *iterate_over_objfiles_in_search_order);
+
+/* Ravenscar arch-dependent ops. */
+
+extern struct ravenscar_arch_ops * gdbarch_ravenscar_ops (struct gdbarch *gdbarch);
+extern void set_gdbarch_ravenscar_ops (struct gdbarch *gdbarch, struct ravenscar_arch_ops * ravenscar_ops);
+
+/* Return non-zero if the instruction at ADDR is a call; zero otherwise. */
+
+typedef int (gdbarch_insn_is_call_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern int gdbarch_insn_is_call (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern void set_gdbarch_insn_is_call (struct gdbarch *gdbarch, gdbarch_insn_is_call_ftype *insn_is_call);
+
+/* Return non-zero if the instruction at ADDR is a return; zero otherwise. */
+
+typedef int (gdbarch_insn_is_ret_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern int gdbarch_insn_is_ret (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern void set_gdbarch_insn_is_ret (struct gdbarch *gdbarch, gdbarch_insn_is_ret_ftype *insn_is_ret);
+
+/* Return non-zero if the instruction at ADDR is a jump; zero otherwise. */
+
+typedef int (gdbarch_insn_is_jump_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern int gdbarch_insn_is_jump (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern void set_gdbarch_insn_is_jump (struct gdbarch *gdbarch, gdbarch_insn_is_jump_ftype *insn_is_jump);
+
+/* Return true if there's a program/permanent breakpoint planted in
+   memory at ADDRESS, return false otherwise. */
+
+typedef bool (gdbarch_program_breakpoint_here_p_ftype) (struct gdbarch *gdbarch, CORE_ADDR address);
+extern bool gdbarch_program_breakpoint_here_p (struct gdbarch *gdbarch, CORE_ADDR address);
+extern void set_gdbarch_program_breakpoint_here_p (struct gdbarch *gdbarch, gdbarch_program_breakpoint_here_p_ftype *program_breakpoint_here_p);
+
+/* Read one auxv entry from *READPTR, not reading locations >= ENDPTR.
+   Return 0 if *READPTR is already at the end of the buffer.
+   Return -1 if there is insufficient buffer for a whole entry.
+   Return 1 if an entry was read into *TYPEP and *VALP. */
+
+extern bool gdbarch_auxv_parse_p (struct gdbarch *gdbarch);
+
+typedef int (gdbarch_auxv_parse_ftype) (struct gdbarch *gdbarch, gdb_byte **readptr, gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp);
+extern int gdbarch_auxv_parse (struct gdbarch *gdbarch, gdb_byte **readptr, gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp);
+extern void set_gdbarch_auxv_parse (struct gdbarch *gdbarch, gdbarch_auxv_parse_ftype *auxv_parse);
+
+/* Print the description of a single auxv entry described by TYPE and VAL
+   to FILE. */
+
+typedef void (gdbarch_print_auxv_entry_ftype) (struct gdbarch *gdbarch, struct ui_file *file, CORE_ADDR type, CORE_ADDR val);
+extern void gdbarch_print_auxv_entry (struct gdbarch *gdbarch, struct ui_file *file, CORE_ADDR type, CORE_ADDR val);
+extern void set_gdbarch_print_auxv_entry (struct gdbarch *gdbarch, gdbarch_print_auxv_entry_ftype *print_auxv_entry);
+
+/* Find the address range of the current inferior's vsyscall/vDSO, and
+   write it to *RANGE.  If the vsyscall's length can't be determined, a
+   range with zero length is returned.  Returns true if the vsyscall is
+   found, false otherwise. */
+
+typedef int (gdbarch_vsyscall_range_ftype) (struct gdbarch *gdbarch, struct mem_range *range);
+extern int gdbarch_vsyscall_range (struct gdbarch *gdbarch, struct mem_range *range);
+extern void set_gdbarch_vsyscall_range (struct gdbarch *gdbarch, gdbarch_vsyscall_range_ftype *vsyscall_range);
+
+/* Allocate SIZE bytes of PROT protected page aligned memory in inferior.
+   PROT has GDB_MMAP_PROT_* bitmask format.
+   Throw an error if it is not possible.  Returned address is always valid. */
+
+typedef CORE_ADDR (gdbarch_infcall_mmap_ftype) (CORE_ADDR size, unsigned prot);
+extern CORE_ADDR gdbarch_infcall_mmap (struct gdbarch *gdbarch, CORE_ADDR size, unsigned prot);
+extern void set_gdbarch_infcall_mmap (struct gdbarch *gdbarch, gdbarch_infcall_mmap_ftype *infcall_mmap);
+
+/* Deallocate SIZE bytes of memory at ADDR in inferior from gdbarch_infcall_mmap.
+   Print a warning if it is not possible. */
+
+typedef void (gdbarch_infcall_munmap_ftype) (CORE_ADDR addr, CORE_ADDR size);
+extern void gdbarch_infcall_munmap (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR size);
+extern void set_gdbarch_infcall_munmap (struct gdbarch *gdbarch, gdbarch_infcall_munmap_ftype *infcall_munmap);
+
+/* Return string (caller has to use xfree for it) with options for GCC
+   to produce code for this target, typically "-m64", "-m32" or "-m31".
+   These options are put before CU's DW_AT_producer compilation options so that
+   they can override it. */
+
+typedef std::string (gdbarch_gcc_target_options_ftype) (struct gdbarch *gdbarch);
+extern std::string gdbarch_gcc_target_options (struct gdbarch *gdbarch);
+extern void set_gdbarch_gcc_target_options (struct gdbarch *gdbarch, gdbarch_gcc_target_options_ftype *gcc_target_options);
+
+/* Return a regular expression that matches names used by this
+   architecture in GNU configury triplets.  The result is statically
+   allocated and must not be freed.  The default implementation simply
+   returns the BFD architecture name, which is correct in nearly every
+   case. */
+
+typedef const char * (gdbarch_gnu_triplet_regexp_ftype) (struct gdbarch *gdbarch);
+extern const char * gdbarch_gnu_triplet_regexp (struct gdbarch *gdbarch);
+extern void set_gdbarch_gnu_triplet_regexp (struct gdbarch *gdbarch, gdbarch_gnu_triplet_regexp_ftype *gnu_triplet_regexp);
+
+/* Return the size in 8-bit bytes of an addressable memory unit on this
+   architecture.  This corresponds to the number of 8-bit bytes associated to
+   each address in memory. */
+
+typedef int (gdbarch_addressable_memory_unit_size_ftype) (struct gdbarch *gdbarch);
+extern int gdbarch_addressable_memory_unit_size (struct gdbarch *gdbarch);
+extern void set_gdbarch_addressable_memory_unit_size (struct gdbarch *gdbarch, gdbarch_addressable_memory_unit_size_ftype *addressable_memory_unit_size);
+
+/* Functions for allowing a target to modify its disassembler options. */
+
+extern const char * gdbarch_disassembler_options_implicit (struct gdbarch *gdbarch);
+extern void set_gdbarch_disassembler_options_implicit (struct gdbarch *gdbarch, const char * disassembler_options_implicit);
+
+extern char ** gdbarch_disassembler_options (struct gdbarch *gdbarch);
+extern void set_gdbarch_disassembler_options (struct gdbarch *gdbarch, char ** disassembler_options);
+
+extern const disasm_options_and_args_t * gdbarch_valid_disassembler_options (struct gdbarch *gdbarch);
+extern void set_gdbarch_valid_disassembler_options (struct gdbarch *gdbarch, const disasm_options_and_args_t * valid_disassembler_options);
+
+/* Type alignment override method.  Return the architecture specific
+   alignment required for TYPE.  If there is no special handling
+   required for TYPE then return the value 0, GDB will then apply the
+   default rules as laid out in gdbtypes.c:type_align. */
+
+typedef ULONGEST (gdbarch_type_align_ftype) (struct gdbarch *gdbarch, struct type *type);
+extern ULONGEST gdbarch_type_align (struct gdbarch *gdbarch, struct type *type);
+extern void set_gdbarch_type_align (struct gdbarch *gdbarch, gdbarch_type_align_ftype *type_align);
+
+/* Return a string containing any flags for the given PC in the given FRAME. */
+
+typedef std::string (gdbarch_get_pc_address_flags_ftype) (frame_info *frame, CORE_ADDR pc);
+extern std::string gdbarch_get_pc_address_flags (struct gdbarch *gdbarch, frame_info *frame, CORE_ADDR pc);
+extern void set_gdbarch_get_pc_address_flags (struct gdbarch *gdbarch, gdbarch_get_pc_address_flags_ftype *get_pc_address_flags);
+
+/* Read core file mappings */
+
+typedef void (gdbarch_read_core_file_mappings_ftype) (struct gdbarch *gdbarch, struct bfd *cbfd, read_core_file_mappings_pre_loop_ftype pre_loop_cb, read_core_file_mappings_loop_ftype loop_cb);
+extern void gdbarch_read_core_file_mappings (struct gdbarch *gdbarch, struct bfd *cbfd, read_core_file_mappings_pre_loop_ftype pre_loop_cb, read_core_file_mappings_loop_ftype loop_cb);
+extern void set_gdbarch_read_core_file_mappings (struct gdbarch *gdbarch, gdbarch_read_core_file_mappings_ftype *read_core_file_mappings);
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index eae5395af9c..c2fad6ff735 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -1,6 +1,3 @@
-/* *INDENT-OFF* */ /* THIS FILE IS GENERATED -*- buffer-read-only: t -*- */
-/* vi:set ro: */
-
 /* Dynamic architecture support for GDB, the GNU debugger.
 
    Copyright (C) 1998-2021 Free Software Foundation, Inc.
@@ -20,7 +17,6 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-/* This file was created with the aid of ``gdbarch.sh''.  */
 
 #ifndef GDBARCH_H
 #define GDBARCH_H
@@ -144,1589 +140,7 @@ using read_core_file_mappings_loop_ftype =
 			   const char *filename,
 			   const bfd_build_id *build_id)>;
 
-
-/* The following are pre-initialized by GDBARCH.  */
-
-extern const struct bfd_arch_info * gdbarch_bfd_arch_info (struct gdbarch *gdbarch);
-/* set_gdbarch_bfd_arch_info() - not applicable - pre-initialized.  */
-
-extern enum bfd_endian gdbarch_byte_order (struct gdbarch *gdbarch);
-/* set_gdbarch_byte_order() - not applicable - pre-initialized.  */
-
-extern enum bfd_endian gdbarch_byte_order_for_code (struct gdbarch *gdbarch);
-/* set_gdbarch_byte_order_for_code() - not applicable - pre-initialized.  */
-
-extern enum gdb_osabi gdbarch_osabi (struct gdbarch *gdbarch);
-/* set_gdbarch_osabi() - not applicable - pre-initialized.  */
-
-extern const struct target_desc * gdbarch_target_desc (struct gdbarch *gdbarch);
-/* set_gdbarch_target_desc() - not applicable - pre-initialized.  */
-
-
-/* The following are initialized by the target dependent code.  */
-
-/* Number of bits in a short or unsigned short for the target machine. */
-
-extern int gdbarch_short_bit (struct gdbarch *gdbarch);
-extern void set_gdbarch_short_bit (struct gdbarch *gdbarch, int short_bit);
-
-/* Number of bits in an int or unsigned int for the target machine. */
-
-extern int gdbarch_int_bit (struct gdbarch *gdbarch);
-extern void set_gdbarch_int_bit (struct gdbarch *gdbarch, int int_bit);
-
-/* Number of bits in a long or unsigned long for the target machine. */
-
-extern int gdbarch_long_bit (struct gdbarch *gdbarch);
-extern void set_gdbarch_long_bit (struct gdbarch *gdbarch, int long_bit);
-
-/* Number of bits in a long long or unsigned long long for the target
-   machine. */
-
-extern int gdbarch_long_long_bit (struct gdbarch *gdbarch);
-extern void set_gdbarch_long_long_bit (struct gdbarch *gdbarch, int long_long_bit);
-
-/* The ABI default bit-size and format for "bfloat16", "half", "float", "double", and
-   "long double".  These bit/format pairs should eventually be combined
-   into a single object.  For the moment, just initialize them as a pair.
-   Each format describes both the big and little endian layouts (if
-   useful). */
-
-extern int gdbarch_bfloat16_bit (struct gdbarch *gdbarch);
-extern void set_gdbarch_bfloat16_bit (struct gdbarch *gdbarch, int bfloat16_bit);
-
-extern const struct floatformat ** gdbarch_bfloat16_format (struct gdbarch *gdbarch);
-extern void set_gdbarch_bfloat16_format (struct gdbarch *gdbarch, const struct floatformat ** bfloat16_format);
-
-extern int gdbarch_half_bit (struct gdbarch *gdbarch);
-extern void set_gdbarch_half_bit (struct gdbarch *gdbarch, int half_bit);
-
-extern const struct floatformat ** gdbarch_half_format (struct gdbarch *gdbarch);
-extern void set_gdbarch_half_format (struct gdbarch *gdbarch, const struct floatformat ** half_format);
-
-extern int gdbarch_float_bit (struct gdbarch *gdbarch);
-extern void set_gdbarch_float_bit (struct gdbarch *gdbarch, int float_bit);
-
-extern const struct floatformat ** gdbarch_float_format (struct gdbarch *gdbarch);
-extern void set_gdbarch_float_format (struct gdbarch *gdbarch, const struct floatformat ** float_format);
-
-extern int gdbarch_double_bit (struct gdbarch *gdbarch);
-extern void set_gdbarch_double_bit (struct gdbarch *gdbarch, int double_bit);
-
-extern const struct floatformat ** gdbarch_double_format (struct gdbarch *gdbarch);
-extern void set_gdbarch_double_format (struct gdbarch *gdbarch, const struct floatformat ** double_format);
-
-extern int gdbarch_long_double_bit (struct gdbarch *gdbarch);
-extern void set_gdbarch_long_double_bit (struct gdbarch *gdbarch, int long_double_bit);
-
-extern const struct floatformat ** gdbarch_long_double_format (struct gdbarch *gdbarch);
-extern void set_gdbarch_long_double_format (struct gdbarch *gdbarch, const struct floatformat ** long_double_format);
-
-/* The ABI default bit-size for "wchar_t".  wchar_t is a built-in type
-   starting with C++11. */
-
-extern int gdbarch_wchar_bit (struct gdbarch *gdbarch);
-extern void set_gdbarch_wchar_bit (struct gdbarch *gdbarch, int wchar_bit);
-
-/* One if `wchar_t' is signed, zero if unsigned. */
-
-extern int gdbarch_wchar_signed (struct gdbarch *gdbarch);
-extern void set_gdbarch_wchar_signed (struct gdbarch *gdbarch, int wchar_signed);
-
-/* Returns the floating-point format to be used for values of length LENGTH.
-   NAME, if non-NULL, is the type name, which may be used to distinguish
-   different target formats of the same length. */
-
-typedef const struct floatformat ** (gdbarch_floatformat_for_type_ftype) (struct gdbarch *gdbarch, const char *name, int length);
-extern const struct floatformat ** gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, int length);
-extern void set_gdbarch_floatformat_for_type (struct gdbarch *gdbarch, gdbarch_floatformat_for_type_ftype *floatformat_for_type);
-
-/* For most targets, a pointer on the target and its representation as an
-   address in GDB have the same size and "look the same".  For such a
-   target, you need only set gdbarch_ptr_bit and gdbarch_addr_bit
-   / addr_bit will be set from it.
-  
-   If gdbarch_ptr_bit and gdbarch_addr_bit are different, you'll probably
-   also need to set gdbarch_dwarf2_addr_size, gdbarch_pointer_to_address and
-   gdbarch_address_to_pointer as well.
-  
-   ptr_bit is the size of a pointer on the target */
-
-extern int gdbarch_ptr_bit (struct gdbarch *gdbarch);
-extern void set_gdbarch_ptr_bit (struct gdbarch *gdbarch, int ptr_bit);
-
-/* addr_bit is the size of a target address as represented in gdb */
-
-extern int gdbarch_addr_bit (struct gdbarch *gdbarch);
-extern void set_gdbarch_addr_bit (struct gdbarch *gdbarch, int addr_bit);
-
-/* dwarf2_addr_size is the target address size as used in the Dwarf debug
-   info.  For .debug_frame FDEs, this is supposed to be the target address
-   size from the associated CU header, and which is equivalent to the
-   DWARF2_ADDR_SIZE as defined by the target specific GCC back-end.
-   Unfortunately there is no good way to determine this value.  Therefore
-   dwarf2_addr_size simply defaults to the target pointer size.
-  
-   dwarf2_addr_size is not used for .eh_frame FDEs, which are generally
-   defined using the target's pointer size so far.
-  
-   Note that dwarf2_addr_size only needs to be redefined by a target if the
-   GCC back-end defines a DWARF2_ADDR_SIZE other than the target pointer size,
-   and if Dwarf versions < 4 need to be supported. */
-
-extern int gdbarch_dwarf2_addr_size (struct gdbarch *gdbarch);
-extern void set_gdbarch_dwarf2_addr_size (struct gdbarch *gdbarch, int dwarf2_addr_size);
-
-/* One if `char' acts like `signed char', zero if `unsigned char'. */
-
-extern int gdbarch_char_signed (struct gdbarch *gdbarch);
-extern void set_gdbarch_char_signed (struct gdbarch *gdbarch, int char_signed);
-
-extern bool gdbarch_read_pc_p (struct gdbarch *gdbarch);
-
-typedef CORE_ADDR (gdbarch_read_pc_ftype) (readable_regcache *regcache);
-extern CORE_ADDR gdbarch_read_pc (struct gdbarch *gdbarch, readable_regcache *regcache);
-extern void set_gdbarch_read_pc (struct gdbarch *gdbarch, gdbarch_read_pc_ftype *read_pc);
-
-extern bool gdbarch_write_pc_p (struct gdbarch *gdbarch);
-
-typedef void (gdbarch_write_pc_ftype) (struct regcache *regcache, CORE_ADDR val);
-extern void gdbarch_write_pc (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR val);
-extern void set_gdbarch_write_pc (struct gdbarch *gdbarch, gdbarch_write_pc_ftype *write_pc);
-
-/* Function for getting target's idea of a frame pointer.  FIXME: GDB's
-   whole scheme for dealing with "frames" and "frame pointers" needs a
-   serious shakedown. */
-
-typedef void (gdbarch_virtual_frame_pointer_ftype) (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset);
-extern void gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset);
-extern void set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer);
-
-extern bool gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch);
-
-typedef enum register_status (gdbarch_pseudo_register_read_ftype) (struct gdbarch *gdbarch, readable_regcache *regcache, int cookednum, gdb_byte *buf);
-extern enum register_status gdbarch_pseudo_register_read (struct gdbarch *gdbarch, readable_regcache *regcache, int cookednum, gdb_byte *buf);
-extern void set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch, gdbarch_pseudo_register_read_ftype *pseudo_register_read);
-
-/* Read a register into a new struct value.  If the register is wholly
-   or partly unavailable, this should call mark_value_bytes_unavailable
-   as appropriate.  If this is defined, then pseudo_register_read will
-   never be called. */
-
-extern bool gdbarch_pseudo_register_read_value_p (struct gdbarch *gdbarch);
-
-typedef struct value * (gdbarch_pseudo_register_read_value_ftype) (struct gdbarch *gdbarch, readable_regcache *regcache, int cookednum);
-extern struct value * gdbarch_pseudo_register_read_value (struct gdbarch *gdbarch, readable_regcache *regcache, int cookednum);
-extern void set_gdbarch_pseudo_register_read_value (struct gdbarch *gdbarch, gdbarch_pseudo_register_read_value_ftype *pseudo_register_read_value);
-
-extern bool gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch);
-
-typedef void (gdbarch_pseudo_register_write_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf);
-extern void gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf);
-extern void set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch, gdbarch_pseudo_register_write_ftype *pseudo_register_write);
-
-extern int gdbarch_num_regs (struct gdbarch *gdbarch);
-extern void set_gdbarch_num_regs (struct gdbarch *gdbarch, int num_regs);
-
-/* This macro gives the number of pseudo-registers that live in the
-   register namespace but do not get fetched or stored on the target.
-   These pseudo-registers may be aliases for other registers,
-   combinations of other registers, or they may be computed by GDB. */
-
-extern int gdbarch_num_pseudo_regs (struct gdbarch *gdbarch);
-extern void set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, int num_pseudo_regs);
-
-/* Assemble agent expression bytecode to collect pseudo-register REG.
-   Return -1 if something goes wrong, 0 otherwise. */
-
-extern bool gdbarch_ax_pseudo_register_collect_p (struct gdbarch *gdbarch);
-
-typedef int (gdbarch_ax_pseudo_register_collect_ftype) (struct gdbarch *gdbarch, struct agent_expr *ax, int reg);
-extern int gdbarch_ax_pseudo_register_collect (struct gdbarch *gdbarch, struct agent_expr *ax, int reg);
-extern void set_gdbarch_ax_pseudo_register_collect (struct gdbarch *gdbarch, gdbarch_ax_pseudo_register_collect_ftype *ax_pseudo_register_collect);
-
-/* Assemble agent expression bytecode to push the value of pseudo-register
-   REG on the interpreter stack.
-   Return -1 if something goes wrong, 0 otherwise. */
-
-extern bool gdbarch_ax_pseudo_register_push_stack_p (struct gdbarch *gdbarch);
-
-typedef int (gdbarch_ax_pseudo_register_push_stack_ftype) (struct gdbarch *gdbarch, struct agent_expr *ax, int reg);
-extern int gdbarch_ax_pseudo_register_push_stack (struct gdbarch *gdbarch, struct agent_expr *ax, int reg);
-extern void set_gdbarch_ax_pseudo_register_push_stack (struct gdbarch *gdbarch, gdbarch_ax_pseudo_register_push_stack_ftype *ax_pseudo_register_push_stack);
-
-/* Some architectures can display additional information for specific
-   signals.
-   UIOUT is the output stream where the handler will place information. */
-
-extern bool gdbarch_report_signal_info_p (struct gdbarch *gdbarch);
-
-typedef void (gdbarch_report_signal_info_ftype) (struct gdbarch *gdbarch, struct ui_out *uiout, enum gdb_signal siggnal);
-extern void gdbarch_report_signal_info (struct gdbarch *gdbarch, struct ui_out *uiout, enum gdb_signal siggnal);
-extern void set_gdbarch_report_signal_info (struct gdbarch *gdbarch, gdbarch_report_signal_info_ftype *report_signal_info);
-
-/* GDB's standard (or well known) register numbers.  These can map onto
-   a real register or a pseudo (computed) register or not be defined at
-   all (-1).
-   gdbarch_sp_regnum will hopefully be replaced by UNWIND_SP. */
-
-extern int gdbarch_sp_regnum (struct gdbarch *gdbarch);
-extern void set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int sp_regnum);
-
-extern int gdbarch_pc_regnum (struct gdbarch *gdbarch);
-extern void set_gdbarch_pc_regnum (struct gdbarch *gdbarch, int pc_regnum);
-
-extern int gdbarch_ps_regnum (struct gdbarch *gdbarch);
-extern void set_gdbarch_ps_regnum (struct gdbarch *gdbarch, int ps_regnum);
-
-extern int gdbarch_fp0_regnum (struct gdbarch *gdbarch);
-extern void set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, int fp0_regnum);
-
-/* Convert stab register number (from `r' declaration) to a gdb REGNUM. */
-
-typedef int (gdbarch_stab_reg_to_regnum_ftype) (struct gdbarch *gdbarch, int stab_regnr);
-extern int gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr);
-extern void set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum);
-
-/* Provide a default mapping from a ecoff register number to a gdb REGNUM. */
-
-typedef int (gdbarch_ecoff_reg_to_regnum_ftype) (struct gdbarch *gdbarch, int ecoff_regnr);
-extern int gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr);
-extern void set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum);
-
-/* Convert from an sdb register number to an internal gdb register number. */
-
-typedef int (gdbarch_sdb_reg_to_regnum_ftype) (struct gdbarch *gdbarch, int sdb_regnr);
-extern int gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr);
-extern void set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum);
-
-/* Provide a default mapping from a DWARF2 register number to a gdb REGNUM.
-   Return -1 for bad REGNUM.  Note: Several targets get this wrong. */
-
-typedef int (gdbarch_dwarf2_reg_to_regnum_ftype) (struct gdbarch *gdbarch, int dwarf2_regnr);
-extern int gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr);
-extern void set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum);
-
-typedef const char * (gdbarch_register_name_ftype) (struct gdbarch *gdbarch, int regnr);
-extern const char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr);
-extern void set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name);
-
-/* Return the type of a register specified by the architecture.  Only
-   the register cache should call this function directly; others should
-   use "register_type". */
-
-extern bool gdbarch_register_type_p (struct gdbarch *gdbarch);
-
-typedef struct type * (gdbarch_register_type_ftype) (struct gdbarch *gdbarch, int reg_nr);
-extern struct type * gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr);
-extern void set_gdbarch_register_type (struct gdbarch *gdbarch, gdbarch_register_type_ftype *register_type);
-
-/* Generate a dummy frame_id for THIS_FRAME assuming that the frame is
-   a dummy frame.  A dummy frame is created before an inferior call,
-   the frame_id returned here must match the frame_id that was built
-   for the inferior call.  Usually this means the returned frame_id's
-   stack address should match the address returned by
-   gdbarch_push_dummy_call, and the returned frame_id's code address
-   should match the address at which the breakpoint was set in the dummy
-   frame. */
-
-typedef struct frame_id (gdbarch_dummy_id_ftype) (struct gdbarch *gdbarch, struct frame_info *this_frame);
-extern struct frame_id gdbarch_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame);
-extern void set_gdbarch_dummy_id (struct gdbarch *gdbarch, gdbarch_dummy_id_ftype *dummy_id);
-
-/* Implement DUMMY_ID and PUSH_DUMMY_CALL, then delete
-   deprecated_fp_regnum. */
-
-extern int gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch);
-extern void set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch, int deprecated_fp_regnum);
-
-extern bool gdbarch_push_dummy_call_p (struct gdbarch *gdbarch);
-
-typedef CORE_ADDR (gdbarch_push_dummy_call_ftype) (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, function_call_return_method return_method, CORE_ADDR struct_addr);
-extern CORE_ADDR gdbarch_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, function_call_return_method return_method, CORE_ADDR struct_addr);
-extern void set_gdbarch_push_dummy_call (struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype *push_dummy_call);
-
-extern int gdbarch_call_dummy_location (struct gdbarch *gdbarch);
-extern void set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, int call_dummy_location);
-
-extern bool gdbarch_push_dummy_code_p (struct gdbarch *gdbarch);
-
-typedef CORE_ADDR (gdbarch_push_dummy_code_ftype) (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache);
-extern CORE_ADDR gdbarch_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache);
-extern void set_gdbarch_push_dummy_code (struct gdbarch *gdbarch, gdbarch_push_dummy_code_ftype *push_dummy_code);
-
-/* Return true if the code of FRAME is writable. */
-
-typedef int (gdbarch_code_of_frame_writable_ftype) (struct gdbarch *gdbarch, struct frame_info *frame);
-extern int gdbarch_code_of_frame_writable (struct gdbarch *gdbarch, struct frame_info *frame);
-extern void set_gdbarch_code_of_frame_writable (struct gdbarch *gdbarch, gdbarch_code_of_frame_writable_ftype *code_of_frame_writable);
-
-typedef void (gdbarch_print_registers_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all);
-extern void gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all);
-extern void set_gdbarch_print_registers_info (struct gdbarch *gdbarch, gdbarch_print_registers_info_ftype *print_registers_info);
-
-typedef void (gdbarch_print_float_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
-extern void gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
-extern void set_gdbarch_print_float_info (struct gdbarch *gdbarch, gdbarch_print_float_info_ftype *print_float_info);
-
-extern bool gdbarch_print_vector_info_p (struct gdbarch *gdbarch);
-
-typedef void (gdbarch_print_vector_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
-extern void gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
-extern void set_gdbarch_print_vector_info (struct gdbarch *gdbarch, gdbarch_print_vector_info_ftype *print_vector_info);
-
-/* MAP a GDB RAW register number onto a simulator register number.  See
-   also include/...-sim.h. */
-
-typedef int (gdbarch_register_sim_regno_ftype) (struct gdbarch *gdbarch, int reg_nr);
-extern int gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr);
-extern void set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, gdbarch_register_sim_regno_ftype *register_sim_regno);
-
-typedef int (gdbarch_cannot_fetch_register_ftype) (struct gdbarch *gdbarch, int regnum);
-extern int gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum);
-extern void set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, gdbarch_cannot_fetch_register_ftype *cannot_fetch_register);
-
-typedef int (gdbarch_cannot_store_register_ftype) (struct gdbarch *gdbarch, int regnum);
-extern int gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum);
-extern void set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, gdbarch_cannot_store_register_ftype *cannot_store_register);
-
-/* Determine the address where a longjmp will land and save this address
-   in PC.  Return nonzero on success.
-  
-   FRAME corresponds to the longjmp frame. */
-
-extern bool gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch);
-
-typedef int (gdbarch_get_longjmp_target_ftype) (struct frame_info *frame, CORE_ADDR *pc);
-extern int gdbarch_get_longjmp_target (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR *pc);
-extern void set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch, gdbarch_get_longjmp_target_ftype *get_longjmp_target);
-
-extern int gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch);
-extern void set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, int believe_pcc_promotion);
-
-typedef int (gdbarch_convert_register_p_ftype) (struct gdbarch *gdbarch, int regnum, struct type *type);
-extern int gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type);
-extern void set_gdbarch_convert_register_p (struct gdbarch *gdbarch, gdbarch_convert_register_p_ftype *convert_register_p);
-
-typedef int (gdbarch_register_to_value_ftype) (struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf, int *optimizedp, int *unavailablep);
-extern int gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf, int *optimizedp, int *unavailablep);
-extern void set_gdbarch_register_to_value (struct gdbarch *gdbarch, gdbarch_register_to_value_ftype *register_to_value);
-
-typedef void (gdbarch_value_to_register_ftype) (struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf);
-extern void gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf);
-extern void set_gdbarch_value_to_register (struct gdbarch *gdbarch, gdbarch_value_to_register_ftype *value_to_register);
-
-/* Construct a value representing the contents of register REGNUM in
-   frame FRAME_ID, interpreted as type TYPE.  The routine needs to
-   allocate and return a struct value with all value attributes
-   (but not the value contents) filled in. */
-
-typedef struct value * (gdbarch_value_from_register_ftype) (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_id frame_id);
-extern struct value * gdbarch_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_id frame_id);
-extern void set_gdbarch_value_from_register (struct gdbarch *gdbarch, gdbarch_value_from_register_ftype *value_from_register);
-
-typedef CORE_ADDR (gdbarch_pointer_to_address_ftype) (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf);
-extern CORE_ADDR gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf);
-extern void set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, gdbarch_pointer_to_address_ftype *pointer_to_address);
-
-typedef void (gdbarch_address_to_pointer_ftype) (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr);
-extern void gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr);
-extern void set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, gdbarch_address_to_pointer_ftype *address_to_pointer);
-
-extern bool gdbarch_integer_to_address_p (struct gdbarch *gdbarch);
-
-typedef CORE_ADDR (gdbarch_integer_to_address_ftype) (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf);
-extern CORE_ADDR gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf);
-extern void set_gdbarch_integer_to_address (struct gdbarch *gdbarch, gdbarch_integer_to_address_ftype *integer_to_address);
-
-/* Return the return-value convention that will be used by FUNCTION
-   to return a value of type VALTYPE.  FUNCTION may be NULL in which
-   case the return convention is computed based only on VALTYPE.
-  
-   If READBUF is not NULL, extract the return value and save it in this buffer.
-  
-   If WRITEBUF is not NULL, it contains a return value which will be
-   stored into the appropriate register.  This can be used when we want
-   to force the value returned by a function (see the "return" command
-   for instance). */
-
-extern bool gdbarch_return_value_p (struct gdbarch *gdbarch);
-
-typedef enum return_value_convention (gdbarch_return_value_ftype) (struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf);
-extern enum return_value_convention gdbarch_return_value (struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf);
-extern void set_gdbarch_return_value (struct gdbarch *gdbarch, gdbarch_return_value_ftype *return_value);
-
-/* Return true if the return value of function is stored in the first hidden
-   parameter.  In theory, this feature should be language-dependent, specified
-   by language and its ABI, such as C++.  Unfortunately, compiler may
-   implement it to a target-dependent feature.  So that we need such hook here
-   to be aware of this in GDB. */
-
-typedef int (gdbarch_return_in_first_hidden_param_p_ftype) (struct gdbarch *gdbarch, struct type *type);
-extern int gdbarch_return_in_first_hidden_param_p (struct gdbarch *gdbarch, struct type *type);
-extern void set_gdbarch_return_in_first_hidden_param_p (struct gdbarch *gdbarch, gdbarch_return_in_first_hidden_param_p_ftype *return_in_first_hidden_param_p);
-
-typedef CORE_ADDR (gdbarch_skip_prologue_ftype) (struct gdbarch *gdbarch, CORE_ADDR ip);
-extern CORE_ADDR gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip);
-extern void set_gdbarch_skip_prologue (struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype *skip_prologue);
-
-extern bool gdbarch_skip_main_prologue_p (struct gdbarch *gdbarch);
-
-typedef CORE_ADDR (gdbarch_skip_main_prologue_ftype) (struct gdbarch *gdbarch, CORE_ADDR ip);
-extern CORE_ADDR gdbarch_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR ip);
-extern void set_gdbarch_skip_main_prologue (struct gdbarch *gdbarch, gdbarch_skip_main_prologue_ftype *skip_main_prologue);
-
-/* On some platforms, a single function may provide multiple entry points,
-   e.g. one that is used for function-pointer calls and a different one
-   that is used for direct function calls.
-   In order to ensure that breakpoints set on the function will trigger
-   no matter via which entry point the function is entered, a platform
-   may provide the skip_entrypoint callback.  It is called with IP set
-   to the main entry point of a function (as determined by the symbol table),
-   and should return the address of the innermost entry point, where the
-   actual breakpoint needs to be set.  Note that skip_entrypoint is used
-   by GDB common code even when debugging optimized code, where skip_prologue
-   is not used. */
-
-extern bool gdbarch_skip_entrypoint_p (struct gdbarch *gdbarch);
-
-typedef CORE_ADDR (gdbarch_skip_entrypoint_ftype) (struct gdbarch *gdbarch, CORE_ADDR ip);
-extern CORE_ADDR gdbarch_skip_entrypoint (struct gdbarch *gdbarch, CORE_ADDR ip);
-extern void set_gdbarch_skip_entrypoint (struct gdbarch *gdbarch, gdbarch_skip_entrypoint_ftype *skip_entrypoint);
-
-typedef int (gdbarch_inner_than_ftype) (CORE_ADDR lhs, CORE_ADDR rhs);
-extern int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs);
-extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than);
-
-typedef const gdb_byte * (gdbarch_breakpoint_from_pc_ftype) (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr);
-extern const gdb_byte * gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr);
-extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc);
-
-/* Return the breakpoint kind for this target based on *PCPTR. */
-
-typedef int (gdbarch_breakpoint_kind_from_pc_ftype) (struct gdbarch *gdbarch, CORE_ADDR *pcptr);
-extern int gdbarch_breakpoint_kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr);
-extern void set_gdbarch_breakpoint_kind_from_pc (struct gdbarch *gdbarch, gdbarch_breakpoint_kind_from_pc_ftype *breakpoint_kind_from_pc);
-
-/* Return the software breakpoint from KIND.  KIND can have target
-   specific meaning like the Z0 kind parameter.
-   SIZE is set to the software breakpoint's length in memory. */
-
-typedef const gdb_byte * (gdbarch_sw_breakpoint_from_kind_ftype) (struct gdbarch *gdbarch, int kind, int *size);
-extern const gdb_byte * gdbarch_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size);
-extern void set_gdbarch_sw_breakpoint_from_kind (struct gdbarch *gdbarch, gdbarch_sw_breakpoint_from_kind_ftype *sw_breakpoint_from_kind);
-
-/* Return the breakpoint kind for this target based on the current
-   processor state (e.g. the current instruction mode on ARM) and the
-   *PCPTR.  In default, it is gdbarch->breakpoint_kind_from_pc. */
-
-typedef int (gdbarch_breakpoint_kind_from_current_state_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR *pcptr);
-extern int gdbarch_breakpoint_kind_from_current_state (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR *pcptr);
-extern void set_gdbarch_breakpoint_kind_from_current_state (struct gdbarch *gdbarch, gdbarch_breakpoint_kind_from_current_state_ftype *breakpoint_kind_from_current_state);
-
-extern bool gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch);
-
-typedef CORE_ADDR (gdbarch_adjust_breakpoint_address_ftype) (struct gdbarch *gdbarch, CORE_ADDR bpaddr);
-extern CORE_ADDR gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr);
-extern void set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address);
-
-typedef int (gdbarch_memory_insert_breakpoint_ftype) (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt);
-extern int gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt);
-extern void set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint);
-
-typedef int (gdbarch_memory_remove_breakpoint_ftype) (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt);
-extern int gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt);
-extern void set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint);
-
-extern CORE_ADDR gdbarch_decr_pc_after_break (struct gdbarch *gdbarch);
-extern void set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, CORE_ADDR decr_pc_after_break);
-
-/* A function can be addressed by either it's "pointer" (possibly a
-   descriptor address) or "entry point" (first executable instruction).
-   The method "convert_from_func_ptr_addr" converting the former to the
-   latter.  gdbarch_deprecated_function_start_offset is being used to implement
-   a simplified subset of that functionality - the function's address
-   corresponds to the "function pointer" and the function's start
-   corresponds to the "function entry point" - and hence is redundant. */
-
-extern CORE_ADDR gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch);
-extern void set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch, CORE_ADDR deprecated_function_start_offset);
-
-/* Return the remote protocol register number associated with this
-   register.  Normally the identity mapping. */
-
-typedef int (gdbarch_remote_register_number_ftype) (struct gdbarch *gdbarch, int regno);
-extern int gdbarch_remote_register_number (struct gdbarch *gdbarch, int regno);
-extern void set_gdbarch_remote_register_number (struct gdbarch *gdbarch, gdbarch_remote_register_number_ftype *remote_register_number);
-
-/* Fetch the target specific address used to represent a load module. */
-
-extern bool gdbarch_fetch_tls_load_module_address_p (struct gdbarch *gdbarch);
-
-typedef CORE_ADDR (gdbarch_fetch_tls_load_module_address_ftype) (struct objfile *objfile);
-extern CORE_ADDR gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, struct objfile *objfile);
-extern void set_gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, gdbarch_fetch_tls_load_module_address_ftype *fetch_tls_load_module_address);
-
-/* Return the thread-local address at OFFSET in the thread-local
-   storage for the thread PTID and the shared library or executable
-   file given by LM_ADDR.  If that block of thread-local storage hasn't
-   been allocated yet, this function may throw an error.  LM_ADDR may
-   be zero for statically linked multithreaded inferiors. */
-
-extern bool gdbarch_get_thread_local_address_p (struct gdbarch *gdbarch);
-
-typedef CORE_ADDR (gdbarch_get_thread_local_address_ftype) (struct gdbarch *gdbarch, ptid_t ptid, CORE_ADDR lm_addr, CORE_ADDR offset);
-extern CORE_ADDR gdbarch_get_thread_local_address (struct gdbarch *gdbarch, ptid_t ptid, CORE_ADDR lm_addr, CORE_ADDR offset);
-extern void set_gdbarch_get_thread_local_address (struct gdbarch *gdbarch, gdbarch_get_thread_local_address_ftype *get_thread_local_address);
-
-extern CORE_ADDR gdbarch_frame_args_skip (struct gdbarch *gdbarch);
-extern void set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, CORE_ADDR frame_args_skip);
-
-typedef CORE_ADDR (gdbarch_unwind_pc_ftype) (struct gdbarch *gdbarch, struct frame_info *next_frame);
-extern CORE_ADDR gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame);
-extern void set_gdbarch_unwind_pc (struct gdbarch *gdbarch, gdbarch_unwind_pc_ftype *unwind_pc);
-
-typedef CORE_ADDR (gdbarch_unwind_sp_ftype) (struct gdbarch *gdbarch, struct frame_info *next_frame);
-extern CORE_ADDR gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame);
-extern void set_gdbarch_unwind_sp (struct gdbarch *gdbarch, gdbarch_unwind_sp_ftype *unwind_sp);
-
-/* DEPRECATED_FRAME_LOCALS_ADDRESS as been replaced by the per-frame
-   frame-base.  Enable frame-base before frame-unwind. */
-
-extern bool gdbarch_frame_num_args_p (struct gdbarch *gdbarch);
-
-typedef int (gdbarch_frame_num_args_ftype) (struct frame_info *frame);
-extern int gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame);
-extern void set_gdbarch_frame_num_args (struct gdbarch *gdbarch, gdbarch_frame_num_args_ftype *frame_num_args);
-
-extern bool gdbarch_frame_align_p (struct gdbarch *gdbarch);
-
-typedef CORE_ADDR (gdbarch_frame_align_ftype) (struct gdbarch *gdbarch, CORE_ADDR address);
-extern CORE_ADDR gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address);
-extern void set_gdbarch_frame_align (struct gdbarch *gdbarch, gdbarch_frame_align_ftype *frame_align);
-
-typedef int (gdbarch_stabs_argument_has_addr_ftype) (struct gdbarch *gdbarch, struct type *type);
-extern int gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type);
-extern void set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr);
-
-extern int gdbarch_frame_red_zone_size (struct gdbarch *gdbarch);
-extern void set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch, int frame_red_zone_size);
-
-typedef CORE_ADDR (gdbarch_convert_from_func_ptr_addr_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ);
-extern CORE_ADDR gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ);
-extern void set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr);
-
-/* On some machines there are bits in addresses which are not really
-   part of the address, but are used by the kernel, the hardware, etc.
-   for special purposes.  gdbarch_addr_bits_remove takes out any such bits so
-   we get a "real" address such as one would find in a symbol table.
-   This is used only for addresses of instructions, and even then I'm
-   not sure it's used in all contexts.  It exists to deal with there
-   being a few stray bits in the PC which would mislead us, not as some
-   sort of generic thing to handle alignment or segmentation (it's
-   possible it should be in TARGET_READ_PC instead). */
-
-typedef CORE_ADDR (gdbarch_addr_bits_remove_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
-extern CORE_ADDR gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr);
-extern void set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, gdbarch_addr_bits_remove_ftype *addr_bits_remove);
-
-/* On some machines, not all bits of an address word are significant.
-   For example, on AArch64, the top bits of an address known as the "tag"
-   are ignored by the kernel, the hardware, etc. and can be regarded as
-   additional data associated with the address. */
-
-extern int gdbarch_significant_addr_bit (struct gdbarch *gdbarch);
-extern void set_gdbarch_significant_addr_bit (struct gdbarch *gdbarch, int significant_addr_bit);
-
-/* Return a string representation of the memory tag TAG. */
-
-typedef std::string (gdbarch_memtag_to_string_ftype) (struct gdbarch *gdbarch, struct value *tag);
-extern std::string gdbarch_memtag_to_string (struct gdbarch *gdbarch, struct value *tag);
-extern void set_gdbarch_memtag_to_string (struct gdbarch *gdbarch, gdbarch_memtag_to_string_ftype *memtag_to_string);
-
-/* Return true if ADDRESS contains a tag and false otherwise.  ADDRESS
-   must be either a pointer or a reference type. */
-
-typedef bool (gdbarch_tagged_address_p_ftype) (struct gdbarch *gdbarch, struct value *address);
-extern bool gdbarch_tagged_address_p (struct gdbarch *gdbarch, struct value *address);
-extern void set_gdbarch_tagged_address_p (struct gdbarch *gdbarch, gdbarch_tagged_address_p_ftype *tagged_address_p);
-
-/* Return true if the tag from ADDRESS matches the memory tag for that
-   particular address.  Return false otherwise. */
-
-typedef bool (gdbarch_memtag_matches_p_ftype) (struct gdbarch *gdbarch, struct value *address);
-extern bool gdbarch_memtag_matches_p (struct gdbarch *gdbarch, struct value *address);
-extern void set_gdbarch_memtag_matches_p (struct gdbarch *gdbarch, gdbarch_memtag_matches_p_ftype *memtag_matches_p);
-
-/* Set the tags of type TAG_TYPE, for the memory address range
-   [ADDRESS, ADDRESS + LENGTH) to TAGS.
-   Return true if successful and false otherwise. */
-
-typedef bool (gdbarch_set_memtags_ftype) (struct gdbarch *gdbarch, struct value *address, size_t length, const gdb::byte_vector &tags, memtag_type tag_type);
-extern bool gdbarch_set_memtags (struct gdbarch *gdbarch, struct value *address, size_t length, const gdb::byte_vector &tags, memtag_type tag_type);
-extern void set_gdbarch_set_memtags (struct gdbarch *gdbarch, gdbarch_set_memtags_ftype *set_memtags);
-
-/* Return the tag of type TAG_TYPE associated with the memory address ADDRESS,
-   assuming ADDRESS is tagged. */
-
-typedef struct value * (gdbarch_get_memtag_ftype) (struct gdbarch *gdbarch, struct value *address, memtag_type tag_type);
-extern struct value * gdbarch_get_memtag (struct gdbarch *gdbarch, struct value *address, memtag_type tag_type);
-extern void set_gdbarch_get_memtag (struct gdbarch *gdbarch, gdbarch_get_memtag_ftype *get_memtag);
-
-/* memtag_granule_size is the size of the allocation tag granule, for
-   architectures that support memory tagging.
-   This is 0 for architectures that do not support memory tagging.
-   For a non-zero value, this represents the number of bytes of memory per tag. */
-
-extern CORE_ADDR gdbarch_memtag_granule_size (struct gdbarch *gdbarch);
-extern void set_gdbarch_memtag_granule_size (struct gdbarch *gdbarch, CORE_ADDR memtag_granule_size);
-
-/* FIXME/cagney/2001-01-18: This should be split in two.  A target method that
-   indicates if the target needs software single step.  An ISA method to
-   implement it.
-  
-   FIXME/cagney/2001-01-18: The logic is backwards.  It should be asking if the
-   target can single step.  If not, then implement single step using breakpoints.
-  
-   Return a vector of addresses on which the software single step
-   breakpoints should be inserted.  NULL means software single step is
-   not used.
-   Multiple breakpoints may be inserted for some instructions such as
-   conditional branch.  However, each implementation must always evaluate
-   the condition and only put the breakpoint at the branch destination if
-   the condition is true, so that we ensure forward progress when stepping
-   past a conditional branch to self. */
-
-extern bool gdbarch_software_single_step_p (struct gdbarch *gdbarch);
-
-typedef std::vector<CORE_ADDR> (gdbarch_software_single_step_ftype) (struct regcache *regcache);
-extern std::vector<CORE_ADDR> gdbarch_software_single_step (struct gdbarch *gdbarch, struct regcache *regcache);
-extern void set_gdbarch_software_single_step (struct gdbarch *gdbarch, gdbarch_software_single_step_ftype *software_single_step);
-
-/* Return non-zero if the processor is executing a delay slot and a
-   further single-step is needed before the instruction finishes. */
-
-extern bool gdbarch_single_step_through_delay_p (struct gdbarch *gdbarch);
-
-typedef int (gdbarch_single_step_through_delay_ftype) (struct gdbarch *gdbarch, struct frame_info *frame);
-extern int gdbarch_single_step_through_delay (struct gdbarch *gdbarch, struct frame_info *frame);
-extern void set_gdbarch_single_step_through_delay (struct gdbarch *gdbarch, gdbarch_single_step_through_delay_ftype *single_step_through_delay);
-
-/* FIXME: cagney/2003-08-28: Need to find a better way of selecting the
-   disassembler.  Perhaps objdump can handle it? */
-
-typedef int (gdbarch_print_insn_ftype) (bfd_vma vma, struct disassemble_info *info);
-extern int gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info);
-extern void set_gdbarch_print_insn (struct gdbarch *gdbarch, gdbarch_print_insn_ftype *print_insn);
-
-typedef CORE_ADDR (gdbarch_skip_trampoline_code_ftype) (struct frame_info *frame, CORE_ADDR pc);
-extern CORE_ADDR gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR pc);
-extern void set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, gdbarch_skip_trampoline_code_ftype *skip_trampoline_code);
-
-/* If in_solib_dynsym_resolve_code() returns true, and SKIP_SOLIB_RESOLVER
-   evaluates non-zero, this is the address where the debugger will place
-   a step-resume breakpoint to get us past the dynamic linker. */
-
-typedef CORE_ADDR (gdbarch_skip_solib_resolver_ftype) (struct gdbarch *gdbarch, CORE_ADDR pc);
-extern CORE_ADDR gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc);
-extern void set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, gdbarch_skip_solib_resolver_ftype *skip_solib_resolver);
-
-/* Some systems also have trampoline code for returning from shared libs. */
-
-typedef int (gdbarch_in_solib_return_trampoline_ftype) (struct gdbarch *gdbarch, CORE_ADDR pc, const char *name);
-extern int gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, const char *name);
-extern void set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline);
-
-/* Return true if PC lies inside an indirect branch thunk. */
-
-typedef bool (gdbarch_in_indirect_branch_thunk_ftype) (struct gdbarch *gdbarch, CORE_ADDR pc);
-extern bool gdbarch_in_indirect_branch_thunk (struct gdbarch *gdbarch, CORE_ADDR pc);
-extern void set_gdbarch_in_indirect_branch_thunk (struct gdbarch *gdbarch, gdbarch_in_indirect_branch_thunk_ftype *in_indirect_branch_thunk);
-
-/* A target might have problems with watchpoints as soon as the stack
-   frame of the current function has been destroyed.  This mostly happens
-   as the first action in a function's epilogue.  stack_frame_destroyed_p()
-   is defined to return a non-zero value if either the given addr is one
-   instruction after the stack destroying instruction up to the trailing
-   return instruction or if we can figure out that the stack frame has
-   already been invalidated regardless of the value of addr.  Targets
-   which don't suffer from that problem could just let this functionality
-   untouched. */
-
-typedef int (gdbarch_stack_frame_destroyed_p_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
-extern int gdbarch_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR addr);
-extern void set_gdbarch_stack_frame_destroyed_p (struct gdbarch *gdbarch, gdbarch_stack_frame_destroyed_p_ftype *stack_frame_destroyed_p);
-
-/* Process an ELF symbol in the minimal symbol table in a backend-specific
-   way.  Normally this hook is supposed to do nothing, however if required,
-   then this hook can be used to apply tranformations to symbols that are
-   considered special in some way.  For example the MIPS backend uses it
-   to interpret `st_other' information to mark compressed code symbols so
-   that they can be treated in the appropriate manner in the processing of
-   the main symbol table and DWARF-2 records. */
-
-extern bool gdbarch_elf_make_msymbol_special_p (struct gdbarch *gdbarch);
-
-typedef void (gdbarch_elf_make_msymbol_special_ftype) (asymbol *sym, struct minimal_symbol *msym);
-extern void gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym);
-extern void set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special);
-
-typedef void (gdbarch_coff_make_msymbol_special_ftype) (int val, struct minimal_symbol *msym);
-extern void gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym);
-extern void set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special);
-
-/* Process a symbol in the main symbol table in a backend-specific way.
-   Normally this hook is supposed to do nothing, however if required,
-   then this hook can be used to apply tranformations to symbols that
-   are considered special in some way.  This is currently used by the
-   MIPS backend to make sure compressed code symbols have the ISA bit
-   set.  This in turn is needed for symbol values seen in GDB to match
-   the values used at the runtime by the program itself, for function
-   and label references. */
-
-typedef void (gdbarch_make_symbol_special_ftype) (struct symbol *sym, struct objfile *objfile);
-extern void gdbarch_make_symbol_special (struct gdbarch *gdbarch, struct symbol *sym, struct objfile *objfile);
-extern void set_gdbarch_make_symbol_special (struct gdbarch *gdbarch, gdbarch_make_symbol_special_ftype *make_symbol_special);
-
-/* Adjust the address retrieved from a DWARF-2 record other than a line
-   entry in a backend-specific way.  Normally this hook is supposed to
-   return the address passed unchanged, however if that is incorrect for
-   any reason, then this hook can be used to fix the address up in the
-   required manner.  This is currently used by the MIPS backend to make
-   sure addresses in FDE, range records, etc. referring to compressed
-   code have the ISA bit set, matching line information and the symbol
-   table. */
-
-typedef CORE_ADDR (gdbarch_adjust_dwarf2_addr_ftype) (CORE_ADDR pc);
-extern CORE_ADDR gdbarch_adjust_dwarf2_addr (struct gdbarch *gdbarch, CORE_ADDR pc);
-extern void set_gdbarch_adjust_dwarf2_addr (struct gdbarch *gdbarch, gdbarch_adjust_dwarf2_addr_ftype *adjust_dwarf2_addr);
-
-/* Adjust the address updated by a line entry in a backend-specific way.
-   Normally this hook is supposed to return the address passed unchanged,
-   however in the case of inconsistencies in these records, this hook can
-   be used to fix them up in the required manner.  This is currently used
-   by the MIPS backend to make sure all line addresses in compressed code
-   are presented with the ISA bit set, which is not always the case.  This
-   in turn ensures breakpoint addresses are correctly matched against the
-   stop PC. */
-
-typedef CORE_ADDR (gdbarch_adjust_dwarf2_line_ftype) (CORE_ADDR addr, int rel);
-extern CORE_ADDR gdbarch_adjust_dwarf2_line (struct gdbarch *gdbarch, CORE_ADDR addr, int rel);
-extern void set_gdbarch_adjust_dwarf2_line (struct gdbarch *gdbarch, gdbarch_adjust_dwarf2_line_ftype *adjust_dwarf2_line);
-
-extern int gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch);
-extern void set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch, int cannot_step_breakpoint);
-
-/* See comment in target.h about continuable, steppable and
-   non-steppable watchpoints. */
-
-extern int gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch);
-extern void set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch, int have_nonsteppable_watchpoint);
-
-extern bool gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch);
-
-typedef type_instance_flags (gdbarch_address_class_type_flags_ftype) (int byte_size, int dwarf2_addr_class);
-extern type_instance_flags gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class);
-extern void set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch, gdbarch_address_class_type_flags_ftype *address_class_type_flags);
-
-extern bool gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch);
-
-typedef const char * (gdbarch_address_class_type_flags_to_name_ftype) (struct gdbarch *gdbarch, type_instance_flags type_flags);
-extern const char * gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, type_instance_flags type_flags);
-extern void set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name);
-
-/* Execute vendor-specific DWARF Call Frame Instruction.  OP is the instruction.
-   FS are passed from the generic execute_cfa_program function. */
-
-typedef bool (gdbarch_execute_dwarf_cfa_vendor_op_ftype) (struct gdbarch *gdbarch, gdb_byte op, struct dwarf2_frame_state *fs);
-extern bool gdbarch_execute_dwarf_cfa_vendor_op (struct gdbarch *gdbarch, gdb_byte op, struct dwarf2_frame_state *fs);
-extern void set_gdbarch_execute_dwarf_cfa_vendor_op (struct gdbarch *gdbarch, gdbarch_execute_dwarf_cfa_vendor_op_ftype *execute_dwarf_cfa_vendor_op);
-
-/* Return the appropriate type_flags for the supplied address class.
-   This function should return true if the address class was recognized and
-   type_flags was set, false otherwise. */
-
-extern bool gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch);
-
-typedef bool (gdbarch_address_class_name_to_type_flags_ftype) (struct gdbarch *gdbarch, const char *name, type_instance_flags *type_flags_ptr);
-extern bool gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, type_instance_flags *type_flags_ptr);
-extern void set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags);
-
-/* Is a register in a group */
-
-typedef int (gdbarch_register_reggroup_p_ftype) (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup);
-extern int gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup);
-extern void set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch, gdbarch_register_reggroup_p_ftype *register_reggroup_p);
-
-/* Fetch the pointer to the ith function argument. */
-
-extern bool gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch);
-
-typedef CORE_ADDR (gdbarch_fetch_pointer_argument_ftype) (struct frame_info *frame, int argi, struct type *type);
-extern CORE_ADDR gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type);
-extern void set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument);
-
-/* Iterate over all supported register notes in a core file.  For each
-   supported register note section, the iterator must call CB and pass
-   CB_DATA unchanged.  If REGCACHE is not NULL, the iterator can limit
-   the supported register note sections based on the current register
-   values.  Otherwise it should enumerate all supported register note
-   sections. */
-
-extern bool gdbarch_iterate_over_regset_sections_p (struct gdbarch *gdbarch);
-
-typedef void (gdbarch_iterate_over_regset_sections_ftype) (struct gdbarch *gdbarch, iterate_over_regset_sections_cb *cb, void *cb_data, const struct regcache *regcache);
-extern void gdbarch_iterate_over_regset_sections (struct gdbarch *gdbarch, iterate_over_regset_sections_cb *cb, void *cb_data, const struct regcache *regcache);
-extern void set_gdbarch_iterate_over_regset_sections (struct gdbarch *gdbarch, gdbarch_iterate_over_regset_sections_ftype *iterate_over_regset_sections);
-
-/* Create core file notes */
-
-extern bool gdbarch_make_corefile_notes_p (struct gdbarch *gdbarch);
-
-typedef gdb::unique_xmalloc_ptr<char> (gdbarch_make_corefile_notes_ftype) (struct gdbarch *gdbarch, bfd *obfd, int *note_size);
-extern gdb::unique_xmalloc_ptr<char> gdbarch_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size);
-extern void set_gdbarch_make_corefile_notes (struct gdbarch *gdbarch, gdbarch_make_corefile_notes_ftype *make_corefile_notes);
-
-/* Find core file memory regions */
-
-extern bool gdbarch_find_memory_regions_p (struct gdbarch *gdbarch);
-
-typedef int (gdbarch_find_memory_regions_ftype) (struct gdbarch *gdbarch, find_memory_region_ftype func, void *data);
-extern int gdbarch_find_memory_regions (struct gdbarch *gdbarch, find_memory_region_ftype func, void *data);
-extern void set_gdbarch_find_memory_regions (struct gdbarch *gdbarch, gdbarch_find_memory_regions_ftype *find_memory_regions);
-
-/* Read offset OFFSET of TARGET_OBJECT_LIBRARIES formatted shared libraries list from
-   core file into buffer READBUF with length LEN.  Return the number of bytes read
-   (zero indicates failure).
-   failed, otherwise, return the red length of READBUF. */
-
-extern bool gdbarch_core_xfer_shared_libraries_p (struct gdbarch *gdbarch);
-
-typedef ULONGEST (gdbarch_core_xfer_shared_libraries_ftype) (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len);
-extern ULONGEST gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len);
-extern void set_gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch, gdbarch_core_xfer_shared_libraries_ftype *core_xfer_shared_libraries);
-
-/* Read offset OFFSET of TARGET_OBJECT_LIBRARIES_AIX formatted shared
-   libraries list from core file into buffer READBUF with length LEN.
-   Return the number of bytes read (zero indicates failure). */
-
-extern bool gdbarch_core_xfer_shared_libraries_aix_p (struct gdbarch *gdbarch);
-
-typedef ULONGEST (gdbarch_core_xfer_shared_libraries_aix_ftype) (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len);
-extern ULONGEST gdbarch_core_xfer_shared_libraries_aix (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len);
-extern void set_gdbarch_core_xfer_shared_libraries_aix (struct gdbarch *gdbarch, gdbarch_core_xfer_shared_libraries_aix_ftype *core_xfer_shared_libraries_aix);
-
-/* How the core target converts a PTID from a core file to a string. */
-
-extern bool gdbarch_core_pid_to_str_p (struct gdbarch *gdbarch);
-
-typedef std::string (gdbarch_core_pid_to_str_ftype) (struct gdbarch *gdbarch, ptid_t ptid);
-extern std::string gdbarch_core_pid_to_str (struct gdbarch *gdbarch, ptid_t ptid);
-extern void set_gdbarch_core_pid_to_str (struct gdbarch *gdbarch, gdbarch_core_pid_to_str_ftype *core_pid_to_str);
-
-/* How the core target extracts the name of a thread from a core file. */
-
-extern bool gdbarch_core_thread_name_p (struct gdbarch *gdbarch);
-
-typedef const char * (gdbarch_core_thread_name_ftype) (struct gdbarch *gdbarch, struct thread_info *thr);
-extern const char * gdbarch_core_thread_name (struct gdbarch *gdbarch, struct thread_info *thr);
-extern void set_gdbarch_core_thread_name (struct gdbarch *gdbarch, gdbarch_core_thread_name_ftype *core_thread_name);
-
-/* Read offset OFFSET of TARGET_OBJECT_SIGNAL_INFO signal information
-   from core file into buffer READBUF with length LEN.  Return the number
-   of bytes read (zero indicates EOF, a negative value indicates failure). */
-
-extern bool gdbarch_core_xfer_siginfo_p (struct gdbarch *gdbarch);
-
-typedef LONGEST (gdbarch_core_xfer_siginfo_ftype) (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len);
-extern LONGEST gdbarch_core_xfer_siginfo (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len);
-extern void set_gdbarch_core_xfer_siginfo (struct gdbarch *gdbarch, gdbarch_core_xfer_siginfo_ftype *core_xfer_siginfo);
-
-/* BFD target to use when generating a core file. */
-
-extern bool gdbarch_gcore_bfd_target_p (struct gdbarch *gdbarch);
-
-extern const char * gdbarch_gcore_bfd_target (struct gdbarch *gdbarch);
-extern void set_gdbarch_gcore_bfd_target (struct gdbarch *gdbarch, const char * gcore_bfd_target);
-
-/* If the elements of C++ vtables are in-place function descriptors rather
-   than normal function pointers (which may point to code or a descriptor),
-   set this to one. */
-
-extern int gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch);
-extern void set_gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch, int vtable_function_descriptors);
-
-/* Set if the least significant bit of the delta is used instead of the least
-   significant bit of the pfn for pointers to virtual member functions. */
-
-extern int gdbarch_vbit_in_delta (struct gdbarch *gdbarch);
-extern void set_gdbarch_vbit_in_delta (struct gdbarch *gdbarch, int vbit_in_delta);
-
-/* Advance PC to next instruction in order to skip a permanent breakpoint. */
-
-typedef void (gdbarch_skip_permanent_breakpoint_ftype) (struct regcache *regcache);
-extern void gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, struct regcache *regcache);
-extern void set_gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint);
-
-/* The maximum length of an instruction on this architecture in bytes. */
-
-extern bool gdbarch_max_insn_length_p (struct gdbarch *gdbarch);
-
-extern ULONGEST gdbarch_max_insn_length (struct gdbarch *gdbarch);
-extern void set_gdbarch_max_insn_length (struct gdbarch *gdbarch, ULONGEST max_insn_length);
-
-/* Copy the instruction at FROM to TO, and make any adjustments
-   necessary to single-step it at that address.
-  
-   REGS holds the state the thread's registers will have before
-   executing the copied instruction; the PC in REGS will refer to FROM,
-   not the copy at TO.  The caller should update it to point at TO later.
-  
-   Return a pointer to data of the architecture's choice to be passed
-   to gdbarch_displaced_step_fixup.
-  
-   For a general explanation of displaced stepping and how GDB uses it,
-   see the comments in infrun.c.
-  
-   The TO area is only guaranteed to have space for
-   gdbarch_max_insn_length (arch) bytes, so this function must not
-   write more bytes than that to that area.
-  
-   If you do not provide this function, GDB assumes that the
-   architecture does not support displaced stepping.
-  
-   If the instruction cannot execute out of line, return NULL.  The
-   core falls back to stepping past the instruction in-line instead in
-   that case. */
-
-extern bool gdbarch_displaced_step_copy_insn_p (struct gdbarch *gdbarch);
-
-typedef displaced_step_copy_insn_closure_up (gdbarch_displaced_step_copy_insn_ftype) (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs);
-extern displaced_step_copy_insn_closure_up gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs);
-extern void set_gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch, gdbarch_displaced_step_copy_insn_ftype *displaced_step_copy_insn);
-
-/* Return true if GDB should use hardware single-stepping to execute a displaced
-   step instruction.  If false, GDB will simply restart execution at the
-   displaced instruction location, and it is up to the target to ensure GDB will
-   receive control again (e.g. by placing a software breakpoint instruction into
-   the displaced instruction buffer).
-  
-   The default implementation returns false on all targets that provide a
-   gdbarch_software_single_step routine, and true otherwise. */
-
-typedef bool (gdbarch_displaced_step_hw_singlestep_ftype) (struct gdbarch *gdbarch);
-extern bool gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch);
-extern void set_gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, gdbarch_displaced_step_hw_singlestep_ftype *displaced_step_hw_singlestep);
-
-/* Fix up the state resulting from successfully single-stepping a
-   displaced instruction, to give the result we would have gotten from
-   stepping the instruction in its original location.
-  
-   REGS is the register state resulting from single-stepping the
-   displaced instruction.
-  
-   CLOSURE is the result from the matching call to
-   gdbarch_displaced_step_copy_insn.
-  
-   If you provide gdbarch_displaced_step_copy_insn.but not this
-   function, then GDB assumes that no fixup is needed after
-   single-stepping the instruction.
-  
-   For a general explanation of displaced stepping and how GDB uses it,
-   see the comments in infrun.c. */
-
-extern bool gdbarch_displaced_step_fixup_p (struct gdbarch *gdbarch);
-
-typedef void (gdbarch_displaced_step_fixup_ftype) (struct gdbarch *gdbarch, struct displaced_step_copy_insn_closure *closure, CORE_ADDR from, CORE_ADDR to, struct regcache *regs);
-extern void gdbarch_displaced_step_fixup (struct gdbarch *gdbarch, struct displaced_step_copy_insn_closure *closure, CORE_ADDR from, CORE_ADDR to, struct regcache *regs);
-extern void set_gdbarch_displaced_step_fixup (struct gdbarch *gdbarch, gdbarch_displaced_step_fixup_ftype *displaced_step_fixup);
-
-/* Prepare THREAD for it to displaced step the instruction at its current PC.
-  
-   Throw an exception if any unexpected error happens. */
-
-extern bool gdbarch_displaced_step_prepare_p (struct gdbarch *gdbarch);
-
-typedef displaced_step_prepare_status (gdbarch_displaced_step_prepare_ftype) (struct gdbarch *gdbarch, thread_info *thread, CORE_ADDR &displaced_pc);
-extern displaced_step_prepare_status gdbarch_displaced_step_prepare (struct gdbarch *gdbarch, thread_info *thread, CORE_ADDR &displaced_pc);
-extern void set_gdbarch_displaced_step_prepare (struct gdbarch *gdbarch, gdbarch_displaced_step_prepare_ftype *displaced_step_prepare);
-
-/* Clean up after a displaced step of THREAD. */
-
-typedef displaced_step_finish_status (gdbarch_displaced_step_finish_ftype) (struct gdbarch *gdbarch, thread_info *thread, gdb_signal sig);
-extern displaced_step_finish_status gdbarch_displaced_step_finish (struct gdbarch *gdbarch, thread_info *thread, gdb_signal sig);
-extern void set_gdbarch_displaced_step_finish (struct gdbarch *gdbarch, gdbarch_displaced_step_finish_ftype *displaced_step_finish);
-
-/* Return the closure associated to the displaced step buffer that is at ADDR. */
-
-extern bool gdbarch_displaced_step_copy_insn_closure_by_addr_p (struct gdbarch *gdbarch);
-
-typedef const displaced_step_copy_insn_closure * (gdbarch_displaced_step_copy_insn_closure_by_addr_ftype) (inferior *inf, CORE_ADDR addr);
-extern const displaced_step_copy_insn_closure * gdbarch_displaced_step_copy_insn_closure_by_addr (struct gdbarch *gdbarch, inferior *inf, CORE_ADDR addr);
-extern void set_gdbarch_displaced_step_copy_insn_closure_by_addr (struct gdbarch *gdbarch, gdbarch_displaced_step_copy_insn_closure_by_addr_ftype *displaced_step_copy_insn_closure_by_addr);
-
-/* PARENT_INF has forked and CHILD_PTID is the ptid of the child.  Restore the
-   contents of all displaced step buffers in the child's address space. */
-
-typedef void (gdbarch_displaced_step_restore_all_in_ptid_ftype) (inferior *parent_inf, ptid_t child_ptid);
-extern void gdbarch_displaced_step_restore_all_in_ptid (struct gdbarch *gdbarch, inferior *parent_inf, ptid_t child_ptid);
-extern void set_gdbarch_displaced_step_restore_all_in_ptid (struct gdbarch *gdbarch, gdbarch_displaced_step_restore_all_in_ptid_ftype *displaced_step_restore_all_in_ptid);
-
-/* Relocate an instruction to execute at a different address.  OLDLOC
-   is the address in the inferior memory where the instruction to
-   relocate is currently at.  On input, TO points to the destination
-   where we want the instruction to be copied (and possibly adjusted)
-   to.  On output, it points to one past the end of the resulting
-   instruction(s).  The effect of executing the instruction at TO shall
-   be the same as if executing it at FROM.  For example, call
-   instructions that implicitly push the return address on the stack
-   should be adjusted to return to the instruction after OLDLOC;
-   relative branches, and other PC-relative instructions need the
-   offset adjusted; etc. */
-
-extern bool gdbarch_relocate_instruction_p (struct gdbarch *gdbarch);
-
-typedef void (gdbarch_relocate_instruction_ftype) (struct gdbarch *gdbarch, CORE_ADDR *to, CORE_ADDR from);
-extern void gdbarch_relocate_instruction (struct gdbarch *gdbarch, CORE_ADDR *to, CORE_ADDR from);
-extern void set_gdbarch_relocate_instruction (struct gdbarch *gdbarch, gdbarch_relocate_instruction_ftype *relocate_instruction);
-
-/* Refresh overlay mapped state for section OSECT. */
-
-extern bool gdbarch_overlay_update_p (struct gdbarch *gdbarch);
-
-typedef void (gdbarch_overlay_update_ftype) (struct obj_section *osect);
-extern void gdbarch_overlay_update (struct gdbarch *gdbarch, struct obj_section *osect);
-extern void set_gdbarch_overlay_update (struct gdbarch *gdbarch, gdbarch_overlay_update_ftype *overlay_update);
-
-extern bool gdbarch_core_read_description_p (struct gdbarch *gdbarch);
-
-typedef const struct target_desc * (gdbarch_core_read_description_ftype) (struct gdbarch *gdbarch, struct target_ops *target, bfd *abfd);
-extern const struct target_desc * gdbarch_core_read_description (struct gdbarch *gdbarch, struct target_ops *target, bfd *abfd);
-extern void set_gdbarch_core_read_description (struct gdbarch *gdbarch, gdbarch_core_read_description_ftype *core_read_description);
-
-/* Set if the address in N_SO or N_FUN stabs may be zero. */
-
-extern int gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch);
-extern void set_gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch, int sofun_address_maybe_missing);
-
-/* Parse the instruction at ADDR storing in the record execution log
-   the registers REGCACHE and memory ranges that will be affected when
-   the instruction executes, along with their current values.
-   Return -1 if something goes wrong, 0 otherwise. */
-
-extern bool gdbarch_process_record_p (struct gdbarch *gdbarch);
-
-typedef int (gdbarch_process_record_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr);
-extern int gdbarch_process_record (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr);
-extern void set_gdbarch_process_record (struct gdbarch *gdbarch, gdbarch_process_record_ftype *process_record);
-
-/* Save process state after a signal.
-   Return -1 if something goes wrong, 0 otherwise. */
-
-extern bool gdbarch_process_record_signal_p (struct gdbarch *gdbarch);
-
-typedef int (gdbarch_process_record_signal_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, enum gdb_signal signal);
-extern int gdbarch_process_record_signal (struct gdbarch *gdbarch, struct regcache *regcache, enum gdb_signal signal);
-extern void set_gdbarch_process_record_signal (struct gdbarch *gdbarch, gdbarch_process_record_signal_ftype *process_record_signal);
-
-/* Signal translation: translate inferior's signal (target's) number
-   into GDB's representation.  The implementation of this method must
-   be host independent.  IOW, don't rely on symbols of the NAT_FILE
-   header (the nm-*.h files), the host <signal.h> header, or similar
-   headers.  This is mainly used when cross-debugging core files ---
-   "Live" targets hide the translation behind the target interface
-   (target_wait, target_resume, etc.). */
-
-extern bool gdbarch_gdb_signal_from_target_p (struct gdbarch *gdbarch);
-
-typedef enum gdb_signal (gdbarch_gdb_signal_from_target_ftype) (struct gdbarch *gdbarch, int signo);
-extern enum gdb_signal gdbarch_gdb_signal_from_target (struct gdbarch *gdbarch, int signo);
-extern void set_gdbarch_gdb_signal_from_target (struct gdbarch *gdbarch, gdbarch_gdb_signal_from_target_ftype *gdb_signal_from_target);
-
-/* Signal translation: translate the GDB's internal signal number into
-   the inferior's signal (target's) representation.  The implementation
-   of this method must be host independent.  IOW, don't rely on symbols
-   of the NAT_FILE header (the nm-*.h files), the host <signal.h>
-   header, or similar headers.
-   Return the target signal number if found, or -1 if the GDB internal
-   signal number is invalid. */
-
-extern bool gdbarch_gdb_signal_to_target_p (struct gdbarch *gdbarch);
-
-typedef int (gdbarch_gdb_signal_to_target_ftype) (struct gdbarch *gdbarch, enum gdb_signal signal);
-extern int gdbarch_gdb_signal_to_target (struct gdbarch *gdbarch, enum gdb_signal signal);
-extern void set_gdbarch_gdb_signal_to_target (struct gdbarch *gdbarch, gdbarch_gdb_signal_to_target_ftype *gdb_signal_to_target);
-
-/* Extra signal info inspection.
-  
-   Return a type suitable to inspect extra signal information. */
-
-extern bool gdbarch_get_siginfo_type_p (struct gdbarch *gdbarch);
-
-typedef struct type * (gdbarch_get_siginfo_type_ftype) (struct gdbarch *gdbarch);
-extern struct type * gdbarch_get_siginfo_type (struct gdbarch *gdbarch);
-extern void set_gdbarch_get_siginfo_type (struct gdbarch *gdbarch, gdbarch_get_siginfo_type_ftype *get_siginfo_type);
-
-/* Record architecture-specific information from the symbol table. */
-
-extern bool gdbarch_record_special_symbol_p (struct gdbarch *gdbarch);
-
-typedef void (gdbarch_record_special_symbol_ftype) (struct gdbarch *gdbarch, struct objfile *objfile, asymbol *sym);
-extern void gdbarch_record_special_symbol (struct gdbarch *gdbarch, struct objfile *objfile, asymbol *sym);
-extern void set_gdbarch_record_special_symbol (struct gdbarch *gdbarch, gdbarch_record_special_symbol_ftype *record_special_symbol);
-
-/* Function for the 'catch syscall' feature.
-   Get architecture-specific system calls information from registers. */
-
-extern bool gdbarch_get_syscall_number_p (struct gdbarch *gdbarch);
-
-typedef LONGEST (gdbarch_get_syscall_number_ftype) (struct gdbarch *gdbarch, thread_info *thread);
-extern LONGEST gdbarch_get_syscall_number (struct gdbarch *gdbarch, thread_info *thread);
-extern void set_gdbarch_get_syscall_number (struct gdbarch *gdbarch, gdbarch_get_syscall_number_ftype *get_syscall_number);
-
-/* The filename of the XML syscall for this architecture. */
-
-extern const char * gdbarch_xml_syscall_file (struct gdbarch *gdbarch);
-extern void set_gdbarch_xml_syscall_file (struct gdbarch *gdbarch, const char * xml_syscall_file);
-
-/* Information about system calls from this architecture */
-
-extern struct syscalls_info * gdbarch_syscalls_info (struct gdbarch *gdbarch);
-extern void set_gdbarch_syscalls_info (struct gdbarch *gdbarch, struct syscalls_info * syscalls_info);
-
-/* SystemTap related fields and functions.
-   A NULL-terminated array of prefixes used to mark an integer constant
-   on the architecture's assembly.
-   For example, on x86 integer constants are written as:
-  
-    $10 ;; integer constant 10
-  
-   in this case, this prefix would be the character `$'. */
-
-extern const char *const * gdbarch_stap_integer_prefixes (struct gdbarch *gdbarch);
-extern void set_gdbarch_stap_integer_prefixes (struct gdbarch *gdbarch, const char *const * stap_integer_prefixes);
-
-/* A NULL-terminated array of suffixes used to mark an integer constant
-   on the architecture's assembly. */
-
-extern const char *const * gdbarch_stap_integer_suffixes (struct gdbarch *gdbarch);
-extern void set_gdbarch_stap_integer_suffixes (struct gdbarch *gdbarch, const char *const * stap_integer_suffixes);
-
-/* A NULL-terminated array of prefixes used to mark a register name on
-   the architecture's assembly.
-   For example, on x86 the register name is written as:
-  
-    %eax ;; register eax
-  
-   in this case, this prefix would be the character `%'. */
-
-extern const char *const * gdbarch_stap_register_prefixes (struct gdbarch *gdbarch);
-extern void set_gdbarch_stap_register_prefixes (struct gdbarch *gdbarch, const char *const * stap_register_prefixes);
-
-/* A NULL-terminated array of suffixes used to mark a register name on
-   the architecture's assembly. */
-
-extern const char *const * gdbarch_stap_register_suffixes (struct gdbarch *gdbarch);
-extern void set_gdbarch_stap_register_suffixes (struct gdbarch *gdbarch, const char *const * stap_register_suffixes);
-
-/* A NULL-terminated array of prefixes used to mark a register
-   indirection on the architecture's assembly.
-   For example, on x86 the register indirection is written as:
-  
-    (%eax) ;; indirecting eax
-  
-   in this case, this prefix would be the charater `('.
-  
-   Please note that we use the indirection prefix also for register
-   displacement, e.g., `4(%eax)' on x86. */
-
-extern const char *const * gdbarch_stap_register_indirection_prefixes (struct gdbarch *gdbarch);
-extern void set_gdbarch_stap_register_indirection_prefixes (struct gdbarch *gdbarch, const char *const * stap_register_indirection_prefixes);
-
-/* A NULL-terminated array of suffixes used to mark a register
-   indirection on the architecture's assembly.
-   For example, on x86 the register indirection is written as:
-  
-    (%eax) ;; indirecting eax
-  
-   in this case, this prefix would be the charater `)'.
-  
-   Please note that we use the indirection suffix also for register
-   displacement, e.g., `4(%eax)' on x86. */
-
-extern const char *const * gdbarch_stap_register_indirection_suffixes (struct gdbarch *gdbarch);
-extern void set_gdbarch_stap_register_indirection_suffixes (struct gdbarch *gdbarch, const char *const * stap_register_indirection_suffixes);
-
-/* Prefix(es) used to name a register using GDB's nomenclature.
-  
-   For example, on PPC a register is represented by a number in the assembly
-   language (e.g., `10' is the 10th general-purpose register).  However,
-   inside GDB this same register has an `r' appended to its name, so the 10th
-   register would be represented as `r10' internally. */
-
-extern const char * gdbarch_stap_gdb_register_prefix (struct gdbarch *gdbarch);
-extern void set_gdbarch_stap_gdb_register_prefix (struct gdbarch *gdbarch, const char * stap_gdb_register_prefix);
-
-/* Suffix used to name a register using GDB's nomenclature. */
-
-extern const char * gdbarch_stap_gdb_register_suffix (struct gdbarch *gdbarch);
-extern void set_gdbarch_stap_gdb_register_suffix (struct gdbarch *gdbarch, const char * stap_gdb_register_suffix);
-
-/* Check if S is a single operand.
-  
-   Single operands can be:
-    - Literal integers, e.g. `$10' on x86
-    - Register access, e.g. `%eax' on x86
-    - Register indirection, e.g. `(%eax)' on x86
-    - Register displacement, e.g. `4(%eax)' on x86
-  
-   This function should check for these patterns on the string
-   and return 1 if some were found, or zero otherwise.  Please try to match
-   as much info as you can from the string, i.e., if you have to match
-   something like `(%', do not match just the `('. */
-
-extern bool gdbarch_stap_is_single_operand_p (struct gdbarch *gdbarch);
-
-typedef int (gdbarch_stap_is_single_operand_ftype) (struct gdbarch *gdbarch, const char *s);
-extern int gdbarch_stap_is_single_operand (struct gdbarch *gdbarch, const char *s);
-extern void set_gdbarch_stap_is_single_operand (struct gdbarch *gdbarch, gdbarch_stap_is_single_operand_ftype *stap_is_single_operand);
-
-/* Function used to handle a "special case" in the parser.
-  
-   A "special case" is considered to be an unknown token, i.e., a token
-   that the parser does not know how to parse.  A good example of special
-   case would be ARM's register displacement syntax:
-  
-    [R0, #4]  ;; displacing R0 by 4
-  
-   Since the parser assumes that a register displacement is of the form:
-  
-    <number> <indirection_prefix> <register_name> <indirection_suffix>
-  
-   it means that it will not be able to recognize and parse this odd syntax.
-   Therefore, we should add a special case function that will handle this token.
-  
-   This function should generate the proper expression form of the expression
-   using GDB's internal expression mechanism (e.g., `write_exp_elt_opcode'
-   and so on).  It should also return 1 if the parsing was successful, or zero
-   if the token was not recognized as a special token (in this case, returning
-   zero means that the special parser is deferring the parsing to the generic
-   parser), and should advance the buffer pointer (p->arg). */
-
-extern bool gdbarch_stap_parse_special_token_p (struct gdbarch *gdbarch);
-
-typedef expr::operation_up (gdbarch_stap_parse_special_token_ftype) (struct gdbarch *gdbarch, struct stap_parse_info *p);
-extern expr::operation_up gdbarch_stap_parse_special_token (struct gdbarch *gdbarch, struct stap_parse_info *p);
-extern void set_gdbarch_stap_parse_special_token (struct gdbarch *gdbarch, gdbarch_stap_parse_special_token_ftype *stap_parse_special_token);
-
-/* Perform arch-dependent adjustments to a register name.
-  
-   In very specific situations, it may be necessary for the register
-   name present in a SystemTap probe's argument to be handled in a
-   special way.  For example, on i386, GCC may over-optimize the
-   register allocation and use smaller registers than necessary.  In
-   such cases, the client that is reading and evaluating the SystemTap
-   probe (ourselves) will need to actually fetch values from the wider
-   version of the register in question.
-  
-   To illustrate the example, consider the following probe argument
-   (i386):
-  
-      4@%ax
-  
-   This argument says that its value can be found at the %ax register,
-   which is a 16-bit register.  However, the argument's prefix says
-   that its type is "uint32_t", which is 32-bit in size.  Therefore, in
-   this case, GDB should actually fetch the probe's value from register
-   %eax, not %ax.  In this scenario, this function would actually
-   replace the register name from %ax to %eax.
-  
-   The rationale for this can be found at PR breakpoints/24541. */
-
-extern bool gdbarch_stap_adjust_register_p (struct gdbarch *gdbarch);
-
-typedef std::string (gdbarch_stap_adjust_register_ftype) (struct gdbarch *gdbarch, struct stap_parse_info *p, const std::string &regname, int regnum);
-extern std::string gdbarch_stap_adjust_register (struct gdbarch *gdbarch, struct stap_parse_info *p, const std::string &regname, int regnum);
-extern void set_gdbarch_stap_adjust_register (struct gdbarch *gdbarch, gdbarch_stap_adjust_register_ftype *stap_adjust_register);
-
-/* DTrace related functions.
-   The expression to compute the NARTGth+1 argument to a DTrace USDT probe.
-   NARG must be >= 0. */
-
-extern bool gdbarch_dtrace_parse_probe_argument_p (struct gdbarch *gdbarch);
-
-typedef expr::operation_up (gdbarch_dtrace_parse_probe_argument_ftype) (struct gdbarch *gdbarch, int narg);
-extern expr::operation_up gdbarch_dtrace_parse_probe_argument (struct gdbarch *gdbarch, int narg);
-extern void set_gdbarch_dtrace_parse_probe_argument (struct gdbarch *gdbarch, gdbarch_dtrace_parse_probe_argument_ftype *dtrace_parse_probe_argument);
-
-/* True if the given ADDR does not contain the instruction sequence
-   corresponding to a disabled DTrace is-enabled probe. */
-
-extern bool gdbarch_dtrace_probe_is_enabled_p (struct gdbarch *gdbarch);
-
-typedef int (gdbarch_dtrace_probe_is_enabled_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
-extern int gdbarch_dtrace_probe_is_enabled (struct gdbarch *gdbarch, CORE_ADDR addr);
-extern void set_gdbarch_dtrace_probe_is_enabled (struct gdbarch *gdbarch, gdbarch_dtrace_probe_is_enabled_ftype *dtrace_probe_is_enabled);
-
-/* Enable a DTrace is-enabled probe at ADDR. */
-
-extern bool gdbarch_dtrace_enable_probe_p (struct gdbarch *gdbarch);
-
-typedef void (gdbarch_dtrace_enable_probe_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
-extern void gdbarch_dtrace_enable_probe (struct gdbarch *gdbarch, CORE_ADDR addr);
-extern void set_gdbarch_dtrace_enable_probe (struct gdbarch *gdbarch, gdbarch_dtrace_enable_probe_ftype *dtrace_enable_probe);
-
-/* Disable a DTrace is-enabled probe at ADDR. */
-
-extern bool gdbarch_dtrace_disable_probe_p (struct gdbarch *gdbarch);
-
-typedef void (gdbarch_dtrace_disable_probe_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
-extern void gdbarch_dtrace_disable_probe (struct gdbarch *gdbarch, CORE_ADDR addr);
-extern void set_gdbarch_dtrace_disable_probe (struct gdbarch *gdbarch, gdbarch_dtrace_disable_probe_ftype *dtrace_disable_probe);
-
-/* True if the list of shared libraries is one and only for all
-   processes, as opposed to a list of shared libraries per inferior.
-   This usually means that all processes, although may or may not share
-   an address space, will see the same set of symbols at the same
-   addresses. */
-
-extern int gdbarch_has_global_solist (struct gdbarch *gdbarch);
-extern void set_gdbarch_has_global_solist (struct gdbarch *gdbarch, int has_global_solist);
-
-/* On some targets, even though each inferior has its own private
-   address space, the debug interface takes care of making breakpoints
-   visible to all address spaces automatically.  For such cases,
-   this property should be set to true. */
-
-extern int gdbarch_has_global_breakpoints (struct gdbarch *gdbarch);
-extern void set_gdbarch_has_global_breakpoints (struct gdbarch *gdbarch, int has_global_breakpoints);
-
-/* True if inferiors share an address space (e.g., uClinux). */
-
-typedef int (gdbarch_has_shared_address_space_ftype) (struct gdbarch *gdbarch);
-extern int gdbarch_has_shared_address_space (struct gdbarch *gdbarch);
-extern void set_gdbarch_has_shared_address_space (struct gdbarch *gdbarch, gdbarch_has_shared_address_space_ftype *has_shared_address_space);
-
-/* True if a fast tracepoint can be set at an address. */
-
-typedef int (gdbarch_fast_tracepoint_valid_at_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr, std::string *msg);
-extern int gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr, std::string *msg);
-extern void set_gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch, gdbarch_fast_tracepoint_valid_at_ftype *fast_tracepoint_valid_at);
-
-/* Guess register state based on tracepoint location.  Used for tracepoints
-   where no registers have been collected, but there's only one location,
-   allowing us to guess the PC value, and perhaps some other registers.
-   On entry, regcache has all registers marked as unavailable. */
-
-typedef void (gdbarch_guess_tracepoint_registers_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr);
-extern void gdbarch_guess_tracepoint_registers (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr);
-extern void set_gdbarch_guess_tracepoint_registers (struct gdbarch *gdbarch, gdbarch_guess_tracepoint_registers_ftype *guess_tracepoint_registers);
-
-/* Return the "auto" target charset. */
-
-typedef const char * (gdbarch_auto_charset_ftype) (void);
-extern const char * gdbarch_auto_charset (struct gdbarch *gdbarch);
-extern void set_gdbarch_auto_charset (struct gdbarch *gdbarch, gdbarch_auto_charset_ftype *auto_charset);
-
-/* Return the "auto" target wide charset. */
-
-typedef const char * (gdbarch_auto_wide_charset_ftype) (void);
-extern const char * gdbarch_auto_wide_charset (struct gdbarch *gdbarch);
-extern void set_gdbarch_auto_wide_charset (struct gdbarch *gdbarch, gdbarch_auto_wide_charset_ftype *auto_wide_charset);
-
-/* If non-empty, this is a file extension that will be opened in place
-   of the file extension reported by the shared library list.
-  
-   This is most useful for toolchains that use a post-linker tool,
-   where the names of the files run on the target differ in extension
-   compared to the names of the files GDB should load for debug info. */
-
-extern const char * gdbarch_solib_symbols_extension (struct gdbarch *gdbarch);
-extern void set_gdbarch_solib_symbols_extension (struct gdbarch *gdbarch, const char * solib_symbols_extension);
-
-/* If true, the target OS has DOS-based file system semantics.  That
-   is, absolute paths include a drive name, and the backslash is
-   considered a directory separator. */
-
-extern int gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch);
-extern void set_gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch, int has_dos_based_file_system);
-
-/* Generate bytecodes to collect the return address in a frame.
-   Since the bytecodes run on the target, possibly with GDB not even
-   connected, the full unwinding machinery is not available, and
-   typically this function will issue bytecodes for one or more likely
-   places that the return address may be found. */
-
-typedef void (gdbarch_gen_return_address_ftype) (struct gdbarch *gdbarch, struct agent_expr *ax, struct axs_value *value, CORE_ADDR scope);
-extern void gdbarch_gen_return_address (struct gdbarch *gdbarch, struct agent_expr *ax, struct axs_value *value, CORE_ADDR scope);
-extern void set_gdbarch_gen_return_address (struct gdbarch *gdbarch, gdbarch_gen_return_address_ftype *gen_return_address);
-
-/* Implement the "info proc" command. */
-
-extern bool gdbarch_info_proc_p (struct gdbarch *gdbarch);
-
-typedef void (gdbarch_info_proc_ftype) (struct gdbarch *gdbarch, const char *args, enum info_proc_what what);
-extern void gdbarch_info_proc (struct gdbarch *gdbarch, const char *args, enum info_proc_what what);
-extern void set_gdbarch_info_proc (struct gdbarch *gdbarch, gdbarch_info_proc_ftype *info_proc);
-
-/* Implement the "info proc" command for core files.  Noe that there
-   are two "info_proc"-like methods on gdbarch -- one for core files,
-   one for live targets. */
-
-extern bool gdbarch_core_info_proc_p (struct gdbarch *gdbarch);
-
-typedef void (gdbarch_core_info_proc_ftype) (struct gdbarch *gdbarch, const char *args, enum info_proc_what what);
-extern void gdbarch_core_info_proc (struct gdbarch *gdbarch, const char *args, enum info_proc_what what);
-extern void set_gdbarch_core_info_proc (struct gdbarch *gdbarch, gdbarch_core_info_proc_ftype *core_info_proc);
-
-/* Iterate over all objfiles in the order that makes the most sense
-   for the architecture to make global symbol searches.
-  
-   CB is a callback function where OBJFILE is the objfile to be searched,
-   and CB_DATA a pointer to user-defined data (the same data that is passed
-   when calling this gdbarch method).  The iteration stops if this function
-   returns nonzero.
-  
-   CB_DATA is a pointer to some user-defined data to be passed to
-   the callback.
-  
-   If not NULL, CURRENT_OBJFILE corresponds to the objfile being
-   inspected when the symbol search was requested. */
-
-typedef void (gdbarch_iterate_over_objfiles_in_search_order_ftype) (struct gdbarch *gdbarch, iterate_over_objfiles_in_search_order_cb_ftype *cb, void *cb_data, struct objfile *current_objfile);
-extern void gdbarch_iterate_over_objfiles_in_search_order (struct gdbarch *gdbarch, iterate_over_objfiles_in_search_order_cb_ftype *cb, void *cb_data, struct objfile *current_objfile);
-extern void set_gdbarch_iterate_over_objfiles_in_search_order (struct gdbarch *gdbarch, gdbarch_iterate_over_objfiles_in_search_order_ftype *iterate_over_objfiles_in_search_order);
-
-/* Ravenscar arch-dependent ops. */
-
-extern struct ravenscar_arch_ops * gdbarch_ravenscar_ops (struct gdbarch *gdbarch);
-extern void set_gdbarch_ravenscar_ops (struct gdbarch *gdbarch, struct ravenscar_arch_ops * ravenscar_ops);
-
-/* Return non-zero if the instruction at ADDR is a call; zero otherwise. */
-
-typedef int (gdbarch_insn_is_call_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
-extern int gdbarch_insn_is_call (struct gdbarch *gdbarch, CORE_ADDR addr);
-extern void set_gdbarch_insn_is_call (struct gdbarch *gdbarch, gdbarch_insn_is_call_ftype *insn_is_call);
-
-/* Return non-zero if the instruction at ADDR is a return; zero otherwise. */
-
-typedef int (gdbarch_insn_is_ret_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
-extern int gdbarch_insn_is_ret (struct gdbarch *gdbarch, CORE_ADDR addr);
-extern void set_gdbarch_insn_is_ret (struct gdbarch *gdbarch, gdbarch_insn_is_ret_ftype *insn_is_ret);
-
-/* Return non-zero if the instruction at ADDR is a jump; zero otherwise. */
-
-typedef int (gdbarch_insn_is_jump_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
-extern int gdbarch_insn_is_jump (struct gdbarch *gdbarch, CORE_ADDR addr);
-extern void set_gdbarch_insn_is_jump (struct gdbarch *gdbarch, gdbarch_insn_is_jump_ftype *insn_is_jump);
-
-/* Return true if there's a program/permanent breakpoint planted in
-   memory at ADDRESS, return false otherwise. */
-
-typedef bool (gdbarch_program_breakpoint_here_p_ftype) (struct gdbarch *gdbarch, CORE_ADDR address);
-extern bool gdbarch_program_breakpoint_here_p (struct gdbarch *gdbarch, CORE_ADDR address);
-extern void set_gdbarch_program_breakpoint_here_p (struct gdbarch *gdbarch, gdbarch_program_breakpoint_here_p_ftype *program_breakpoint_here_p);
-
-/* Read one auxv entry from *READPTR, not reading locations >= ENDPTR.
-   Return 0 if *READPTR is already at the end of the buffer.
-   Return -1 if there is insufficient buffer for a whole entry.
-   Return 1 if an entry was read into *TYPEP and *VALP. */
-
-extern bool gdbarch_auxv_parse_p (struct gdbarch *gdbarch);
-
-typedef int (gdbarch_auxv_parse_ftype) (struct gdbarch *gdbarch, gdb_byte **readptr, gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp);
-extern int gdbarch_auxv_parse (struct gdbarch *gdbarch, gdb_byte **readptr, gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp);
-extern void set_gdbarch_auxv_parse (struct gdbarch *gdbarch, gdbarch_auxv_parse_ftype *auxv_parse);
-
-/* Print the description of a single auxv entry described by TYPE and VAL
-   to FILE. */
-
-typedef void (gdbarch_print_auxv_entry_ftype) (struct gdbarch *gdbarch, struct ui_file *file, CORE_ADDR type, CORE_ADDR val);
-extern void gdbarch_print_auxv_entry (struct gdbarch *gdbarch, struct ui_file *file, CORE_ADDR type, CORE_ADDR val);
-extern void set_gdbarch_print_auxv_entry (struct gdbarch *gdbarch, gdbarch_print_auxv_entry_ftype *print_auxv_entry);
-
-/* Find the address range of the current inferior's vsyscall/vDSO, and
-   write it to *RANGE.  If the vsyscall's length can't be determined, a
-   range with zero length is returned.  Returns true if the vsyscall is
-   found, false otherwise. */
-
-typedef int (gdbarch_vsyscall_range_ftype) (struct gdbarch *gdbarch, struct mem_range *range);
-extern int gdbarch_vsyscall_range (struct gdbarch *gdbarch, struct mem_range *range);
-extern void set_gdbarch_vsyscall_range (struct gdbarch *gdbarch, gdbarch_vsyscall_range_ftype *vsyscall_range);
-
-/* Allocate SIZE bytes of PROT protected page aligned memory in inferior.
-   PROT has GDB_MMAP_PROT_* bitmask format.
-   Throw an error if it is not possible.  Returned address is always valid. */
-
-typedef CORE_ADDR (gdbarch_infcall_mmap_ftype) (CORE_ADDR size, unsigned prot);
-extern CORE_ADDR gdbarch_infcall_mmap (struct gdbarch *gdbarch, CORE_ADDR size, unsigned prot);
-extern void set_gdbarch_infcall_mmap (struct gdbarch *gdbarch, gdbarch_infcall_mmap_ftype *infcall_mmap);
-
-/* Deallocate SIZE bytes of memory at ADDR in inferior from gdbarch_infcall_mmap.
-   Print a warning if it is not possible. */
-
-typedef void (gdbarch_infcall_munmap_ftype) (CORE_ADDR addr, CORE_ADDR size);
-extern void gdbarch_infcall_munmap (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR size);
-extern void set_gdbarch_infcall_munmap (struct gdbarch *gdbarch, gdbarch_infcall_munmap_ftype *infcall_munmap);
-
-/* Return string (caller has to use xfree for it) with options for GCC
-   to produce code for this target, typically "-m64", "-m32" or "-m31".
-   These options are put before CU's DW_AT_producer compilation options so that
-   they can override it. */
-
-typedef std::string (gdbarch_gcc_target_options_ftype) (struct gdbarch *gdbarch);
-extern std::string gdbarch_gcc_target_options (struct gdbarch *gdbarch);
-extern void set_gdbarch_gcc_target_options (struct gdbarch *gdbarch, gdbarch_gcc_target_options_ftype *gcc_target_options);
-
-/* Return a regular expression that matches names used by this
-   architecture in GNU configury triplets.  The result is statically
-   allocated and must not be freed.  The default implementation simply
-   returns the BFD architecture name, which is correct in nearly every
-   case. */
-
-typedef const char * (gdbarch_gnu_triplet_regexp_ftype) (struct gdbarch *gdbarch);
-extern const char * gdbarch_gnu_triplet_regexp (struct gdbarch *gdbarch);
-extern void set_gdbarch_gnu_triplet_regexp (struct gdbarch *gdbarch, gdbarch_gnu_triplet_regexp_ftype *gnu_triplet_regexp);
-
-/* Return the size in 8-bit bytes of an addressable memory unit on this
-   architecture.  This corresponds to the number of 8-bit bytes associated to
-   each address in memory. */
-
-typedef int (gdbarch_addressable_memory_unit_size_ftype) (struct gdbarch *gdbarch);
-extern int gdbarch_addressable_memory_unit_size (struct gdbarch *gdbarch);
-extern void set_gdbarch_addressable_memory_unit_size (struct gdbarch *gdbarch, gdbarch_addressable_memory_unit_size_ftype *addressable_memory_unit_size);
-
-/* Functions for allowing a target to modify its disassembler options. */
-
-extern const char * gdbarch_disassembler_options_implicit (struct gdbarch *gdbarch);
-extern void set_gdbarch_disassembler_options_implicit (struct gdbarch *gdbarch, const char * disassembler_options_implicit);
-
-extern char ** gdbarch_disassembler_options (struct gdbarch *gdbarch);
-extern void set_gdbarch_disassembler_options (struct gdbarch *gdbarch, char ** disassembler_options);
-
-extern const disasm_options_and_args_t * gdbarch_valid_disassembler_options (struct gdbarch *gdbarch);
-extern void set_gdbarch_valid_disassembler_options (struct gdbarch *gdbarch, const disasm_options_and_args_t * valid_disassembler_options);
-
-/* Type alignment override method.  Return the architecture specific
-   alignment required for TYPE.  If there is no special handling
-   required for TYPE then return the value 0, GDB will then apply the
-   default rules as laid out in gdbtypes.c:type_align. */
-
-typedef ULONGEST (gdbarch_type_align_ftype) (struct gdbarch *gdbarch, struct type *type);
-extern ULONGEST gdbarch_type_align (struct gdbarch *gdbarch, struct type *type);
-extern void set_gdbarch_type_align (struct gdbarch *gdbarch, gdbarch_type_align_ftype *type_align);
-
-/* Return a string containing any flags for the given PC in the given FRAME. */
-
-typedef std::string (gdbarch_get_pc_address_flags_ftype) (frame_info *frame, CORE_ADDR pc);
-extern std::string gdbarch_get_pc_address_flags (struct gdbarch *gdbarch, frame_info *frame, CORE_ADDR pc);
-extern void set_gdbarch_get_pc_address_flags (struct gdbarch *gdbarch, gdbarch_get_pc_address_flags_ftype *get_pc_address_flags);
-
-/* Read core file mappings */
-
-typedef void (gdbarch_read_core_file_mappings_ftype) (struct gdbarch *gdbarch, struct bfd *cbfd, read_core_file_mappings_pre_loop_ftype pre_loop_cb, read_core_file_mappings_loop_ftype loop_cb);
-extern void gdbarch_read_core_file_mappings (struct gdbarch *gdbarch, struct bfd *cbfd, read_core_file_mappings_pre_loop_ftype pre_loop_cb, read_core_file_mappings_loop_ftype loop_cb);
-extern void set_gdbarch_read_core_file_mappings (struct gdbarch *gdbarch, gdbarch_read_core_file_mappings_ftype *read_core_file_mappings);
+#include "gdbarch-gen.h"
 
 extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
 
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 0d63462d7bb..c970c7ae7f1 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -1291,7 +1291,7 @@ EOF
 #
 
 exec > new-gdbarch.h
-copyright
+copyright | sed 1,3d | grep -v 'was created'
 cat <<EOF
 #ifndef GDBARCH_H
 #define GDBARCH_H
@@ -1415,71 +1415,11 @@ using read_core_file_mappings_loop_ftype =
 			   const char *filename,
 			   const bfd_build_id *build_id)>;
 EOF
-
-# function typedef's
-printf "\n"
-printf "\n"
-printf "/* The following are pre-initialized by GDBARCH.  */\n"
-function_list | while do_read
-do
-    if class_is_info_p
-    then
-	printf "\n"
-	printf "extern %s gdbarch_%s (struct gdbarch *gdbarch);\n" "$returntype" "$function"
-	printf "/* set_gdbarch_%s() - not applicable - pre-initialized.  */\n" "$function"
-    fi
-done
-
-# function typedef's
-printf "\n"
-printf "\n"
-printf "/* The following are initialized by the target dependent code.  */\n"
-function_list | while do_read
-do
-    if [ -n "${comment}" ]
-    then
-	echo "${comment}" | sed \
-	    -e '2 s,#,/*,' \
-	    -e '3,$ s,#,  ,' \
-	    -e '$ s,$, */,'
-    fi
-
-    if class_is_predicate_p
-    then
-	printf "\n"
-	printf "extern bool gdbarch_%s_p (struct gdbarch *gdbarch);\n" "$function"
-    fi
-    if class_is_variable_p
-    then
-	printf "\n"
-	printf "extern %s gdbarch_%s (struct gdbarch *gdbarch);\n" "$returntype" "$function"
-	printf "extern void set_gdbarch_%s (struct gdbarch *gdbarch, %s %s);\n" "$function" "$returntype" "$function"
-    fi
-    if class_is_function_p
-    then
-	printf "\n"
-	if [ "x${formal}" = "xvoid" ] && class_is_multiarch_p
-	then
-	    printf "typedef %s (gdbarch_%s_ftype) (struct gdbarch *gdbarch);\n" "$returntype" "$function"
-	elif class_is_multiarch_p
-	then
-	    printf "typedef %s (gdbarch_%s_ftype) (struct gdbarch *gdbarch, %s);\n" "$returntype" "$function" "$formal"
-	else
-	    printf "typedef %s (gdbarch_%s_ftype) (%s);\n" "$returntype" "$function" "$formal"
-	fi
-	if [ "x${formal}" = "xvoid" ]
-	then
-	  printf "extern %s gdbarch_%s (struct gdbarch *gdbarch);\n" "$returntype" "$function"
-	else
-	  printf "extern %s gdbarch_%s (struct gdbarch *gdbarch, %s);\n" "$returntype" "$function" "$formal"
-	fi
-	printf "extern void set_gdbarch_%s (struct gdbarch *gdbarch, gdbarch_%s_ftype *%s);\n" "$function" "$function" "$function"
-    fi
-done
-
 # close it off
 cat <<EOF
 
+#include "gdbarch-gen.h"
+
 extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
 
 
@@ -1718,10 +1658,79 @@ gdbarch_num_cooked_regs (gdbarch *arch)
 
 #endif
 EOF
+
 exec 1>&2
 ../move-if-change new-gdbarch.h gdbarch.h
 rm -f new-gdbarch.h
 
+exec > new-gdbarch-gen.h
+copyright
+
+# function typedef's
+printf "\n"
+printf "\n"
+printf "/* The following are pre-initialized by GDBARCH.  */\n"
+function_list | while do_read
+do
+    if class_is_info_p
+    then
+	printf "\n"
+	printf "extern %s gdbarch_%s (struct gdbarch *gdbarch);\n" "$returntype" "$function"
+	printf "/* set_gdbarch_%s() - not applicable - pre-initialized.  */\n" "$function"
+    fi
+done
+
+# function typedef's
+printf "\n"
+printf "\n"
+printf "/* The following are initialized by the target dependent code.  */\n"
+function_list | while do_read
+do
+    if [ -n "${comment}" ]
+    then
+	echo "${comment}" | sed \
+	    -e '2 s,#,/*,' \
+	    -e '3,$ s,#,  ,' \
+	    -e '$ s,$, */,'
+    fi
+
+    if class_is_predicate_p
+    then
+	printf "\n"
+	printf "extern bool gdbarch_%s_p (struct gdbarch *gdbarch);\n" "$function"
+    fi
+    if class_is_variable_p
+    then
+	printf "\n"
+	printf "extern %s gdbarch_%s (struct gdbarch *gdbarch);\n" "$returntype" "$function"
+	printf "extern void set_gdbarch_%s (struct gdbarch *gdbarch, %s %s);\n" "$function" "$returntype" "$function"
+    fi
+    if class_is_function_p
+    then
+	printf "\n"
+	if [ "x${formal}" = "xvoid" ] && class_is_multiarch_p
+	then
+	    printf "typedef %s (gdbarch_%s_ftype) (struct gdbarch *gdbarch);\n" "$returntype" "$function"
+	elif class_is_multiarch_p
+	then
+	    printf "typedef %s (gdbarch_%s_ftype) (struct gdbarch *gdbarch, %s);\n" "$returntype" "$function" "$formal"
+	else
+	    printf "typedef %s (gdbarch_%s_ftype) (%s);\n" "$returntype" "$function" "$formal"
+	fi
+	if [ "x${formal}" = "xvoid" ]
+	then
+	  printf "extern %s gdbarch_%s (struct gdbarch *gdbarch);\n" "$returntype" "$function"
+	else
+	  printf "extern %s gdbarch_%s (struct gdbarch *gdbarch, %s);\n" "$returntype" "$function" "$formal"
+	fi
+	printf "extern void set_gdbarch_%s (struct gdbarch *gdbarch, gdbarch_%s_ftype *%s);\n" "$function" "$function" "$function"
+    fi
+done
+
+exec 1>&2
+../move-if-change new-gdbarch-gen.h gdbarch-gen.h
+rm -f new-gdbarch-gen.h
+
 
 #
 # C file
-- 
2.31.1


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v2 3/8] Do not generate gdbarch.h
  2021-12-16 20:38 [PATCH v2 0/8] Rewrite gdbarch.sh in Python Tom Tromey
  2021-12-16 20:38 ` [PATCH v2 1/8] Move ordinary gdbarch code to arch-utils Tom Tromey
  2021-12-16 20:38 ` [PATCH v2 2/8] Split gdbarch.h into two files Tom Tromey
@ 2021-12-16 20:38 ` Tom Tromey
  2021-12-16 20:38 ` [PATCH v2 4/8] Do not sort the fields in gdbarch_dump Tom Tromey
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 21+ messages in thread
From: Tom Tromey @ 2021-12-16 20:38 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

Now that gdbarch.h has been split, we no longer need the generator
code in gdbarch.sh, so remove it.
---
 gdb/gdbarch.sh | 377 -------------------------------------------------
 1 file changed, 377 deletions(-)

diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index c970c7ae7f1..1acfda4be38 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -1286,383 +1286,6 @@ cat <<EOF
 EOF
 }
 
-#
-# The .h file
-#
-
-exec > new-gdbarch.h
-copyright | sed 1,3d | grep -v 'was created'
-cat <<EOF
-#ifndef GDBARCH_H
-#define GDBARCH_H
-
-#include <vector>
-#include "frame.h"
-#include "dis-asm.h"
-#include "gdb_obstack.h"
-#include "infrun.h"
-#include "osabi.h"
-#include "displaced-stepping.h"
-
-struct floatformat;
-struct ui_file;
-struct value;
-struct objfile;
-struct obj_section;
-struct minimal_symbol;
-struct regcache;
-struct reggroup;
-struct regset;
-struct disassemble_info;
-struct target_ops;
-struct obstack;
-struct bp_target_info;
-struct target_desc;
-struct symbol;
-struct syscall;
-struct agent_expr;
-struct axs_value;
-struct stap_parse_info;
-struct expr_builder;
-struct ravenscar_arch_ops;
-struct mem_range;
-struct syscalls_info;
-struct thread_info;
-struct ui_out;
-struct inferior;
-
-#include "regcache.h"
-
-struct gdbarch_tdep {};
-
-/* The architecture associated with the inferior through the
-   connection to the target.
-
-   The architecture vector provides some information that is really a
-   property of the inferior, accessed through a particular target:
-   ptrace operations; the layout of certain RSP packets; the solib_ops
-   vector; etc.  To differentiate architecture accesses to
-   per-inferior/target properties from
-   per-thread/per-frame/per-objfile properties, accesses to
-   per-inferior/target properties should be made through this
-   gdbarch.  */
-
-/* This is a convenience wrapper for 'current_inferior ()->gdbarch'.  */
-extern struct gdbarch *target_gdbarch (void);
-
-/* Callback type for the 'iterate_over_objfiles_in_search_order'
-   gdbarch  method.  */
-
-typedef int (iterate_over_objfiles_in_search_order_cb_ftype)
-  (struct objfile *objfile, void *cb_data);
-
-/* Callback type for regset section iterators.  The callback usually
-   invokes the REGSET's supply or collect method, to which it must
-   pass a buffer - for collects this buffer will need to be created using
-   COLLECT_SIZE, for supply the existing buffer being read from should
-   be at least SUPPLY_SIZE.  SECT_NAME is a BFD section name, and HUMAN_NAME
-   is used for diagnostic messages.  CB_DATA should have been passed
-   unchanged through the iterator.  */
-
-typedef void (iterate_over_regset_sections_cb)
-  (const char *sect_name, int supply_size, int collect_size,
-   const struct regset *regset, const char *human_name, void *cb_data);
-
-/* For a function call, does the function return a value using a
-   normal value return or a structure return - passing a hidden
-   argument pointing to storage.  For the latter, there are two
-   cases: language-mandated structure return and target ABI
-   structure return.  */
-
-enum function_call_return_method
-{
-  /* Standard value return.  */
-  return_method_normal = 0,
-
-  /* Language ABI structure return.  This is handled
-     by passing the return location as the first parameter to
-     the function, even preceding "this".  */
-  return_method_hidden_param,
-
-  /* Target ABI struct return.  This is target-specific; for instance,
-     on ia64 the first argument is passed in out0 but the hidden
-     structure return pointer would normally be passed in r8.  */
-  return_method_struct,
-};
-
-enum class memtag_type
-{
-  /* Logical tag, the tag that is stored in unused bits of a pointer to a
-     virtual address.  */
-  logical = 0,
-
-  /* Allocation tag, the tag that is associated with every granule of memory in
-     the physical address space.  Allocation tags are used to validate memory
-     accesses via pointers containing logical tags.  */
-  allocation,
-};
-
-/* Callback types for 'read_core_file_mappings' gdbarch method.  */
-
-using read_core_file_mappings_pre_loop_ftype =
-  gdb::function_view<void (ULONGEST count)>;
-
-using read_core_file_mappings_loop_ftype =
-  gdb::function_view<void (int num,
-			   ULONGEST start,
-			   ULONGEST end,
-			   ULONGEST file_ofs,
-			   const char *filename,
-			   const bfd_build_id *build_id)>;
-EOF
-# close it off
-cat <<EOF
-
-#include "gdbarch-gen.h"
-
-extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
-
-
-/* Mechanism for co-ordinating the selection of a specific
-   architecture.
-
-   GDB targets (*-tdep.c) can register an interest in a specific
-   architecture.  Other GDB components can register a need to maintain
-   per-architecture data.
-
-   The mechanisms below ensures that there is only a loose connection
-   between the set-architecture command and the various GDB
-   components.  Each component can independently register their need
-   to maintain architecture specific data with gdbarch.
-
-   Pragmatics:
-
-   Previously, a single TARGET_ARCHITECTURE_HOOK was provided.  It
-   didn't scale.
-
-   The more traditional mega-struct containing architecture specific
-   data for all the various GDB components was also considered.  Since
-   GDB is built from a variable number of (fairly independent)
-   components it was determined that the global aproach was not
-   applicable.  */
-
-
-/* Register a new architectural family with GDB.
-
-   Register support for the specified ARCHITECTURE with GDB.  When
-   gdbarch determines that the specified architecture has been
-   selected, the corresponding INIT function is called.
-
-   --
-
-   The INIT function takes two parameters: INFO which contains the
-   information available to gdbarch about the (possibly new)
-   architecture; ARCHES which is a list of the previously created
-   \`\`struct gdbarch'' for this architecture.
-
-   The INFO parameter is, as far as possible, be pre-initialized with
-   information obtained from INFO.ABFD or the global defaults.
-
-   The ARCHES parameter is a linked list (sorted most recently used)
-   of all the previously created architures for this architecture
-   family.  The (possibly NULL) ARCHES->gdbarch can used to access
-   values from the previously selected architecture for this
-   architecture family.
-
-   The INIT function shall return any of: NULL - indicating that it
-   doesn't recognize the selected architecture; an existing \`\`struct
-   gdbarch'' from the ARCHES list - indicating that the new
-   architecture is just a synonym for an earlier architecture (see
-   gdbarch_list_lookup_by_info()); a newly created \`\`struct gdbarch''
-   - that describes the selected architecture (see gdbarch_alloc()).
-
-   The DUMP_TDEP function shall print out all target specific values.
-   Care should be taken to ensure that the function works in both the
-   multi-arch and non- multi-arch cases.  */
-
-struct gdbarch_list
-{
-  struct gdbarch *gdbarch;
-  struct gdbarch_list *next;
-};
-
-struct gdbarch_info
-{
-  gdbarch_info ()
-    /* Ensure the union is zero-initialized.  Relies on the fact that there's
-       no member larger than TDESC_DATA.  */
-    : tdesc_data ()
-  {}
-
-  const struct bfd_arch_info *bfd_arch_info = nullptr;
-
-  enum bfd_endian byte_order = BFD_ENDIAN_UNKNOWN;
-
-  enum bfd_endian byte_order_for_code = BFD_ENDIAN_UNKNOWN;
-
-  bfd *abfd = nullptr;
-
-  union
-    {
-      /* Architecture-specific target description data.  Numerous targets
-	 need only this, so give them an easy way to hold it.  */
-      struct tdesc_arch_data *tdesc_data;
-
-      /* SPU file system ID.  This is a single integer, so using the
-	 generic form would only complicate code.  Other targets may
-	 reuse this member if suitable.  */
-      int *id;
-    };
-
-  enum gdb_osabi osabi = GDB_OSABI_UNKNOWN;
-
-  const struct target_desc *target_desc = nullptr;
-};
-
-typedef struct gdbarch *(gdbarch_init_ftype) (struct gdbarch_info info, struct gdbarch_list *arches);
-typedef void (gdbarch_dump_tdep_ftype) (struct gdbarch *gdbarch, struct ui_file *file);
-
-/* DEPRECATED - use gdbarch_register() */
-extern void register_gdbarch_init (enum bfd_architecture architecture, gdbarch_init_ftype *);
-
-extern void gdbarch_register (enum bfd_architecture architecture,
-			      gdbarch_init_ftype *,
-			      gdbarch_dump_tdep_ftype *);
-
-
-/* Return a vector of the valid architecture names.  Since architectures are
-   registered during the _initialize phase this function only returns useful
-   information once initialization has been completed.  */
-
-extern std::vector<const char *> gdbarch_printable_names ();
-
-
-/* Helper function.  Search the list of ARCHES for a GDBARCH that
-   matches the information provided by INFO.  */
-
-extern struct gdbarch_list *gdbarch_list_lookup_by_info (struct gdbarch_list *arches, const struct gdbarch_info *info);
-
-
-/* Helper function.  Create a preliminary \`\`struct gdbarch''.  Perform
-   basic initialization using values obtained from the INFO and TDEP
-   parameters.  set_gdbarch_*() functions are called to complete the
-   initialization of the object.  */
-
-extern struct gdbarch *gdbarch_alloc (const struct gdbarch_info *info, struct gdbarch_tdep *tdep);
-
-
-/* Helper function.  Free a partially-constructed \`\`struct gdbarch''.
-   It is assumed that the caller freeds the \`\`struct
-   gdbarch_tdep''.  */
-
-extern void gdbarch_free (struct gdbarch *);
-
-/* Get the obstack owned by ARCH.  */
-
-extern obstack *gdbarch_obstack (gdbarch *arch);
-
-/* Helper function.  Allocate memory from the \`\`struct gdbarch''
-   obstack.  The memory is freed when the corresponding architecture
-   is also freed.  */
-
-#define GDBARCH_OBSTACK_CALLOC(GDBARCH, NR, TYPE) \
-  obstack_calloc<TYPE> (gdbarch_obstack ((GDBARCH)), (NR))
-
-#define GDBARCH_OBSTACK_ZALLOC(GDBARCH, TYPE) \
-  obstack_zalloc<TYPE> (gdbarch_obstack ((GDBARCH)))
-
-/* Duplicate STRING, returning an equivalent string that's allocated on the
-   obstack associated with GDBARCH.  The string is freed when the corresponding
-   architecture is also freed.  */
-
-extern char *gdbarch_obstack_strdup (struct gdbarch *arch, const char *string);
-
-/* Helper function.  Force an update of the current architecture.
-
-   The actual architecture selected is determined by INFO, \`\`(gdb) set
-   architecture'' et.al., the existing architecture and BFD's default
-   architecture.  INFO should be initialized to zero and then selected
-   fields should be updated.
-
-   Returns non-zero if the update succeeds.  */
-
-extern int gdbarch_update_p (struct gdbarch_info info);
-
-
-/* Helper function.  Find an architecture matching info.
-
-   INFO should have relevant fields set, and then finished using
-   gdbarch_info_fill.
-
-   Returns the corresponding architecture, or NULL if no matching
-   architecture was found.  */
-
-extern struct gdbarch *gdbarch_find_by_info (struct gdbarch_info info);
-
-
-/* Helper function.  Set the target gdbarch to "gdbarch".  */
-
-extern void set_target_gdbarch (struct gdbarch *gdbarch);
-
-
-/* Register per-architecture data-pointer.
-
-   Reserve space for a per-architecture data-pointer.  An identifier
-   for the reserved data-pointer is returned.  That identifer should
-   be saved in a local static variable.
-
-   Memory for the per-architecture data shall be allocated using
-   gdbarch_obstack_zalloc.  That memory will be deleted when the
-   corresponding architecture object is deleted.
-
-   When a previously created architecture is re-selected, the
-   per-architecture data-pointer for that previous architecture is
-   restored.  INIT() is not re-called.
-
-   Multiple registrarants for any architecture are allowed (and
-   strongly encouraged).  */
-
-struct gdbarch_data;
-
-typedef void *(gdbarch_data_pre_init_ftype) (struct obstack *obstack);
-extern struct gdbarch_data *gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *init);
-typedef void *(gdbarch_data_post_init_ftype) (struct gdbarch *gdbarch);
-extern struct gdbarch_data *gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *init);
-
-extern void *gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *);
-
-
-/* Set the dynamic target-system-dependent parameters (architecture,
-   byte-order, ...) using information found in the BFD.  */
-
-extern void set_gdbarch_from_file (bfd *);
-
-
-/* Initialize the current architecture to the "first" one we find on
-   our list.  */
-
-extern void initialize_current_architecture (void);
-
-/* gdbarch trace variable */
-extern unsigned int gdbarch_debug;
-
-extern void gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file);
-
-/* Return the number of cooked registers (raw + pseudo) for ARCH.  */
-
-static inline int
-gdbarch_num_cooked_regs (gdbarch *arch)
-{
-  return gdbarch_num_regs (arch) + gdbarch_num_pseudo_regs (arch);
-}
-
-#endif
-EOF
-
-exec 1>&2
-../move-if-change new-gdbarch.h gdbarch.h
-rm -f new-gdbarch.h
-
 exec > new-gdbarch-gen.h
 copyright
 
-- 
2.31.1


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v2 4/8] Do not sort the fields in gdbarch_dump
  2021-12-16 20:38 [PATCH v2 0/8] Rewrite gdbarch.sh in Python Tom Tromey
                   ` (2 preceding siblings ...)
  2021-12-16 20:38 ` [PATCH v2 3/8] Do not generate gdbarch.h Tom Tromey
@ 2021-12-16 20:38 ` Tom Tromey
  2021-12-16 20:38 ` [PATCH v2 5/8] Generate new gdbarch-components.py from gdbarch.sh Tom Tromey
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 21+ messages in thread
From: Tom Tromey @ 2021-12-16 20:38 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes gdbarch.sh so that it no longer sorts the fields in
gdbarch_dump.  This sorting isn't done anywhere else by gdbarch.sh,
and this simplifies the new generator a little bit.
---
 gdb/gdbarch.c  | 1052 ++++++++++++++++++++++++------------------------
 gdb/gdbarch.sh |    2 +-
 2 files changed, 527 insertions(+), 527 deletions(-)

diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index f4460a6e616..3f96abe36bb 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -640,77 +640,32 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
 		      "gdbarch_dump: GDB_NM_FILE = %s\n",
 		      gdb_nm_file);
   fprintf_unfiltered (file,
-                      "gdbarch_dump: addr_bit = %s\n",
-                      plongest (gdbarch->addr_bit));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: addr_bits_remove = <%s>\n",
-                      host_address_to_string (gdbarch->addr_bits_remove));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
-                      gdbarch_address_class_name_to_type_flags_p (gdbarch));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: address_class_name_to_type_flags = <%s>\n",
-                      host_address_to_string (gdbarch->address_class_name_to_type_flags));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
-                      gdbarch_address_class_type_flags_p (gdbarch));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: address_class_type_flags = <%s>\n",
-                      host_address_to_string (gdbarch->address_class_type_flags));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
-                      gdbarch_address_class_type_flags_to_name_p (gdbarch));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: address_class_type_flags_to_name = <%s>\n",
-                      host_address_to_string (gdbarch->address_class_type_flags_to_name));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: address_to_pointer = <%s>\n",
-                      host_address_to_string (gdbarch->address_to_pointer));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: addressable_memory_unit_size = <%s>\n",
-                      host_address_to_string (gdbarch->addressable_memory_unit_size));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
-                      gdbarch_adjust_breakpoint_address_p (gdbarch));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: adjust_breakpoint_address = <%s>\n",
-                      host_address_to_string (gdbarch->adjust_breakpoint_address));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: adjust_dwarf2_addr = <%s>\n",
-                      host_address_to_string (gdbarch->adjust_dwarf2_addr));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: adjust_dwarf2_line = <%s>\n",
-                      host_address_to_string (gdbarch->adjust_dwarf2_line));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: auto_charset = <%s>\n",
-                      host_address_to_string (gdbarch->auto_charset));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: auto_wide_charset = <%s>\n",
-                      host_address_to_string (gdbarch->auto_wide_charset));
+                      "gdbarch_dump: bfd_arch_info = %s\n",
+                      gdbarch_bfd_arch_info (gdbarch)->printable_name);
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_auxv_parse_p() = %d\n",
-                      gdbarch_auxv_parse_p (gdbarch));
+                      "gdbarch_dump: byte_order = %s\n",
+                      plongest (gdbarch->byte_order));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: auxv_parse = <%s>\n",
-                      host_address_to_string (gdbarch->auxv_parse));
+                      "gdbarch_dump: byte_order_for_code = %s\n",
+                      plongest (gdbarch->byte_order_for_code));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_ax_pseudo_register_collect_p() = %d\n",
-                      gdbarch_ax_pseudo_register_collect_p (gdbarch));
+                      "gdbarch_dump: osabi = %s\n",
+                      plongest (gdbarch->osabi));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: ax_pseudo_register_collect = <%s>\n",
-                      host_address_to_string (gdbarch->ax_pseudo_register_collect));
+                      "gdbarch_dump: target_desc = %s\n",
+                      host_address_to_string (gdbarch->target_desc));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_ax_pseudo_register_push_stack_p() = %d\n",
-                      gdbarch_ax_pseudo_register_push_stack_p (gdbarch));
+                      "gdbarch_dump: short_bit = %s\n",
+                      plongest (gdbarch->short_bit));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: ax_pseudo_register_push_stack = <%s>\n",
-                      host_address_to_string (gdbarch->ax_pseudo_register_push_stack));
+                      "gdbarch_dump: int_bit = %s\n",
+                      plongest (gdbarch->int_bit));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: believe_pcc_promotion = %s\n",
-                      plongest (gdbarch->believe_pcc_promotion));
+                      "gdbarch_dump: long_bit = %s\n",
+                      plongest (gdbarch->long_bit));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: bfd_arch_info = %s\n",
-                      gdbarch_bfd_arch_info (gdbarch)->printable_name);
+                      "gdbarch_dump: long_long_bit = %s\n",
+                      plongest (gdbarch->long_long_bit));
   fprintf_unfiltered (file,
                       "gdbarch_dump: bfloat16_bit = %s\n",
                       plongest (gdbarch->bfloat16_bit));
@@ -718,287 +673,284 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "gdbarch_dump: bfloat16_format = %s\n",
                       pformat (gdbarch->bfloat16_format));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: breakpoint_from_pc = <%s>\n",
-                      host_address_to_string (gdbarch->breakpoint_from_pc));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: breakpoint_kind_from_current_state = <%s>\n",
-                      host_address_to_string (gdbarch->breakpoint_kind_from_current_state));
+                      "gdbarch_dump: half_bit = %s\n",
+                      plongest (gdbarch->half_bit));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: breakpoint_kind_from_pc = <%s>\n",
-                      host_address_to_string (gdbarch->breakpoint_kind_from_pc));
+                      "gdbarch_dump: half_format = %s\n",
+                      pformat (gdbarch->half_format));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: byte_order = %s\n",
-                      plongest (gdbarch->byte_order));
+                      "gdbarch_dump: float_bit = %s\n",
+                      plongest (gdbarch->float_bit));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: byte_order_for_code = %s\n",
-                      plongest (gdbarch->byte_order_for_code));
+                      "gdbarch_dump: float_format = %s\n",
+                      pformat (gdbarch->float_format));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: call_dummy_location = %s\n",
-                      plongest (gdbarch->call_dummy_location));
+                      "gdbarch_dump: double_bit = %s\n",
+                      plongest (gdbarch->double_bit));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: cannot_fetch_register = <%s>\n",
-                      host_address_to_string (gdbarch->cannot_fetch_register));
+                      "gdbarch_dump: double_format = %s\n",
+                      pformat (gdbarch->double_format));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: cannot_step_breakpoint = %s\n",
-                      plongest (gdbarch->cannot_step_breakpoint));
+                      "gdbarch_dump: long_double_bit = %s\n",
+                      plongest (gdbarch->long_double_bit));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: cannot_store_register = <%s>\n",
-                      host_address_to_string (gdbarch->cannot_store_register));
+                      "gdbarch_dump: long_double_format = %s\n",
+                      pformat (gdbarch->long_double_format));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: char_signed = %s\n",
-                      plongest (gdbarch->char_signed));
+                      "gdbarch_dump: wchar_bit = %s\n",
+                      plongest (gdbarch->wchar_bit));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: code_of_frame_writable = <%s>\n",
-                      host_address_to_string (gdbarch->code_of_frame_writable));
+                      "gdbarch_dump: wchar_signed = %s\n",
+                      plongest (gdbarch->wchar_signed));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: coff_make_msymbol_special = <%s>\n",
-                      host_address_to_string (gdbarch->coff_make_msymbol_special));
+                      "gdbarch_dump: floatformat_for_type = <%s>\n",
+                      host_address_to_string (gdbarch->floatformat_for_type));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: convert_from_func_ptr_addr = <%s>\n",
-                      host_address_to_string (gdbarch->convert_from_func_ptr_addr));
+                      "gdbarch_dump: ptr_bit = %s\n",
+                      plongest (gdbarch->ptr_bit));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: convert_register_p = <%s>\n",
-                      host_address_to_string (gdbarch->convert_register_p));
+                      "gdbarch_dump: addr_bit = %s\n",
+                      plongest (gdbarch->addr_bit));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_core_info_proc_p() = %d\n",
-                      gdbarch_core_info_proc_p (gdbarch));
+                      "gdbarch_dump: dwarf2_addr_size = %s\n",
+                      plongest (gdbarch->dwarf2_addr_size));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: core_info_proc = <%s>\n",
-                      host_address_to_string (gdbarch->core_info_proc));
+                      "gdbarch_dump: char_signed = %s\n",
+                      plongest (gdbarch->char_signed));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_core_pid_to_str_p() = %d\n",
-                      gdbarch_core_pid_to_str_p (gdbarch));
+                      "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
+                      gdbarch_read_pc_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: core_pid_to_str = <%s>\n",
-                      host_address_to_string (gdbarch->core_pid_to_str));
+                      "gdbarch_dump: read_pc = <%s>\n",
+                      host_address_to_string (gdbarch->read_pc));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_core_read_description_p() = %d\n",
-                      gdbarch_core_read_description_p (gdbarch));
+                      "gdbarch_dump: gdbarch_write_pc_p() = %d\n",
+                      gdbarch_write_pc_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: core_read_description = <%s>\n",
-                      host_address_to_string (gdbarch->core_read_description));
+                      "gdbarch_dump: write_pc = <%s>\n",
+                      host_address_to_string (gdbarch->write_pc));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_core_thread_name_p() = %d\n",
-                      gdbarch_core_thread_name_p (gdbarch));
+                      "gdbarch_dump: virtual_frame_pointer = <%s>\n",
+                      host_address_to_string (gdbarch->virtual_frame_pointer));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: core_thread_name = <%s>\n",
-                      host_address_to_string (gdbarch->core_thread_name));
+                      "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
+                      gdbarch_pseudo_register_read_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_core_xfer_shared_libraries_p() = %d\n",
-                      gdbarch_core_xfer_shared_libraries_p (gdbarch));
+                      "gdbarch_dump: pseudo_register_read = <%s>\n",
+                      host_address_to_string (gdbarch->pseudo_register_read));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: core_xfer_shared_libraries = <%s>\n",
-                      host_address_to_string (gdbarch->core_xfer_shared_libraries));
+                      "gdbarch_dump: gdbarch_pseudo_register_read_value_p() = %d\n",
+                      gdbarch_pseudo_register_read_value_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_core_xfer_shared_libraries_aix_p() = %d\n",
-                      gdbarch_core_xfer_shared_libraries_aix_p (gdbarch));
+                      "gdbarch_dump: pseudo_register_read_value = <%s>\n",
+                      host_address_to_string (gdbarch->pseudo_register_read_value));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: core_xfer_shared_libraries_aix = <%s>\n",
-                      host_address_to_string (gdbarch->core_xfer_shared_libraries_aix));
+                      "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
+                      gdbarch_pseudo_register_write_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_core_xfer_siginfo_p() = %d\n",
-                      gdbarch_core_xfer_siginfo_p (gdbarch));
+                      "gdbarch_dump: pseudo_register_write = <%s>\n",
+                      host_address_to_string (gdbarch->pseudo_register_write));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: core_xfer_siginfo = <%s>\n",
-                      host_address_to_string (gdbarch->core_xfer_siginfo));
+                      "gdbarch_dump: num_regs = %s\n",
+                      plongest (gdbarch->num_regs));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: decr_pc_after_break = %s\n",
-                      core_addr_to_string_nz (gdbarch->decr_pc_after_break));
+                      "gdbarch_dump: num_pseudo_regs = %s\n",
+                      plongest (gdbarch->num_pseudo_regs));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: deprecated_fp_regnum = %s\n",
-                      plongest (gdbarch->deprecated_fp_regnum));
+                      "gdbarch_dump: gdbarch_ax_pseudo_register_collect_p() = %d\n",
+                      gdbarch_ax_pseudo_register_collect_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: deprecated_function_start_offset = %s\n",
-                      core_addr_to_string_nz (gdbarch->deprecated_function_start_offset));
+                      "gdbarch_dump: ax_pseudo_register_collect = <%s>\n",
+                      host_address_to_string (gdbarch->ax_pseudo_register_collect));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: disassembler_options = %s\n",
-                      pstring_ptr (gdbarch->disassembler_options));
+                      "gdbarch_dump: gdbarch_ax_pseudo_register_push_stack_p() = %d\n",
+                      gdbarch_ax_pseudo_register_push_stack_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: disassembler_options_implicit = %s\n",
-                      pstring (gdbarch->disassembler_options_implicit));
+                      "gdbarch_dump: ax_pseudo_register_push_stack = <%s>\n",
+                      host_address_to_string (gdbarch->ax_pseudo_register_push_stack));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_displaced_step_copy_insn_p() = %d\n",
-                      gdbarch_displaced_step_copy_insn_p (gdbarch));
+                      "gdbarch_dump: gdbarch_report_signal_info_p() = %d\n",
+                      gdbarch_report_signal_info_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: displaced_step_copy_insn = <%s>\n",
-                      host_address_to_string (gdbarch->displaced_step_copy_insn));
+                      "gdbarch_dump: report_signal_info = <%s>\n",
+                      host_address_to_string (gdbarch->report_signal_info));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_displaced_step_copy_insn_closure_by_addr_p() = %d\n",
-                      gdbarch_displaced_step_copy_insn_closure_by_addr_p (gdbarch));
+                      "gdbarch_dump: sp_regnum = %s\n",
+                      plongest (gdbarch->sp_regnum));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: displaced_step_copy_insn_closure_by_addr = <%s>\n",
-                      host_address_to_string (gdbarch->displaced_step_copy_insn_closure_by_addr));
+                      "gdbarch_dump: pc_regnum = %s\n",
+                      plongest (gdbarch->pc_regnum));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: displaced_step_finish = <%s>\n",
-                      host_address_to_string (gdbarch->displaced_step_finish));
+                      "gdbarch_dump: ps_regnum = %s\n",
+                      plongest (gdbarch->ps_regnum));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_displaced_step_fixup_p() = %d\n",
-                      gdbarch_displaced_step_fixup_p (gdbarch));
+                      "gdbarch_dump: fp0_regnum = %s\n",
+                      plongest (gdbarch->fp0_regnum));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: displaced_step_fixup = <%s>\n",
-                      host_address_to_string (gdbarch->displaced_step_fixup));
+                      "gdbarch_dump: stab_reg_to_regnum = <%s>\n",
+                      host_address_to_string (gdbarch->stab_reg_to_regnum));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: displaced_step_hw_singlestep = <%s>\n",
-                      host_address_to_string (gdbarch->displaced_step_hw_singlestep));
+                      "gdbarch_dump: ecoff_reg_to_regnum = <%s>\n",
+                      host_address_to_string (gdbarch->ecoff_reg_to_regnum));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_displaced_step_prepare_p() = %d\n",
-                      gdbarch_displaced_step_prepare_p (gdbarch));
+                      "gdbarch_dump: sdb_reg_to_regnum = <%s>\n",
+                      host_address_to_string (gdbarch->sdb_reg_to_regnum));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: displaced_step_prepare = <%s>\n",
-                      host_address_to_string (gdbarch->displaced_step_prepare));
+                      "gdbarch_dump: dwarf2_reg_to_regnum = <%s>\n",
+                      host_address_to_string (gdbarch->dwarf2_reg_to_regnum));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: displaced_step_restore_all_in_ptid = <%s>\n",
-                      host_address_to_string (gdbarch->displaced_step_restore_all_in_ptid));
+                      "gdbarch_dump: register_name = <%s>\n",
+                      host_address_to_string (gdbarch->register_name));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: double_bit = %s\n",
-                      plongest (gdbarch->double_bit));
+                      "gdbarch_dump: gdbarch_register_type_p() = %d\n",
+                      gdbarch_register_type_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: double_format = %s\n",
-                      pformat (gdbarch->double_format));
+                      "gdbarch_dump: register_type = <%s>\n",
+                      host_address_to_string (gdbarch->register_type));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_dtrace_disable_probe_p() = %d\n",
-                      gdbarch_dtrace_disable_probe_p (gdbarch));
+                      "gdbarch_dump: dummy_id = <%s>\n",
+                      host_address_to_string (gdbarch->dummy_id));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: dtrace_disable_probe = <%s>\n",
-                      host_address_to_string (gdbarch->dtrace_disable_probe));
+                      "gdbarch_dump: deprecated_fp_regnum = %s\n",
+                      plongest (gdbarch->deprecated_fp_regnum));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_dtrace_enable_probe_p() = %d\n",
-                      gdbarch_dtrace_enable_probe_p (gdbarch));
+                      "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
+                      gdbarch_push_dummy_call_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: dtrace_enable_probe = <%s>\n",
-                      host_address_to_string (gdbarch->dtrace_enable_probe));
+                      "gdbarch_dump: push_dummy_call = <%s>\n",
+                      host_address_to_string (gdbarch->push_dummy_call));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_dtrace_parse_probe_argument_p() = %d\n",
-                      gdbarch_dtrace_parse_probe_argument_p (gdbarch));
+                      "gdbarch_dump: call_dummy_location = %s\n",
+                      plongest (gdbarch->call_dummy_location));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: dtrace_parse_probe_argument = <%s>\n",
-                      host_address_to_string (gdbarch->dtrace_parse_probe_argument));
+                      "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
+                      gdbarch_push_dummy_code_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_dtrace_probe_is_enabled_p() = %d\n",
-                      gdbarch_dtrace_probe_is_enabled_p (gdbarch));
+                      "gdbarch_dump: push_dummy_code = <%s>\n",
+                      host_address_to_string (gdbarch->push_dummy_code));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: dtrace_probe_is_enabled = <%s>\n",
-                      host_address_to_string (gdbarch->dtrace_probe_is_enabled));
+                      "gdbarch_dump: code_of_frame_writable = <%s>\n",
+                      host_address_to_string (gdbarch->code_of_frame_writable));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: dummy_id = <%s>\n",
-                      host_address_to_string (gdbarch->dummy_id));
+                      "gdbarch_dump: print_registers_info = <%s>\n",
+                      host_address_to_string (gdbarch->print_registers_info));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: dwarf2_addr_size = %s\n",
-                      plongest (gdbarch->dwarf2_addr_size));
+                      "gdbarch_dump: print_float_info = <%s>\n",
+                      host_address_to_string (gdbarch->print_float_info));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: dwarf2_reg_to_regnum = <%s>\n",
-                      host_address_to_string (gdbarch->dwarf2_reg_to_regnum));
+                      "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
+                      gdbarch_print_vector_info_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: ecoff_reg_to_regnum = <%s>\n",
-                      host_address_to_string (gdbarch->ecoff_reg_to_regnum));
+                      "gdbarch_dump: print_vector_info = <%s>\n",
+                      host_address_to_string (gdbarch->print_vector_info));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_elf_make_msymbol_special_p() = %d\n",
-                      gdbarch_elf_make_msymbol_special_p (gdbarch));
+                      "gdbarch_dump: register_sim_regno = <%s>\n",
+                      host_address_to_string (gdbarch->register_sim_regno));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: elf_make_msymbol_special = <%s>\n",
-                      host_address_to_string (gdbarch->elf_make_msymbol_special));
+                      "gdbarch_dump: cannot_fetch_register = <%s>\n",
+                      host_address_to_string (gdbarch->cannot_fetch_register));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: execute_dwarf_cfa_vendor_op = <%s>\n",
-                      host_address_to_string (gdbarch->execute_dwarf_cfa_vendor_op));
+                      "gdbarch_dump: cannot_store_register = <%s>\n",
+                      host_address_to_string (gdbarch->cannot_store_register));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: fast_tracepoint_valid_at = <%s>\n",
-                      host_address_to_string (gdbarch->fast_tracepoint_valid_at));
+                      "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
+                      gdbarch_get_longjmp_target_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
-                      gdbarch_fetch_pointer_argument_p (gdbarch));
+                      "gdbarch_dump: get_longjmp_target = <%s>\n",
+                      host_address_to_string (gdbarch->get_longjmp_target));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: fetch_pointer_argument = <%s>\n",
-                      host_address_to_string (gdbarch->fetch_pointer_argument));
+                      "gdbarch_dump: believe_pcc_promotion = %s\n",
+                      plongest (gdbarch->believe_pcc_promotion));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
-                      gdbarch_fetch_tls_load_module_address_p (gdbarch));
+                      "gdbarch_dump: convert_register_p = <%s>\n",
+                      host_address_to_string (gdbarch->convert_register_p));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: fetch_tls_load_module_address = <%s>\n",
-                      host_address_to_string (gdbarch->fetch_tls_load_module_address));
+                      "gdbarch_dump: register_to_value = <%s>\n",
+                      host_address_to_string (gdbarch->register_to_value));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_find_memory_regions_p() = %d\n",
-                      gdbarch_find_memory_regions_p (gdbarch));
+                      "gdbarch_dump: value_to_register = <%s>\n",
+                      host_address_to_string (gdbarch->value_to_register));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: find_memory_regions = <%s>\n",
-                      host_address_to_string (gdbarch->find_memory_regions));
+                      "gdbarch_dump: value_from_register = <%s>\n",
+                      host_address_to_string (gdbarch->value_from_register));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: float_bit = %s\n",
-                      plongest (gdbarch->float_bit));
+                      "gdbarch_dump: pointer_to_address = <%s>\n",
+                      host_address_to_string (gdbarch->pointer_to_address));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: float_format = %s\n",
-                      pformat (gdbarch->float_format));
+                      "gdbarch_dump: address_to_pointer = <%s>\n",
+                      host_address_to_string (gdbarch->address_to_pointer));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: floatformat_for_type = <%s>\n",
-                      host_address_to_string (gdbarch->floatformat_for_type));
+                      "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
+                      gdbarch_integer_to_address_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: fp0_regnum = %s\n",
-                      plongest (gdbarch->fp0_regnum));
+                      "gdbarch_dump: integer_to_address = <%s>\n",
+                      host_address_to_string (gdbarch->integer_to_address));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
-                      gdbarch_frame_align_p (gdbarch));
+                      "gdbarch_dump: gdbarch_return_value_p() = %d\n",
+                      gdbarch_return_value_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: frame_align = <%s>\n",
-                      host_address_to_string (gdbarch->frame_align));
+                      "gdbarch_dump: return_value = <%s>\n",
+                      host_address_to_string (gdbarch->return_value));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: frame_args_skip = %s\n",
-                      core_addr_to_string_nz (gdbarch->frame_args_skip));
+                      "gdbarch_dump: return_in_first_hidden_param_p = <%s>\n",
+                      host_address_to_string (gdbarch->return_in_first_hidden_param_p));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
-                      gdbarch_frame_num_args_p (gdbarch));
+                      "gdbarch_dump: skip_prologue = <%s>\n",
+                      host_address_to_string (gdbarch->skip_prologue));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: frame_num_args = <%s>\n",
-                      host_address_to_string (gdbarch->frame_num_args));
+                      "gdbarch_dump: gdbarch_skip_main_prologue_p() = %d\n",
+                      gdbarch_skip_main_prologue_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: frame_red_zone_size = %s\n",
-                      plongest (gdbarch->frame_red_zone_size));
+                      "gdbarch_dump: skip_main_prologue = <%s>\n",
+                      host_address_to_string (gdbarch->skip_main_prologue));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gcc_target_options = <%s>\n",
-                      host_address_to_string (gdbarch->gcc_target_options));
+                      "gdbarch_dump: gdbarch_skip_entrypoint_p() = %d\n",
+                      gdbarch_skip_entrypoint_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_gcore_bfd_target_p() = %d\n",
-                      gdbarch_gcore_bfd_target_p (gdbarch));
+                      "gdbarch_dump: skip_entrypoint = <%s>\n",
+                      host_address_to_string (gdbarch->skip_entrypoint));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gcore_bfd_target = %s\n",
-                      pstring (gdbarch->gcore_bfd_target));
+                      "gdbarch_dump: inner_than = <%s>\n",
+                      host_address_to_string (gdbarch->inner_than));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_gdb_signal_from_target_p() = %d\n",
-                      gdbarch_gdb_signal_from_target_p (gdbarch));
+                      "gdbarch_dump: breakpoint_from_pc = <%s>\n",
+                      host_address_to_string (gdbarch->breakpoint_from_pc));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdb_signal_from_target = <%s>\n",
-                      host_address_to_string (gdbarch->gdb_signal_from_target));
+                      "gdbarch_dump: breakpoint_kind_from_pc = <%s>\n",
+                      host_address_to_string (gdbarch->breakpoint_kind_from_pc));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_gdb_signal_to_target_p() = %d\n",
-                      gdbarch_gdb_signal_to_target_p (gdbarch));
+                      "gdbarch_dump: sw_breakpoint_from_kind = <%s>\n",
+                      host_address_to_string (gdbarch->sw_breakpoint_from_kind));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdb_signal_to_target = <%s>\n",
-                      host_address_to_string (gdbarch->gdb_signal_to_target));
+                      "gdbarch_dump: breakpoint_kind_from_current_state = <%s>\n",
+                      host_address_to_string (gdbarch->breakpoint_kind_from_current_state));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gen_return_address = <%s>\n",
-                      host_address_to_string (gdbarch->gen_return_address));
+                      "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
+                      gdbarch_adjust_breakpoint_address_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
-                      gdbarch_get_longjmp_target_p (gdbarch));
+                      "gdbarch_dump: adjust_breakpoint_address = <%s>\n",
+                      host_address_to_string (gdbarch->adjust_breakpoint_address));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: get_longjmp_target = <%s>\n",
-                      host_address_to_string (gdbarch->get_longjmp_target));
+                      "gdbarch_dump: memory_insert_breakpoint = <%s>\n",
+                      host_address_to_string (gdbarch->memory_insert_breakpoint));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: get_memtag = <%s>\n",
-                      host_address_to_string (gdbarch->get_memtag));
+                      "gdbarch_dump: memory_remove_breakpoint = <%s>\n",
+                      host_address_to_string (gdbarch->memory_remove_breakpoint));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: get_pc_address_flags = <%s>\n",
-                      host_address_to_string (gdbarch->get_pc_address_flags));
+                      "gdbarch_dump: decr_pc_after_break = %s\n",
+                      core_addr_to_string_nz (gdbarch->decr_pc_after_break));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_get_siginfo_type_p() = %d\n",
-                      gdbarch_get_siginfo_type_p (gdbarch));
+                      "gdbarch_dump: deprecated_function_start_offset = %s\n",
+                      core_addr_to_string_nz (gdbarch->deprecated_function_start_offset));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: get_siginfo_type = <%s>\n",
-                      host_address_to_string (gdbarch->get_siginfo_type));
+                      "gdbarch_dump: remote_register_number = <%s>\n",
+                      host_address_to_string (gdbarch->remote_register_number));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_get_syscall_number_p() = %d\n",
-                      gdbarch_get_syscall_number_p (gdbarch));
+                      "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
+                      gdbarch_fetch_tls_load_module_address_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: get_syscall_number = <%s>\n",
-                      host_address_to_string (gdbarch->get_syscall_number));
+                      "gdbarch_dump: fetch_tls_load_module_address = <%s>\n",
+                      host_address_to_string (gdbarch->fetch_tls_load_module_address));
   fprintf_unfiltered (file,
                       "gdbarch_dump: gdbarch_get_thread_local_address_p() = %d\n",
                       gdbarch_get_thread_local_address_p (gdbarch));
@@ -1006,248 +958,245 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "gdbarch_dump: get_thread_local_address = <%s>\n",
                       host_address_to_string (gdbarch->get_thread_local_address));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gnu_triplet_regexp = <%s>\n",
-                      host_address_to_string (gdbarch->gnu_triplet_regexp));
+                      "gdbarch_dump: frame_args_skip = %s\n",
+                      core_addr_to_string_nz (gdbarch->frame_args_skip));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: guess_tracepoint_registers = <%s>\n",
-                      host_address_to_string (gdbarch->guess_tracepoint_registers));
+                      "gdbarch_dump: unwind_pc = <%s>\n",
+                      host_address_to_string (gdbarch->unwind_pc));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: half_bit = %s\n",
-                      plongest (gdbarch->half_bit));
+                      "gdbarch_dump: unwind_sp = <%s>\n",
+                      host_address_to_string (gdbarch->unwind_sp));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: half_format = %s\n",
-                      pformat (gdbarch->half_format));
+                      "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
+                      gdbarch_frame_num_args_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: has_dos_based_file_system = %s\n",
-                      plongest (gdbarch->has_dos_based_file_system));
+                      "gdbarch_dump: frame_num_args = <%s>\n",
+                      host_address_to_string (gdbarch->frame_num_args));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: has_global_breakpoints = %s\n",
-                      plongest (gdbarch->has_global_breakpoints));
+                      "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
+                      gdbarch_frame_align_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: has_global_solist = %s\n",
-                      plongest (gdbarch->has_global_solist));
+                      "gdbarch_dump: frame_align = <%s>\n",
+                      host_address_to_string (gdbarch->frame_align));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: has_shared_address_space = <%s>\n",
-                      host_address_to_string (gdbarch->has_shared_address_space));
+                      "gdbarch_dump: stabs_argument_has_addr = <%s>\n",
+                      host_address_to_string (gdbarch->stabs_argument_has_addr));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
-                      plongest (gdbarch->have_nonsteppable_watchpoint));
+                      "gdbarch_dump: frame_red_zone_size = %s\n",
+                      plongest (gdbarch->frame_red_zone_size));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: in_indirect_branch_thunk = <%s>\n",
-                      host_address_to_string (gdbarch->in_indirect_branch_thunk));
+                      "gdbarch_dump: convert_from_func_ptr_addr = <%s>\n",
+                      host_address_to_string (gdbarch->convert_from_func_ptr_addr));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: in_solib_return_trampoline = <%s>\n",
-                      host_address_to_string (gdbarch->in_solib_return_trampoline));
+                      "gdbarch_dump: addr_bits_remove = <%s>\n",
+                      host_address_to_string (gdbarch->addr_bits_remove));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: infcall_mmap = <%s>\n",
-                      host_address_to_string (gdbarch->infcall_mmap));
+                      "gdbarch_dump: significant_addr_bit = %s\n",
+                      plongest (gdbarch->significant_addr_bit));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: infcall_munmap = <%s>\n",
-                      host_address_to_string (gdbarch->infcall_munmap));
+                      "gdbarch_dump: memtag_to_string = <%s>\n",
+                      host_address_to_string (gdbarch->memtag_to_string));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_info_proc_p() = %d\n",
-                      gdbarch_info_proc_p (gdbarch));
+                      "gdbarch_dump: tagged_address_p = <%s>\n",
+                      host_address_to_string (gdbarch->tagged_address_p));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: info_proc = <%s>\n",
-                      host_address_to_string (gdbarch->info_proc));
+                      "gdbarch_dump: memtag_matches_p = <%s>\n",
+                      host_address_to_string (gdbarch->memtag_matches_p));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: inner_than = <%s>\n",
-                      host_address_to_string (gdbarch->inner_than));
+                      "gdbarch_dump: set_memtags = <%s>\n",
+                      host_address_to_string (gdbarch->set_memtags));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: insn_is_call = <%s>\n",
-                      host_address_to_string (gdbarch->insn_is_call));
+                      "gdbarch_dump: get_memtag = <%s>\n",
+                      host_address_to_string (gdbarch->get_memtag));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: insn_is_jump = <%s>\n",
-                      host_address_to_string (gdbarch->insn_is_jump));
+                      "gdbarch_dump: memtag_granule_size = %s\n",
+                      core_addr_to_string_nz (gdbarch->memtag_granule_size));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: insn_is_ret = <%s>\n",
-                      host_address_to_string (gdbarch->insn_is_ret));
+                      "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
+                      gdbarch_software_single_step_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: int_bit = %s\n",
-                      plongest (gdbarch->int_bit));
+                      "gdbarch_dump: software_single_step = <%s>\n",
+                      host_address_to_string (gdbarch->software_single_step));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
-                      gdbarch_integer_to_address_p (gdbarch));
+                      "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
+                      gdbarch_single_step_through_delay_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: integer_to_address = <%s>\n",
-                      host_address_to_string (gdbarch->integer_to_address));
+                      "gdbarch_dump: single_step_through_delay = <%s>\n",
+                      host_address_to_string (gdbarch->single_step_through_delay));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: iterate_over_objfiles_in_search_order = <%s>\n",
-                      host_address_to_string (gdbarch->iterate_over_objfiles_in_search_order));
+                      "gdbarch_dump: print_insn = <%s>\n",
+                      host_address_to_string (gdbarch->print_insn));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_iterate_over_regset_sections_p() = %d\n",
-                      gdbarch_iterate_over_regset_sections_p (gdbarch));
+                      "gdbarch_dump: skip_trampoline_code = <%s>\n",
+                      host_address_to_string (gdbarch->skip_trampoline_code));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: iterate_over_regset_sections = <%s>\n",
-                      host_address_to_string (gdbarch->iterate_over_regset_sections));
+                      "gdbarch_dump: skip_solib_resolver = <%s>\n",
+                      host_address_to_string (gdbarch->skip_solib_resolver));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: long_bit = %s\n",
-                      plongest (gdbarch->long_bit));
+                      "gdbarch_dump: in_solib_return_trampoline = <%s>\n",
+                      host_address_to_string (gdbarch->in_solib_return_trampoline));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: long_double_bit = %s\n",
-                      plongest (gdbarch->long_double_bit));
+                      "gdbarch_dump: in_indirect_branch_thunk = <%s>\n",
+                      host_address_to_string (gdbarch->in_indirect_branch_thunk));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: long_double_format = %s\n",
-                      pformat (gdbarch->long_double_format));
+                      "gdbarch_dump: stack_frame_destroyed_p = <%s>\n",
+                      host_address_to_string (gdbarch->stack_frame_destroyed_p));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: long_long_bit = %s\n",
-                      plongest (gdbarch->long_long_bit));
+                      "gdbarch_dump: gdbarch_elf_make_msymbol_special_p() = %d\n",
+                      gdbarch_elf_make_msymbol_special_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_make_corefile_notes_p() = %d\n",
-                      gdbarch_make_corefile_notes_p (gdbarch));
+                      "gdbarch_dump: elf_make_msymbol_special = <%s>\n",
+                      host_address_to_string (gdbarch->elf_make_msymbol_special));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: make_corefile_notes = <%s>\n",
-                      host_address_to_string (gdbarch->make_corefile_notes));
+                      "gdbarch_dump: coff_make_msymbol_special = <%s>\n",
+                      host_address_to_string (gdbarch->coff_make_msymbol_special));
   fprintf_unfiltered (file,
                       "gdbarch_dump: make_symbol_special = <%s>\n",
                       host_address_to_string (gdbarch->make_symbol_special));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_max_insn_length_p() = %d\n",
-                      gdbarch_max_insn_length_p (gdbarch));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: max_insn_length = %s\n",
-                      plongest (gdbarch->max_insn_length));
+                      "gdbarch_dump: adjust_dwarf2_addr = <%s>\n",
+                      host_address_to_string (gdbarch->adjust_dwarf2_addr));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: memory_insert_breakpoint = <%s>\n",
-                      host_address_to_string (gdbarch->memory_insert_breakpoint));
+                      "gdbarch_dump: adjust_dwarf2_line = <%s>\n",
+                      host_address_to_string (gdbarch->adjust_dwarf2_line));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: memory_remove_breakpoint = <%s>\n",
-                      host_address_to_string (gdbarch->memory_remove_breakpoint));
+                      "gdbarch_dump: cannot_step_breakpoint = %s\n",
+                      plongest (gdbarch->cannot_step_breakpoint));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: memtag_granule_size = %s\n",
-                      core_addr_to_string_nz (gdbarch->memtag_granule_size));
+                      "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
+                      plongest (gdbarch->have_nonsteppable_watchpoint));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: memtag_matches_p = <%s>\n",
-                      host_address_to_string (gdbarch->memtag_matches_p));
+                      "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
+                      gdbarch_address_class_type_flags_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: memtag_to_string = <%s>\n",
-                      host_address_to_string (gdbarch->memtag_to_string));
+                      "gdbarch_dump: address_class_type_flags = <%s>\n",
+                      host_address_to_string (gdbarch->address_class_type_flags));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: num_pseudo_regs = %s\n",
-                      plongest (gdbarch->num_pseudo_regs));
+                      "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
+                      gdbarch_address_class_type_flags_to_name_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: num_regs = %s\n",
-                      plongest (gdbarch->num_regs));
+                      "gdbarch_dump: address_class_type_flags_to_name = <%s>\n",
+                      host_address_to_string (gdbarch->address_class_type_flags_to_name));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: osabi = %s\n",
-                      plongest (gdbarch->osabi));
+                      "gdbarch_dump: execute_dwarf_cfa_vendor_op = <%s>\n",
+                      host_address_to_string (gdbarch->execute_dwarf_cfa_vendor_op));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
-                      gdbarch_overlay_update_p (gdbarch));
+                      "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
+                      gdbarch_address_class_name_to_type_flags_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: overlay_update = <%s>\n",
-                      host_address_to_string (gdbarch->overlay_update));
+                      "gdbarch_dump: address_class_name_to_type_flags = <%s>\n",
+                      host_address_to_string (gdbarch->address_class_name_to_type_flags));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: pc_regnum = %s\n",
-                      plongest (gdbarch->pc_regnum));
+                      "gdbarch_dump: register_reggroup_p = <%s>\n",
+                      host_address_to_string (gdbarch->register_reggroup_p));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: pointer_to_address = <%s>\n",
-                      host_address_to_string (gdbarch->pointer_to_address));
+                      "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
+                      gdbarch_fetch_pointer_argument_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: print_auxv_entry = <%s>\n",
-                      host_address_to_string (gdbarch->print_auxv_entry));
+                      "gdbarch_dump: fetch_pointer_argument = <%s>\n",
+                      host_address_to_string (gdbarch->fetch_pointer_argument));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: print_float_info = <%s>\n",
-                      host_address_to_string (gdbarch->print_float_info));
+                      "gdbarch_dump: gdbarch_iterate_over_regset_sections_p() = %d\n",
+                      gdbarch_iterate_over_regset_sections_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: print_insn = <%s>\n",
-                      host_address_to_string (gdbarch->print_insn));
+                      "gdbarch_dump: iterate_over_regset_sections = <%s>\n",
+                      host_address_to_string (gdbarch->iterate_over_regset_sections));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: print_registers_info = <%s>\n",
-                      host_address_to_string (gdbarch->print_registers_info));
+                      "gdbarch_dump: gdbarch_make_corefile_notes_p() = %d\n",
+                      gdbarch_make_corefile_notes_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
-                      gdbarch_print_vector_info_p (gdbarch));
+                      "gdbarch_dump: make_corefile_notes = <%s>\n",
+                      host_address_to_string (gdbarch->make_corefile_notes));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: print_vector_info = <%s>\n",
-                      host_address_to_string (gdbarch->print_vector_info));
+                      "gdbarch_dump: gdbarch_find_memory_regions_p() = %d\n",
+                      gdbarch_find_memory_regions_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_process_record_p() = %d\n",
-                      gdbarch_process_record_p (gdbarch));
+                      "gdbarch_dump: find_memory_regions = <%s>\n",
+                      host_address_to_string (gdbarch->find_memory_regions));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: process_record = <%s>\n",
-                      host_address_to_string (gdbarch->process_record));
+                      "gdbarch_dump: gdbarch_core_xfer_shared_libraries_p() = %d\n",
+                      gdbarch_core_xfer_shared_libraries_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_process_record_signal_p() = %d\n",
-                      gdbarch_process_record_signal_p (gdbarch));
+                      "gdbarch_dump: core_xfer_shared_libraries = <%s>\n",
+                      host_address_to_string (gdbarch->core_xfer_shared_libraries));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: process_record_signal = <%s>\n",
-                      host_address_to_string (gdbarch->process_record_signal));
+                      "gdbarch_dump: gdbarch_core_xfer_shared_libraries_aix_p() = %d\n",
+                      gdbarch_core_xfer_shared_libraries_aix_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: program_breakpoint_here_p = <%s>\n",
-                      host_address_to_string (gdbarch->program_breakpoint_here_p));
+                      "gdbarch_dump: core_xfer_shared_libraries_aix = <%s>\n",
+                      host_address_to_string (gdbarch->core_xfer_shared_libraries_aix));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: ps_regnum = %s\n",
-                      plongest (gdbarch->ps_regnum));
+                      "gdbarch_dump: gdbarch_core_pid_to_str_p() = %d\n",
+                      gdbarch_core_pid_to_str_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
-                      gdbarch_pseudo_register_read_p (gdbarch));
+                      "gdbarch_dump: core_pid_to_str = <%s>\n",
+                      host_address_to_string (gdbarch->core_pid_to_str));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: pseudo_register_read = <%s>\n",
-                      host_address_to_string (gdbarch->pseudo_register_read));
+                      "gdbarch_dump: gdbarch_core_thread_name_p() = %d\n",
+                      gdbarch_core_thread_name_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_pseudo_register_read_value_p() = %d\n",
-                      gdbarch_pseudo_register_read_value_p (gdbarch));
+                      "gdbarch_dump: core_thread_name = <%s>\n",
+                      host_address_to_string (gdbarch->core_thread_name));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: pseudo_register_read_value = <%s>\n",
-                      host_address_to_string (gdbarch->pseudo_register_read_value));
+                      "gdbarch_dump: gdbarch_core_xfer_siginfo_p() = %d\n",
+                      gdbarch_core_xfer_siginfo_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
-                      gdbarch_pseudo_register_write_p (gdbarch));
+                      "gdbarch_dump: core_xfer_siginfo = <%s>\n",
+                      host_address_to_string (gdbarch->core_xfer_siginfo));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: pseudo_register_write = <%s>\n",
-                      host_address_to_string (gdbarch->pseudo_register_write));
+                      "gdbarch_dump: gdbarch_gcore_bfd_target_p() = %d\n",
+                      gdbarch_gcore_bfd_target_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: ptr_bit = %s\n",
-                      plongest (gdbarch->ptr_bit));
+                      "gdbarch_dump: gcore_bfd_target = %s\n",
+                      pstring (gdbarch->gcore_bfd_target));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
-                      gdbarch_push_dummy_call_p (gdbarch));
+                      "gdbarch_dump: vtable_function_descriptors = %s\n",
+                      plongest (gdbarch->vtable_function_descriptors));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: push_dummy_call = <%s>\n",
-                      host_address_to_string (gdbarch->push_dummy_call));
+                      "gdbarch_dump: vbit_in_delta = %s\n",
+                      plongest (gdbarch->vbit_in_delta));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
-                      gdbarch_push_dummy_code_p (gdbarch));
+                      "gdbarch_dump: skip_permanent_breakpoint = <%s>\n",
+                      host_address_to_string (gdbarch->skip_permanent_breakpoint));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: push_dummy_code = <%s>\n",
-                      host_address_to_string (gdbarch->push_dummy_code));
+                      "gdbarch_dump: gdbarch_max_insn_length_p() = %d\n",
+                      gdbarch_max_insn_length_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: ravenscar_ops = %s\n",
-                      host_address_to_string (gdbarch->ravenscar_ops));
+                      "gdbarch_dump: max_insn_length = %s\n",
+                      plongest (gdbarch->max_insn_length));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: read_core_file_mappings = <%s>\n",
-                      host_address_to_string (gdbarch->read_core_file_mappings));
+                      "gdbarch_dump: gdbarch_displaced_step_copy_insn_p() = %d\n",
+                      gdbarch_displaced_step_copy_insn_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
-                      gdbarch_read_pc_p (gdbarch));
+                      "gdbarch_dump: displaced_step_copy_insn = <%s>\n",
+                      host_address_to_string (gdbarch->displaced_step_copy_insn));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: read_pc = <%s>\n",
-                      host_address_to_string (gdbarch->read_pc));
+                      "gdbarch_dump: displaced_step_hw_singlestep = <%s>\n",
+                      host_address_to_string (gdbarch->displaced_step_hw_singlestep));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_record_special_symbol_p() = %d\n",
-                      gdbarch_record_special_symbol_p (gdbarch));
+                      "gdbarch_dump: gdbarch_displaced_step_fixup_p() = %d\n",
+                      gdbarch_displaced_step_fixup_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: record_special_symbol = <%s>\n",
-                      host_address_to_string (gdbarch->record_special_symbol));
+                      "gdbarch_dump: displaced_step_fixup = <%s>\n",
+                      host_address_to_string (gdbarch->displaced_step_fixup));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: register_name = <%s>\n",
-                      host_address_to_string (gdbarch->register_name));
+                      "gdbarch_dump: gdbarch_displaced_step_prepare_p() = %d\n",
+                      gdbarch_displaced_step_prepare_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: register_reggroup_p = <%s>\n",
-                      host_address_to_string (gdbarch->register_reggroup_p));
+                      "gdbarch_dump: displaced_step_prepare = <%s>\n",
+                      host_address_to_string (gdbarch->displaced_step_prepare));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: register_sim_regno = <%s>\n",
-                      host_address_to_string (gdbarch->register_sim_regno));
+                      "gdbarch_dump: displaced_step_finish = <%s>\n",
+                      host_address_to_string (gdbarch->displaced_step_finish));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: register_to_value = <%s>\n",
-                      host_address_to_string (gdbarch->register_to_value));
+                      "gdbarch_dump: gdbarch_displaced_step_copy_insn_closure_by_addr_p() = %d\n",
+                      gdbarch_displaced_step_copy_insn_closure_by_addr_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_register_type_p() = %d\n",
-                      gdbarch_register_type_p (gdbarch));
+                      "gdbarch_dump: displaced_step_copy_insn_closure_by_addr = <%s>\n",
+                      host_address_to_string (gdbarch->displaced_step_copy_insn_closure_by_addr));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: register_type = <%s>\n",
-                      host_address_to_string (gdbarch->register_type));
+                      "gdbarch_dump: displaced_step_restore_all_in_ptid = <%s>\n",
+                      host_address_to_string (gdbarch->displaced_step_restore_all_in_ptid));
   fprintf_unfiltered (file,
                       "gdbarch_dump: gdbarch_relocate_instruction_p() = %d\n",
                       gdbarch_relocate_instruction_p (gdbarch));
@@ -1255,107 +1204,92 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "gdbarch_dump: relocate_instruction = <%s>\n",
                       host_address_to_string (gdbarch->relocate_instruction));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: remote_register_number = <%s>\n",
-                      host_address_to_string (gdbarch->remote_register_number));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_report_signal_info_p() = %d\n",
-                      gdbarch_report_signal_info_p (gdbarch));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: report_signal_info = <%s>\n",
-                      host_address_to_string (gdbarch->report_signal_info));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: return_in_first_hidden_param_p = <%s>\n",
-                      host_address_to_string (gdbarch->return_in_first_hidden_param_p));
+                      "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
+                      gdbarch_overlay_update_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_return_value_p() = %d\n",
-                      gdbarch_return_value_p (gdbarch));
+                      "gdbarch_dump: overlay_update = <%s>\n",
+                      host_address_to_string (gdbarch->overlay_update));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: return_value = <%s>\n",
-                      host_address_to_string (gdbarch->return_value));
+                      "gdbarch_dump: gdbarch_core_read_description_p() = %d\n",
+                      gdbarch_core_read_description_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: sdb_reg_to_regnum = <%s>\n",
-                      host_address_to_string (gdbarch->sdb_reg_to_regnum));
+                      "gdbarch_dump: core_read_description = <%s>\n",
+                      host_address_to_string (gdbarch->core_read_description));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: set_memtags = <%s>\n",
-                      host_address_to_string (gdbarch->set_memtags));
+                      "gdbarch_dump: sofun_address_maybe_missing = %s\n",
+                      plongest (gdbarch->sofun_address_maybe_missing));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: short_bit = %s\n",
-                      plongest (gdbarch->short_bit));
+                      "gdbarch_dump: gdbarch_process_record_p() = %d\n",
+                      gdbarch_process_record_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: significant_addr_bit = %s\n",
-                      plongest (gdbarch->significant_addr_bit));
+                      "gdbarch_dump: process_record = <%s>\n",
+                      host_address_to_string (gdbarch->process_record));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
-                      gdbarch_single_step_through_delay_p (gdbarch));
+                      "gdbarch_dump: gdbarch_process_record_signal_p() = %d\n",
+                      gdbarch_process_record_signal_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: single_step_through_delay = <%s>\n",
-                      host_address_to_string (gdbarch->single_step_through_delay));
+                      "gdbarch_dump: process_record_signal = <%s>\n",
+                      host_address_to_string (gdbarch->process_record_signal));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_skip_entrypoint_p() = %d\n",
-                      gdbarch_skip_entrypoint_p (gdbarch));
+                      "gdbarch_dump: gdbarch_gdb_signal_from_target_p() = %d\n",
+                      gdbarch_gdb_signal_from_target_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: skip_entrypoint = <%s>\n",
-                      host_address_to_string (gdbarch->skip_entrypoint));
+                      "gdbarch_dump: gdb_signal_from_target = <%s>\n",
+                      host_address_to_string (gdbarch->gdb_signal_from_target));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_skip_main_prologue_p() = %d\n",
-                      gdbarch_skip_main_prologue_p (gdbarch));
+                      "gdbarch_dump: gdbarch_gdb_signal_to_target_p() = %d\n",
+                      gdbarch_gdb_signal_to_target_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: skip_main_prologue = <%s>\n",
-                      host_address_to_string (gdbarch->skip_main_prologue));
+                      "gdbarch_dump: gdb_signal_to_target = <%s>\n",
+                      host_address_to_string (gdbarch->gdb_signal_to_target));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: skip_permanent_breakpoint = <%s>\n",
-                      host_address_to_string (gdbarch->skip_permanent_breakpoint));
+                      "gdbarch_dump: gdbarch_get_siginfo_type_p() = %d\n",
+                      gdbarch_get_siginfo_type_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: skip_prologue = <%s>\n",
-                      host_address_to_string (gdbarch->skip_prologue));
+                      "gdbarch_dump: get_siginfo_type = <%s>\n",
+                      host_address_to_string (gdbarch->get_siginfo_type));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: skip_solib_resolver = <%s>\n",
-                      host_address_to_string (gdbarch->skip_solib_resolver));
+                      "gdbarch_dump: gdbarch_record_special_symbol_p() = %d\n",
+                      gdbarch_record_special_symbol_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: skip_trampoline_code = <%s>\n",
-                      host_address_to_string (gdbarch->skip_trampoline_code));
+                      "gdbarch_dump: record_special_symbol = <%s>\n",
+                      host_address_to_string (gdbarch->record_special_symbol));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
-                      gdbarch_software_single_step_p (gdbarch));
+                      "gdbarch_dump: gdbarch_get_syscall_number_p() = %d\n",
+                      gdbarch_get_syscall_number_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: software_single_step = <%s>\n",
-                      host_address_to_string (gdbarch->software_single_step));
+                      "gdbarch_dump: get_syscall_number = <%s>\n",
+                      host_address_to_string (gdbarch->get_syscall_number));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: sofun_address_maybe_missing = %s\n",
-                      plongest (gdbarch->sofun_address_maybe_missing));
+                      "gdbarch_dump: xml_syscall_file = %s\n",
+                      pstring (gdbarch->xml_syscall_file));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: solib_symbols_extension = %s\n",
-                      pstring (gdbarch->solib_symbols_extension));
+                      "gdbarch_dump: syscalls_info = %s\n",
+                      host_address_to_string (gdbarch->syscalls_info));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: sp_regnum = %s\n",
-                      plongest (gdbarch->sp_regnum));
+                      "gdbarch_dump: stap_integer_prefixes = %s\n",
+                      pstring_list (gdbarch->stap_integer_prefixes));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: stab_reg_to_regnum = <%s>\n",
-                      host_address_to_string (gdbarch->stab_reg_to_regnum));
+                      "gdbarch_dump: stap_integer_suffixes = %s\n",
+                      pstring_list (gdbarch->stap_integer_suffixes));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: stabs_argument_has_addr = <%s>\n",
-                      host_address_to_string (gdbarch->stabs_argument_has_addr));
+                      "gdbarch_dump: stap_register_prefixes = %s\n",
+                      pstring_list (gdbarch->stap_register_prefixes));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: stack_frame_destroyed_p = <%s>\n",
-                      host_address_to_string (gdbarch->stack_frame_destroyed_p));
+                      "gdbarch_dump: stap_register_suffixes = %s\n",
+                      pstring_list (gdbarch->stap_register_suffixes));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_stap_adjust_register_p() = %d\n",
-                      gdbarch_stap_adjust_register_p (gdbarch));
+                      "gdbarch_dump: stap_register_indirection_prefixes = %s\n",
+                      pstring_list (gdbarch->stap_register_indirection_prefixes));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: stap_adjust_register = <%s>\n",
-                      host_address_to_string (gdbarch->stap_adjust_register));
+                      "gdbarch_dump: stap_register_indirection_suffixes = %s\n",
+                      pstring_list (gdbarch->stap_register_indirection_suffixes));
   fprintf_unfiltered (file,
                       "gdbarch_dump: stap_gdb_register_prefix = %s\n",
                       pstring (gdbarch->stap_gdb_register_prefix));
   fprintf_unfiltered (file,
                       "gdbarch_dump: stap_gdb_register_suffix = %s\n",
                       pstring (gdbarch->stap_gdb_register_suffix));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: stap_integer_prefixes = %s\n",
-                      pstring_list (gdbarch->stap_integer_prefixes));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: stap_integer_suffixes = %s\n",
-                      pstring_list (gdbarch->stap_integer_suffixes));
   fprintf_unfiltered (file,
                       "gdbarch_dump: gdbarch_stap_is_single_operand_p() = %d\n",
                       gdbarch_stap_is_single_operand_p (gdbarch));
@@ -1369,74 +1303,140 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "gdbarch_dump: stap_parse_special_token = <%s>\n",
                       host_address_to_string (gdbarch->stap_parse_special_token));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: stap_register_indirection_prefixes = %s\n",
-                      pstring_list (gdbarch->stap_register_indirection_prefixes));
+                      "gdbarch_dump: gdbarch_stap_adjust_register_p() = %d\n",
+                      gdbarch_stap_adjust_register_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: stap_register_indirection_suffixes = %s\n",
-                      pstring_list (gdbarch->stap_register_indirection_suffixes));
+                      "gdbarch_dump: stap_adjust_register = <%s>\n",
+                      host_address_to_string (gdbarch->stap_adjust_register));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: stap_register_prefixes = %s\n",
-                      pstring_list (gdbarch->stap_register_prefixes));
+                      "gdbarch_dump: gdbarch_dtrace_parse_probe_argument_p() = %d\n",
+                      gdbarch_dtrace_parse_probe_argument_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: stap_register_suffixes = %s\n",
-                      pstring_list (gdbarch->stap_register_suffixes));
+                      "gdbarch_dump: dtrace_parse_probe_argument = <%s>\n",
+                      host_address_to_string (gdbarch->dtrace_parse_probe_argument));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: sw_breakpoint_from_kind = <%s>\n",
-                      host_address_to_string (gdbarch->sw_breakpoint_from_kind));
+                      "gdbarch_dump: gdbarch_dtrace_probe_is_enabled_p() = %d\n",
+                      gdbarch_dtrace_probe_is_enabled_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: syscalls_info = %s\n",
-                      host_address_to_string (gdbarch->syscalls_info));
+                      "gdbarch_dump: dtrace_probe_is_enabled = <%s>\n",
+                      host_address_to_string (gdbarch->dtrace_probe_is_enabled));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: tagged_address_p = <%s>\n",
-                      host_address_to_string (gdbarch->tagged_address_p));
+                      "gdbarch_dump: gdbarch_dtrace_enable_probe_p() = %d\n",
+                      gdbarch_dtrace_enable_probe_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: target_desc = %s\n",
-                      host_address_to_string (gdbarch->target_desc));
+                      "gdbarch_dump: dtrace_enable_probe = <%s>\n",
+                      host_address_to_string (gdbarch->dtrace_enable_probe));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: type_align = <%s>\n",
-                      host_address_to_string (gdbarch->type_align));
+                      "gdbarch_dump: gdbarch_dtrace_disable_probe_p() = %d\n",
+                      gdbarch_dtrace_disable_probe_p (gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: unwind_pc = <%s>\n",
-                      host_address_to_string (gdbarch->unwind_pc));
+                      "gdbarch_dump: dtrace_disable_probe = <%s>\n",
+                      host_address_to_string (gdbarch->dtrace_disable_probe));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: unwind_sp = <%s>\n",
-                      host_address_to_string (gdbarch->unwind_sp));
+                      "gdbarch_dump: has_global_solist = %s\n",
+                      plongest (gdbarch->has_global_solist));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: valid_disassembler_options = %s\n",
-                      host_address_to_string (gdbarch->valid_disassembler_options));
+                      "gdbarch_dump: has_global_breakpoints = %s\n",
+                      plongest (gdbarch->has_global_breakpoints));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: value_from_register = <%s>\n",
-                      host_address_to_string (gdbarch->value_from_register));
+                      "gdbarch_dump: has_shared_address_space = <%s>\n",
+                      host_address_to_string (gdbarch->has_shared_address_space));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: value_to_register = <%s>\n",
-                      host_address_to_string (gdbarch->value_to_register));
+                      "gdbarch_dump: fast_tracepoint_valid_at = <%s>\n",
+                      host_address_to_string (gdbarch->fast_tracepoint_valid_at));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: vbit_in_delta = %s\n",
-                      plongest (gdbarch->vbit_in_delta));
+                      "gdbarch_dump: guess_tracepoint_registers = <%s>\n",
+                      host_address_to_string (gdbarch->guess_tracepoint_registers));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: virtual_frame_pointer = <%s>\n",
-                      host_address_to_string (gdbarch->virtual_frame_pointer));
+                      "gdbarch_dump: auto_charset = <%s>\n",
+                      host_address_to_string (gdbarch->auto_charset));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: auto_wide_charset = <%s>\n",
+                      host_address_to_string (gdbarch->auto_wide_charset));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: solib_symbols_extension = %s\n",
+                      pstring (gdbarch->solib_symbols_extension));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: has_dos_based_file_system = %s\n",
+                      plongest (gdbarch->has_dos_based_file_system));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gen_return_address = <%s>\n",
+                      host_address_to_string (gdbarch->gen_return_address));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_info_proc_p() = %d\n",
+                      gdbarch_info_proc_p (gdbarch));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: info_proc = <%s>\n",
+                      host_address_to_string (gdbarch->info_proc));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_core_info_proc_p() = %d\n",
+                      gdbarch_core_info_proc_p (gdbarch));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: core_info_proc = <%s>\n",
+                      host_address_to_string (gdbarch->core_info_proc));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: iterate_over_objfiles_in_search_order = <%s>\n",
+                      host_address_to_string (gdbarch->iterate_over_objfiles_in_search_order));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: ravenscar_ops = %s\n",
+                      host_address_to_string (gdbarch->ravenscar_ops));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: insn_is_call = <%s>\n",
+                      host_address_to_string (gdbarch->insn_is_call));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: insn_is_ret = <%s>\n",
+                      host_address_to_string (gdbarch->insn_is_ret));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: insn_is_jump = <%s>\n",
+                      host_address_to_string (gdbarch->insn_is_jump));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: program_breakpoint_here_p = <%s>\n",
+                      host_address_to_string (gdbarch->program_breakpoint_here_p));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_auxv_parse_p() = %d\n",
+                      gdbarch_auxv_parse_p (gdbarch));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: auxv_parse = <%s>\n",
+                      host_address_to_string (gdbarch->auxv_parse));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: print_auxv_entry = <%s>\n",
+                      host_address_to_string (gdbarch->print_auxv_entry));
   fprintf_unfiltered (file,
                       "gdbarch_dump: vsyscall_range = <%s>\n",
                       host_address_to_string (gdbarch->vsyscall_range));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: vtable_function_descriptors = %s\n",
-                      plongest (gdbarch->vtable_function_descriptors));
+                      "gdbarch_dump: infcall_mmap = <%s>\n",
+                      host_address_to_string (gdbarch->infcall_mmap));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: wchar_bit = %s\n",
-                      plongest (gdbarch->wchar_bit));
+                      "gdbarch_dump: infcall_munmap = <%s>\n",
+                      host_address_to_string (gdbarch->infcall_munmap));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: wchar_signed = %s\n",
-                      plongest (gdbarch->wchar_signed));
+                      "gdbarch_dump: gcc_target_options = <%s>\n",
+                      host_address_to_string (gdbarch->gcc_target_options));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_write_pc_p() = %d\n",
-                      gdbarch_write_pc_p (gdbarch));
+                      "gdbarch_dump: gnu_triplet_regexp = <%s>\n",
+                      host_address_to_string (gdbarch->gnu_triplet_regexp));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: write_pc = <%s>\n",
-                      host_address_to_string (gdbarch->write_pc));
+                      "gdbarch_dump: addressable_memory_unit_size = <%s>\n",
+                      host_address_to_string (gdbarch->addressable_memory_unit_size));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: xml_syscall_file = %s\n",
-                      pstring (gdbarch->xml_syscall_file));
+                      "gdbarch_dump: disassembler_options_implicit = %s\n",
+                      pstring (gdbarch->disassembler_options_implicit));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: disassembler_options = %s\n",
+                      pstring_ptr (gdbarch->disassembler_options));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: valid_disassembler_options = %s\n",
+                      host_address_to_string (gdbarch->valid_disassembler_options));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: type_align = <%s>\n",
+                      host_address_to_string (gdbarch->type_align));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: get_pc_address_flags = <%s>\n",
+                      host_address_to_string (gdbarch->get_pc_address_flags));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: read_core_file_mappings = <%s>\n",
+                      host_address_to_string (gdbarch->read_core_file_mappings));
   if (gdbarch->dump_tdep != NULL)
     gdbarch->dump_tdep (gdbarch, file);
 }
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 1acfda4be38..a8bd6d5cfc0 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -1562,7 +1562,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
 		      "gdbarch_dump: GDB_NM_FILE = %s\\n",
 		      gdb_nm_file);
 EOF
-function_list | sort '-t;' -k 3 | while do_read
+function_list | while do_read
 do
     # First the predicate
     if class_is_predicate_p
-- 
2.31.1


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v2 5/8] Generate new gdbarch-components.py from gdbarch.sh
  2021-12-16 20:38 [PATCH v2 0/8] Rewrite gdbarch.sh in Python Tom Tromey
                   ` (3 preceding siblings ...)
  2021-12-16 20:38 ` [PATCH v2 4/8] Do not sort the fields in gdbarch_dump Tom Tromey
@ 2021-12-16 20:38 ` Tom Tromey
  2021-12-17 18:32   ` Pedro Alves
  2021-12-16 20:38 ` [PATCH v2 6/8] Add new gdbarch generator Tom Tromey
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Tom Tromey @ 2021-12-16 20:38 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

The new gdbarch.sh approach will be to edit a Python file, rather than
adding a line to a certain part of gdbarch.sh.  We use the existing sh
code, though, to generate the first draft of this .py file.

Documentation on the format will come in a subsequent patch.

Note that some info (like "staticdefault") in the current code is
actually unused, and so is ignored by this new generator.
---
 gdb/gdbarch-components.py | 2702 +++++++++++++++++++++++++++++++++++++
 gdb/gdbarch.sh            |   71 +
 2 files changed, 2773 insertions(+)
 create mode 100644 gdb/gdbarch-components.py

diff --git a/gdb/gdbarch-components.py b/gdb/gdbarch-components.py
new file mode 100644
index 00000000000..2a85655b0f6
--- /dev/null
+++ b/gdb/gdbarch-components.py
@@ -0,0 +1,2702 @@
+# Dynamic architecture support for GDB, the GNU debugger.
+
+# Copyright (C) 1998-2021 Free Software Foundation, Inc.
+
+# This file is part of GDB.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+Info(
+    name="bfd_arch_info",
+    type="const struct bfd_arch_info *",
+    printer="gdbarch_bfd_arch_info (gdbarch)->printable_name",
+)
+
+Info(
+    name="byte_order",
+    type="enum bfd_endian",
+)
+
+Info(
+    name="byte_order_for_code",
+    type="enum bfd_endian",
+)
+
+Info(
+    name="osabi",
+    type="enum gdb_osabi",
+)
+
+Info(
+    name="target_desc",
+    type="const struct target_desc *",
+    printer="host_address_to_string (gdbarch->target_desc)",
+)
+
+Value(
+    comment="""
+Number of bits in a short or unsigned short for the target machine.
+""",
+    name="short_bit",
+    type="int",
+    predefault="2*TARGET_CHAR_BIT",
+    invalid=False,
+)
+
+Value(
+    comment="""
+Number of bits in an int or unsigned int for the target machine.
+""",
+    name="int_bit",
+    type="int",
+    predefault="4*TARGET_CHAR_BIT",
+    invalid=False,
+)
+
+Value(
+    comment="""
+Number of bits in a long or unsigned long for the target machine.
+""",
+    name="long_bit",
+    type="int",
+    predefault="4*TARGET_CHAR_BIT",
+    invalid=False,
+)
+
+Value(
+    comment="""
+Number of bits in a long long or unsigned long long for the target
+machine.
+""",
+    name="long_long_bit",
+    type="int",
+    predefault="2*gdbarch->long_bit",
+    invalid=False,
+)
+
+Value(
+    comment="""
+The ABI default bit-size and format for "bfloat16", "half", "float", "double", and
+"long double".  These bit/format pairs should eventually be combined
+into a single object.  For the moment, just initialize them as a pair.
+Each format describes both the big and little endian layouts (if
+useful).
+""",
+    name="bfloat16_bit",
+    type="int",
+    predefault="2*TARGET_CHAR_BIT",
+    invalid=False,
+)
+
+Value(
+    name="bfloat16_format",
+    type="const struct floatformat **",
+    postdefault="floatformats_bfloat16",
+    invalid=True,
+    printer="pformat (gdbarch->bfloat16_format)",
+)
+
+Value(
+    name="half_bit",
+    type="int",
+    predefault="2*TARGET_CHAR_BIT",
+    invalid=False,
+)
+
+Value(
+    name="half_format",
+    type="const struct floatformat **",
+    postdefault="floatformats_ieee_half",
+    invalid=True,
+    printer="pformat (gdbarch->half_format)",
+)
+
+Value(
+    name="float_bit",
+    type="int",
+    predefault="4*TARGET_CHAR_BIT",
+    invalid=False,
+)
+
+Value(
+    name="float_format",
+    type="const struct floatformat **",
+    postdefault="floatformats_ieee_single",
+    invalid=True,
+    printer="pformat (gdbarch->float_format)",
+)
+
+Value(
+    name="double_bit",
+    type="int",
+    predefault="8*TARGET_CHAR_BIT",
+    invalid=False,
+)
+
+Value(
+    name="double_format",
+    type="const struct floatformat **",
+    postdefault="floatformats_ieee_double",
+    invalid=True,
+    printer="pformat (gdbarch->double_format)",
+)
+
+Value(
+    name="long_double_bit",
+    type="int",
+    predefault="8*TARGET_CHAR_BIT",
+    invalid=False,
+)
+
+Value(
+    name="long_double_format",
+    type="const struct floatformat **",
+    postdefault="floatformats_ieee_double",
+    invalid=True,
+    printer="pformat (gdbarch->long_double_format)",
+)
+
+Value(
+    comment="""
+The ABI default bit-size for "wchar_t".  wchar_t is a built-in type
+starting with C++11.
+""",
+    name="wchar_bit",
+    type="int",
+    predefault="4*TARGET_CHAR_BIT",
+    invalid=False,
+)
+
+Value(
+    comment="""
+One if `wchar_t' is signed, zero if unsigned.
+""",
+    name="wchar_signed",
+    type="int",
+    predefault="-1",
+    postdefault="1",
+    invalid=True,
+)
+
+Method(
+    comment="""
+Returns the floating-point format to be used for values of length LENGTH.
+NAME, if non-NULL, is the type name, which may be used to distinguish
+different target formats of the same length.
+""",
+    name="floatformat_for_type",
+    type="const struct floatformat **",
+    predefault="default_floatformat_for_type",
+    invalid=False,
+    params=(
+        ("const char *", "name"),
+        ("int", "length"),
+    ),
+)
+
+Value(
+    comment="""
+For most targets, a pointer on the target and its representation as an
+address in GDB have the same size and "look the same".  For such a
+target, you need only set gdbarch_ptr_bit and gdbarch_addr_bit
+/ addr_bit will be set from it.
+
+If gdbarch_ptr_bit and gdbarch_addr_bit are different, you'll probably
+also need to set gdbarch_dwarf2_addr_size, gdbarch_pointer_to_address and
+gdbarch_address_to_pointer as well.
+
+ptr_bit is the size of a pointer on the target
+""",
+    name="ptr_bit",
+    type="int",
+    predefault="gdbarch->int_bit",
+    invalid=False,
+)
+
+Value(
+    comment="""
+addr_bit is the size of a target address as represented in gdb
+""",
+    name="addr_bit",
+    type="int",
+    predefault="0",
+    postdefault="gdbarch_ptr_bit (gdbarch)",
+    invalid=True,
+)
+
+Value(
+    comment="""
+dwarf2_addr_size is the target address size as used in the Dwarf debug
+info.  For .debug_frame FDEs, this is supposed to be the target address
+size from the associated CU header, and which is equivalent to the
+DWARF2_ADDR_SIZE as defined by the target specific GCC back-end.
+Unfortunately there is no good way to determine this value.  Therefore
+dwarf2_addr_size simply defaults to the target pointer size.
+
+dwarf2_addr_size is not used for .eh_frame FDEs, which are generally
+defined using the target's pointer size so far.
+
+Note that dwarf2_addr_size only needs to be redefined by a target if the
+GCC back-end defines a DWARF2_ADDR_SIZE other than the target pointer size,
+and if Dwarf versions < 4 need to be supported.
+""",
+    name="dwarf2_addr_size",
+    type="int",
+    predefault="0",
+    postdefault="gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT",
+    invalid=True,
+)
+
+Value(
+    comment="""
+One if `char' acts like `signed char', zero if `unsigned char'.
+""",
+    name="char_signed",
+    type="int",
+    predefault="-1",
+    postdefault="1",
+    invalid=True,
+)
+
+Function(
+    name="read_pc",
+    type="CORE_ADDR",
+    predicate=True,
+    invalid=True,
+    params=(("readable_regcache *", "regcache"),),
+)
+
+Function(
+    name="write_pc",
+    type="void",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("struct regcache *", "regcache"),
+        ("CORE_ADDR", "val"),
+    ),
+)
+
+Method(
+    comment="""
+Function for getting target's idea of a frame pointer.  FIXME: GDB's
+whole scheme for dealing with "frames" and "frame pointers" needs a
+serious shakedown.
+""",
+    name="virtual_frame_pointer",
+    type="void",
+    predefault="legacy_virtual_frame_pointer",
+    invalid=False,
+    params=(
+        ("CORE_ADDR", "pc"),
+        ("int *", "frame_regnum"),
+        ("LONGEST *", "frame_offset"),
+    ),
+)
+
+Method(
+    name="pseudo_register_read",
+    type="enum register_status",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("readable_regcache *", "regcache"),
+        ("int", "cookednum"),
+        ("gdb_byte *", "buf"),
+    ),
+)
+
+Method(
+    comment="""
+Read a register into a new struct value.  If the register is wholly
+or partly unavailable, this should call mark_value_bytes_unavailable
+as appropriate.  If this is defined, then pseudo_register_read will
+never be called.
+""",
+    name="pseudo_register_read_value",
+    type="struct value *",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("readable_regcache *", "regcache"),
+        ("int", "cookednum"),
+    ),
+)
+
+Method(
+    name="pseudo_register_write",
+    type="void",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("struct regcache *", "regcache"),
+        ("int", "cookednum"),
+        ("const gdb_byte *", "buf"),
+    ),
+)
+
+Value(
+    name="num_regs",
+    type="int",
+    predefault="-1",
+    invalid=True,
+)
+
+Value(
+    comment="""
+This macro gives the number of pseudo-registers that live in the
+register namespace but do not get fetched or stored on the target.
+These pseudo-registers may be aliases for other registers,
+combinations of other registers, or they may be computed by GDB.
+""",
+    name="num_pseudo_regs",
+    type="int",
+    predefault="0",
+    invalid=False,
+)
+
+Method(
+    comment="""
+Assemble agent expression bytecode to collect pseudo-register REG.
+Return -1 if something goes wrong, 0 otherwise.
+""",
+    name="ax_pseudo_register_collect",
+    type="int",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("struct agent_expr *", "ax"),
+        ("int", "reg"),
+    ),
+)
+
+Method(
+    comment="""
+Assemble agent expression bytecode to push the value of pseudo-register
+REG on the interpreter stack.
+Return -1 if something goes wrong, 0 otherwise.
+""",
+    name="ax_pseudo_register_push_stack",
+    type="int",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("struct agent_expr *", "ax"),
+        ("int", "reg"),
+    ),
+)
+
+Method(
+    comment="""
+Some architectures can display additional information for specific
+signals.
+UIOUT is the output stream where the handler will place information.
+""",
+    name="report_signal_info",
+    type="void",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("struct ui_out *", "uiout"),
+        ("enum gdb_signal", "siggnal"),
+    ),
+)
+
+Value(
+    comment="""
+GDB's standard (or well known) register numbers.  These can map onto
+a real register or a pseudo (computed) register or not be defined at
+all (-1).
+gdbarch_sp_regnum will hopefully be replaced by UNWIND_SP.
+""",
+    name="sp_regnum",
+    type="int",
+    predefault="-1",
+    invalid=False,
+)
+
+Value(
+    name="pc_regnum",
+    type="int",
+    predefault="-1",
+    invalid=False,
+)
+
+Value(
+    name="ps_regnum",
+    type="int",
+    predefault="-1",
+    invalid=False,
+)
+
+Value(
+    name="fp0_regnum",
+    type="int",
+    predefault="-1",
+    invalid=False,
+)
+
+Method(
+    comment="""
+Convert stab register number (from `r' declaration) to a gdb REGNUM.
+""",
+    name="stab_reg_to_regnum",
+    type="int",
+    predefault="no_op_reg_to_regnum",
+    invalid=False,
+    params=(("int", "stab_regnr"),),
+)
+
+Method(
+    comment="""
+Provide a default mapping from a ecoff register number to a gdb REGNUM.
+""",
+    name="ecoff_reg_to_regnum",
+    type="int",
+    predefault="no_op_reg_to_regnum",
+    invalid=False,
+    params=(("int", "ecoff_regnr"),),
+)
+
+Method(
+    comment="""
+Convert from an sdb register number to an internal gdb register number.
+""",
+    name="sdb_reg_to_regnum",
+    type="int",
+    predefault="no_op_reg_to_regnum",
+    invalid=False,
+    params=(("int", "sdb_regnr"),),
+)
+
+Method(
+    comment="""
+Provide a default mapping from a DWARF2 register number to a gdb REGNUM.
+Return -1 for bad REGNUM.  Note: Several targets get this wrong.
+""",
+    name="dwarf2_reg_to_regnum",
+    type="int",
+    predefault="no_op_reg_to_regnum",
+    invalid=False,
+    params=(("int", "dwarf2_regnr"),),
+)
+
+Method(
+    name="register_name",
+    type="const char *",
+    predefault="0",
+    invalid=True,
+    params=(("int", "regnr"),),
+)
+
+Method(
+    comment="""
+Return the type of a register specified by the architecture.  Only
+the register cache should call this function directly; others should
+use "register_type".
+""",
+    name="register_type",
+    type="struct type *",
+    predicate=True,
+    invalid=True,
+    params=(("int", "reg_nr"),),
+)
+
+Method(
+    comment="""
+Generate a dummy frame_id for THIS_FRAME assuming that the frame is
+a dummy frame.  A dummy frame is created before an inferior call,
+the frame_id returned here must match the frame_id that was built
+for the inferior call.  Usually this means the returned frame_id's
+stack address should match the address returned by
+gdbarch_push_dummy_call, and the returned frame_id's code address
+should match the address at which the breakpoint was set in the dummy
+frame.
+""",
+    name="dummy_id",
+    type="struct frame_id",
+    predefault="default_dummy_id",
+    invalid=False,
+    params=(("struct frame_info *", "this_frame"),),
+)
+
+Value(
+    comment="""
+Implement DUMMY_ID and PUSH_DUMMY_CALL, then delete
+deprecated_fp_regnum.
+""",
+    name="deprecated_fp_regnum",
+    type="int",
+    predefault="-1",
+    invalid=False,
+)
+
+Method(
+    name="push_dummy_call",
+    type="CORE_ADDR",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("struct value *", "function"),
+        ("struct regcache *", "regcache"),
+        ("CORE_ADDR", "bp_addr"),
+        ("int", "nargs"),
+        ("struct value **", "args"),
+        ("CORE_ADDR", "sp"),
+        ("function_call_return_method", "return_method"),
+        ("CORE_ADDR", "struct_addr"),
+    ),
+)
+
+Value(
+    name="call_dummy_location",
+    type="int",
+    predefault="AT_ENTRY_POINT",
+    invalid=False,
+)
+
+Method(
+    name="push_dummy_code",
+    type="CORE_ADDR",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("CORE_ADDR", "sp"),
+        ("CORE_ADDR", "funaddr"),
+        ("struct value **", "args"),
+        ("int", "nargs"),
+        ("struct type *", "value_type"),
+        ("CORE_ADDR *", "real_pc"),
+        ("CORE_ADDR *", "bp_addr"),
+        ("struct regcache *", "regcache"),
+    ),
+)
+
+Method(
+    comment="""
+Return true if the code of FRAME is writable.
+""",
+    name="code_of_frame_writable",
+    type="int",
+    predefault="default_code_of_frame_writable",
+    invalid=False,
+    params=(("struct frame_info *", "frame"),),
+)
+
+Method(
+    name="print_registers_info",
+    type="void",
+    predefault="default_print_registers_info",
+    invalid=False,
+    params=(
+        ("struct ui_file *", "file"),
+        ("struct frame_info *", "frame"),
+        ("int", "regnum"),
+        ("int", "all"),
+    ),
+)
+
+Method(
+    name="print_float_info",
+    type="void",
+    predefault="default_print_float_info",
+    invalid=False,
+    params=(
+        ("struct ui_file *", "file"),
+        ("struct frame_info *", "frame"),
+        ("const char *", "args"),
+    ),
+)
+
+Method(
+    name="print_vector_info",
+    type="void",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("struct ui_file *", "file"),
+        ("struct frame_info *", "frame"),
+        ("const char *", "args"),
+    ),
+)
+
+Method(
+    comment="""
+MAP a GDB RAW register number onto a simulator register number.  See
+also include/...-sim.h.
+""",
+    name="register_sim_regno",
+    type="int",
+    predefault="legacy_register_sim_regno",
+    invalid=False,
+    params=(("int", "reg_nr"),),
+)
+
+Method(
+    name="cannot_fetch_register",
+    type="int",
+    predefault="cannot_register_not",
+    invalid=False,
+    params=(("int", "regnum"),),
+)
+
+Method(
+    name="cannot_store_register",
+    type="int",
+    predefault="cannot_register_not",
+    invalid=False,
+    params=(("int", "regnum"),),
+)
+
+Function(
+    comment="""
+Determine the address where a longjmp will land and save this address
+in PC.  Return nonzero on success.
+
+FRAME corresponds to the longjmp frame.
+""",
+    name="get_longjmp_target",
+    type="int",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("struct frame_info *", "frame"),
+        ("CORE_ADDR *", "pc"),
+    ),
+)
+
+Value(
+    name="believe_pcc_promotion",
+    type="int",
+    invalid=True,
+)
+
+Method(
+    name="convert_register_p",
+    type="int",
+    predefault="generic_convert_register_p",
+    invalid=False,
+    params=(
+        ("int", "regnum"),
+        ("struct type *", "type"),
+    ),
+)
+
+Function(
+    name="register_to_value",
+    type="int",
+    invalid=True,
+    params=(
+        ("struct frame_info *", "frame"),
+        ("int", "regnum"),
+        ("struct type *", "type"),
+        ("gdb_byte *", "buf"),
+        ("int *", "optimizedp"),
+        ("int *", "unavailablep"),
+    ),
+)
+
+Function(
+    name="value_to_register",
+    type="void",
+    invalid=True,
+    params=(
+        ("struct frame_info *", "frame"),
+        ("int", "regnum"),
+        ("struct type *", "type"),
+        ("const gdb_byte *", "buf"),
+    ),
+)
+
+Method(
+    comment="""
+Construct a value representing the contents of register REGNUM in
+frame FRAME_ID, interpreted as type TYPE.  The routine needs to
+allocate and return a struct value with all value attributes
+(but not the value contents) filled in.
+""",
+    name="value_from_register",
+    type="struct value *",
+    predefault="default_value_from_register",
+    invalid=False,
+    params=(
+        ("struct type *", "type"),
+        ("int", "regnum"),
+        ("struct frame_id", "frame_id"),
+    ),
+)
+
+Method(
+    name="pointer_to_address",
+    type="CORE_ADDR",
+    predefault="unsigned_pointer_to_address",
+    invalid=False,
+    params=(
+        ("struct type *", "type"),
+        ("const gdb_byte *", "buf"),
+    ),
+)
+
+Method(
+    name="address_to_pointer",
+    type="void",
+    predefault="unsigned_address_to_pointer",
+    invalid=False,
+    params=(
+        ("struct type *", "type"),
+        ("gdb_byte *", "buf"),
+        ("CORE_ADDR", "addr"),
+    ),
+)
+
+Method(
+    name="integer_to_address",
+    type="CORE_ADDR",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("struct type *", "type"),
+        ("const gdb_byte *", "buf"),
+    ),
+)
+
+Method(
+    comment="""
+Return the return-value convention that will be used by FUNCTION
+to return a value of type VALTYPE.  FUNCTION may be NULL in which
+case the return convention is computed based only on VALTYPE.
+
+If READBUF is not NULL, extract the return value and save it in this buffer.
+
+If WRITEBUF is not NULL, it contains a return value which will be
+stored into the appropriate register.  This can be used when we want
+to force the value returned by a function (see the "return" command
+for instance).
+""",
+    name="return_value",
+    type="enum return_value_convention",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("struct value *", "function"),
+        ("struct type *", "valtype"),
+        ("struct regcache *", "regcache"),
+        ("gdb_byte *", "readbuf"),
+        ("const gdb_byte *", "writebuf"),
+    ),
+)
+
+Method(
+    comment="""
+Return true if the return value of function is stored in the first hidden
+parameter.  In theory, this feature should be language-dependent, specified
+by language and its ABI, such as C++.  Unfortunately, compiler may
+implement it to a target-dependent feature.  So that we need such hook here
+to be aware of this in GDB.
+""",
+    name="return_in_first_hidden_param_p",
+    type="int",
+    predefault="default_return_in_first_hidden_param_p",
+    invalid=False,
+    params=(("struct type *", "type"),),
+)
+
+Method(
+    name="skip_prologue",
+    type="CORE_ADDR",
+    predefault="0",
+    invalid=True,
+    params=(("CORE_ADDR", "ip"),),
+)
+
+Method(
+    name="skip_main_prologue",
+    type="CORE_ADDR",
+    predicate=True,
+    invalid=True,
+    params=(("CORE_ADDR", "ip"),),
+)
+
+Method(
+    comment="""
+On some platforms, a single function may provide multiple entry points,
+e.g. one that is used for function-pointer calls and a different one
+that is used for direct function calls.
+In order to ensure that breakpoints set on the function will trigger
+no matter via which entry point the function is entered, a platform
+may provide the skip_entrypoint callback.  It is called with IP set
+to the main entry point of a function (as determined by the symbol table),
+and should return the address of the innermost entry point, where the
+actual breakpoint needs to be set.  Note that skip_entrypoint is used
+by GDB common code even when debugging optimized code, where skip_prologue
+is not used.
+""",
+    name="skip_entrypoint",
+    type="CORE_ADDR",
+    predicate=True,
+    invalid=True,
+    params=(("CORE_ADDR", "ip"),),
+)
+
+Function(
+    name="inner_than",
+    type="int",
+    predefault="0",
+    invalid=True,
+    params=(
+        ("CORE_ADDR", "lhs"),
+        ("CORE_ADDR", "rhs"),
+    ),
+)
+
+Method(
+    name="breakpoint_from_pc",
+    type="const gdb_byte *",
+    predefault="default_breakpoint_from_pc",
+    invalid=False,
+    params=(
+        ("CORE_ADDR *", "pcptr"),
+        ("int *", "lenptr"),
+    ),
+)
+
+Method(
+    comment="""
+Return the breakpoint kind for this target based on *PCPTR.
+""",
+    name="breakpoint_kind_from_pc",
+    type="int",
+    predefault="0",
+    invalid=True,
+    params=(("CORE_ADDR *", "pcptr"),),
+)
+
+Method(
+    comment="""
+Return the software breakpoint from KIND.  KIND can have target
+specific meaning like the Z0 kind parameter.
+SIZE is set to the software breakpoint's length in memory.
+""",
+    name="sw_breakpoint_from_kind",
+    type="const gdb_byte *",
+    predefault="NULL",
+    invalid=False,
+    params=(
+        ("int", "kind"),
+        ("int *", "size"),
+    ),
+)
+
+Method(
+    comment="""
+Return the breakpoint kind for this target based on the current
+processor state (e.g. the current instruction mode on ARM) and the
+*PCPTR.  In default, it is gdbarch->breakpoint_kind_from_pc.
+""",
+    name="breakpoint_kind_from_current_state",
+    type="int",
+    predefault="default_breakpoint_kind_from_current_state",
+    invalid=False,
+    params=(
+        ("struct regcache *", "regcache"),
+        ("CORE_ADDR *", "pcptr"),
+    ),
+)
+
+Method(
+    name="adjust_breakpoint_address",
+    type="CORE_ADDR",
+    predicate=True,
+    invalid=True,
+    params=(("CORE_ADDR", "bpaddr"),),
+)
+
+Method(
+    name="memory_insert_breakpoint",
+    type="int",
+    predefault="default_memory_insert_breakpoint",
+    invalid=False,
+    params=(("struct bp_target_info *", "bp_tgt"),),
+)
+
+Method(
+    name="memory_remove_breakpoint",
+    type="int",
+    predefault="default_memory_remove_breakpoint",
+    invalid=False,
+    params=(("struct bp_target_info *", "bp_tgt"),),
+)
+
+Value(
+    name="decr_pc_after_break",
+    type="CORE_ADDR",
+    invalid=False,
+)
+
+Value(
+    comment="""
+A function can be addressed by either it's "pointer" (possibly a
+descriptor address) or "entry point" (first executable instruction).
+The method "convert_from_func_ptr_addr" converting the former to the
+latter.  gdbarch_deprecated_function_start_offset is being used to implement
+a simplified subset of that functionality - the function's address
+corresponds to the "function pointer" and the function's start
+corresponds to the "function entry point" - and hence is redundant.
+""",
+    name="deprecated_function_start_offset",
+    type="CORE_ADDR",
+    invalid=False,
+)
+
+Method(
+    comment="""
+Return the remote protocol register number associated with this
+register.  Normally the identity mapping.
+""",
+    name="remote_register_number",
+    type="int",
+    predefault="default_remote_register_number",
+    invalid=False,
+    params=(("int", "regno"),),
+)
+
+Function(
+    comment="""
+Fetch the target specific address used to represent a load module.
+""",
+    name="fetch_tls_load_module_address",
+    type="CORE_ADDR",
+    predicate=True,
+    invalid=True,
+    params=(("struct objfile *", "objfile"),),
+)
+
+Method(
+    comment="""
+Return the thread-local address at OFFSET in the thread-local
+storage for the thread PTID and the shared library or executable
+file given by LM_ADDR.  If that block of thread-local storage hasn't
+been allocated yet, this function may throw an error.  LM_ADDR may
+be zero for statically linked multithreaded inferiors.
+""",
+    name="get_thread_local_address",
+    type="CORE_ADDR",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("ptid_t", "ptid"),
+        ("CORE_ADDR", "lm_addr"),
+        ("CORE_ADDR", "offset"),
+    ),
+)
+
+Value(
+    name="frame_args_skip",
+    type="CORE_ADDR",
+    invalid=False,
+)
+
+Method(
+    name="unwind_pc",
+    type="CORE_ADDR",
+    predefault="default_unwind_pc",
+    invalid=False,
+    params=(("struct frame_info *", "next_frame"),),
+)
+
+Method(
+    name="unwind_sp",
+    type="CORE_ADDR",
+    predefault="default_unwind_sp",
+    invalid=False,
+    params=(("struct frame_info *", "next_frame"),),
+)
+
+Function(
+    comment="""
+DEPRECATED_FRAME_LOCALS_ADDRESS as been replaced by the per-frame
+frame-base.  Enable frame-base before frame-unwind.
+""",
+    name="frame_num_args",
+    type="int",
+    predicate=True,
+    invalid=True,
+    params=(("struct frame_info *", "frame"),),
+)
+
+Method(
+    name="frame_align",
+    type="CORE_ADDR",
+    predicate=True,
+    invalid=True,
+    params=(("CORE_ADDR", "address"),),
+)
+
+Method(
+    name="stabs_argument_has_addr",
+    type="int",
+    predefault="default_stabs_argument_has_addr",
+    invalid=False,
+    params=(("struct type *", "type"),),
+)
+
+Value(
+    name="frame_red_zone_size",
+    type="int",
+    invalid=True,
+)
+
+Method(
+    name="convert_from_func_ptr_addr",
+    type="CORE_ADDR",
+    predefault="convert_from_func_ptr_addr_identity",
+    invalid=False,
+    params=(
+        ("CORE_ADDR", "addr"),
+        ("struct target_ops *", "targ"),
+    ),
+)
+
+Method(
+    comment="""
+On some machines there are bits in addresses which are not really
+part of the address, but are used by the kernel, the hardware, etc.
+for special purposes.  gdbarch_addr_bits_remove takes out any such bits so
+we get a "real" address such as one would find in a symbol table.
+This is used only for addresses of instructions, and even then I'm
+not sure it's used in all contexts.  It exists to deal with there
+being a few stray bits in the PC which would mislead us, not as some
+sort of generic thing to handle alignment or segmentation (it's
+possible it should be in TARGET_READ_PC instead).
+""",
+    name="addr_bits_remove",
+    type="CORE_ADDR",
+    predefault="core_addr_identity",
+    invalid=False,
+    params=(("CORE_ADDR", "addr"),),
+)
+
+Value(
+    comment="""
+On some machines, not all bits of an address word are significant.
+For example, on AArch64, the top bits of an address known as the "tag"
+are ignored by the kernel, the hardware, etc. and can be regarded as
+additional data associated with the address.
+""",
+    name="significant_addr_bit",
+    type="int",
+    invalid=False,
+)
+
+Method(
+    comment="""
+Return a string representation of the memory tag TAG.
+""",
+    name="memtag_to_string",
+    type="std::string",
+    predefault="default_memtag_to_string",
+    invalid=False,
+    params=(("struct value *", "tag"),),
+)
+
+Method(
+    comment="""
+Return true if ADDRESS contains a tag and false otherwise.  ADDRESS
+must be either a pointer or a reference type.
+""",
+    name="tagged_address_p",
+    type="bool",
+    predefault="default_tagged_address_p",
+    invalid=False,
+    params=(("struct value *", "address"),),
+)
+
+Method(
+    comment="""
+Return true if the tag from ADDRESS matches the memory tag for that
+particular address.  Return false otherwise.
+""",
+    name="memtag_matches_p",
+    type="bool",
+    predefault="default_memtag_matches_p",
+    invalid=False,
+    params=(("struct value *", "address"),),
+)
+
+Method(
+    comment="""
+Set the tags of type TAG_TYPE, for the memory address range
+[ADDRESS, ADDRESS + LENGTH) to TAGS.
+Return true if successful and false otherwise.
+""",
+    name="set_memtags",
+    type="bool",
+    predefault="default_set_memtags",
+    invalid=False,
+    params=(
+        ("struct value *", "address"),
+        ("size_t", "length"),
+        ("const gdb::byte_vector &", "tags"),
+        ("memtag_type", "tag_type"),
+    ),
+)
+
+Method(
+    comment="""
+Return the tag of type TAG_TYPE associated with the memory address ADDRESS,
+assuming ADDRESS is tagged.
+""",
+    name="get_memtag",
+    type="struct value *",
+    predefault="default_get_memtag",
+    invalid=False,
+    params=(
+        ("struct value *", "address"),
+        ("memtag_type", "tag_type"),
+    ),
+)
+
+Value(
+    comment="""
+memtag_granule_size is the size of the allocation tag granule, for
+architectures that support memory tagging.
+This is 0 for architectures that do not support memory tagging.
+For a non-zero value, this represents the number of bytes of memory per tag.
+""",
+    name="memtag_granule_size",
+    type="CORE_ADDR",
+    invalid=False,
+)
+
+Function(
+    comment="""
+FIXME/cagney/2001-01-18: This should be split in two.  A target method that
+indicates if the target needs software single step.  An ISA method to
+implement it.
+
+FIXME/cagney/2001-01-18: The logic is backwards.  It should be asking if the
+target can single step.  If not, then implement single step using breakpoints.
+
+Return a vector of addresses on which the software single step
+breakpoints should be inserted.  NULL means software single step is
+not used.
+Multiple breakpoints may be inserted for some instructions such as
+conditional branch.  However, each implementation must always evaluate
+the condition and only put the breakpoint at the branch destination if
+the condition is true, so that we ensure forward progress when stepping
+past a conditional branch to self.
+""",
+    name="software_single_step",
+    type="std::vector<CORE_ADDR>",
+    predicate=True,
+    invalid=True,
+    params=(("struct regcache *", "regcache"),),
+)
+
+Method(
+    comment="""
+Return non-zero if the processor is executing a delay slot and a
+further single-step is needed before the instruction finishes.
+""",
+    name="single_step_through_delay",
+    type="int",
+    predicate=True,
+    invalid=True,
+    params=(("struct frame_info *", "frame"),),
+)
+
+Function(
+    comment="""
+FIXME: cagney/2003-08-28: Need to find a better way of selecting the
+disassembler.  Perhaps objdump can handle it?
+""",
+    name="print_insn",
+    type="int",
+    predefault="default_print_insn",
+    invalid=False,
+    params=(
+        ("bfd_vma", "vma"),
+        ("struct disassemble_info *", "info"),
+    ),
+)
+
+Function(
+    name="skip_trampoline_code",
+    type="CORE_ADDR",
+    predefault="generic_skip_trampoline_code",
+    invalid=False,
+    params=(
+        ("struct frame_info *", "frame"),
+        ("CORE_ADDR", "pc"),
+    ),
+)
+
+Method(
+    comment="""
+If in_solib_dynsym_resolve_code() returns true, and SKIP_SOLIB_RESOLVER
+evaluates non-zero, this is the address where the debugger will place
+a step-resume breakpoint to get us past the dynamic linker.
+""",
+    name="skip_solib_resolver",
+    type="CORE_ADDR",
+    predefault="generic_skip_solib_resolver",
+    invalid=False,
+    params=(("CORE_ADDR", "pc"),),
+)
+
+Method(
+    comment="""
+Some systems also have trampoline code for returning from shared libs.
+""",
+    name="in_solib_return_trampoline",
+    type="int",
+    predefault="generic_in_solib_return_trampoline",
+    invalid=False,
+    params=(
+        ("CORE_ADDR", "pc"),
+        ("const char *", "name"),
+    ),
+)
+
+Method(
+    comment="""
+Return true if PC lies inside an indirect branch thunk.
+""",
+    name="in_indirect_branch_thunk",
+    type="bool",
+    predefault="default_in_indirect_branch_thunk",
+    invalid=False,
+    params=(("CORE_ADDR", "pc"),),
+)
+
+Method(
+    comment="""
+A target might have problems with watchpoints as soon as the stack
+frame of the current function has been destroyed.  This mostly happens
+as the first action in a function's epilogue.  stack_frame_destroyed_p()
+is defined to return a non-zero value if either the given addr is one
+instruction after the stack destroying instruction up to the trailing
+return instruction or if we can figure out that the stack frame has
+already been invalidated regardless of the value of addr.  Targets
+which don't suffer from that problem could just let this functionality
+untouched.
+""",
+    name="stack_frame_destroyed_p",
+    type="int",
+    predefault="generic_stack_frame_destroyed_p",
+    invalid=False,
+    params=(("CORE_ADDR", "addr"),),
+)
+
+Function(
+    comment="""
+Process an ELF symbol in the minimal symbol table in a backend-specific
+way.  Normally this hook is supposed to do nothing, however if required,
+then this hook can be used to apply tranformations to symbols that are
+considered special in some way.  For example the MIPS backend uses it
+to interpret `st_other' information to mark compressed code symbols so
+that they can be treated in the appropriate manner in the processing of
+the main symbol table and DWARF-2 records.
+""",
+    name="elf_make_msymbol_special",
+    type="void",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("asymbol *", "sym"),
+        ("struct minimal_symbol *", "msym"),
+    ),
+)
+
+Function(
+    name="coff_make_msymbol_special",
+    type="void",
+    predefault="default_coff_make_msymbol_special",
+    invalid=False,
+    params=(
+        ("int", "val"),
+        ("struct minimal_symbol *", "msym"),
+    ),
+)
+
+Function(
+    comment="""
+Process a symbol in the main symbol table in a backend-specific way.
+Normally this hook is supposed to do nothing, however if required,
+then this hook can be used to apply tranformations to symbols that
+are considered special in some way.  This is currently used by the
+MIPS backend to make sure compressed code symbols have the ISA bit
+set.  This in turn is needed for symbol values seen in GDB to match
+the values used at the runtime by the program itself, for function
+and label references.
+""",
+    name="make_symbol_special",
+    type="void",
+    predefault="default_make_symbol_special",
+    invalid=False,
+    params=(
+        ("struct symbol *", "sym"),
+        ("struct objfile *", "objfile"),
+    ),
+)
+
+Function(
+    comment="""
+Adjust the address retrieved from a DWARF-2 record other than a line
+entry in a backend-specific way.  Normally this hook is supposed to
+return the address passed unchanged, however if that is incorrect for
+any reason, then this hook can be used to fix the address up in the
+required manner.  This is currently used by the MIPS backend to make
+sure addresses in FDE, range records, etc. referring to compressed
+code have the ISA bit set, matching line information and the symbol
+table.
+""",
+    name="adjust_dwarf2_addr",
+    type="CORE_ADDR",
+    predefault="default_adjust_dwarf2_addr",
+    invalid=False,
+    params=(("CORE_ADDR", "pc"),),
+)
+
+Function(
+    comment="""
+Adjust the address updated by a line entry in a backend-specific way.
+Normally this hook is supposed to return the address passed unchanged,
+however in the case of inconsistencies in these records, this hook can
+be used to fix them up in the required manner.  This is currently used
+by the MIPS backend to make sure all line addresses in compressed code
+are presented with the ISA bit set, which is not always the case.  This
+in turn ensures breakpoint addresses are correctly matched against the
+stop PC.
+""",
+    name="adjust_dwarf2_line",
+    type="CORE_ADDR",
+    predefault="default_adjust_dwarf2_line",
+    invalid=False,
+    params=(
+        ("CORE_ADDR", "addr"),
+        ("int", "rel"),
+    ),
+)
+
+Value(
+    name="cannot_step_breakpoint",
+    type="int",
+    predefault="0",
+    invalid=False,
+)
+
+Value(
+    comment="""
+See comment in target.h about continuable, steppable and
+non-steppable watchpoints.
+""",
+    name="have_nonsteppable_watchpoint",
+    type="int",
+    predefault="0",
+    invalid=False,
+)
+
+Function(
+    name="address_class_type_flags",
+    type="type_instance_flags",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("int", "byte_size"),
+        ("int", "dwarf2_addr_class"),
+    ),
+)
+
+Method(
+    name="address_class_type_flags_to_name",
+    type="const char *",
+    predicate=True,
+    invalid=True,
+    params=(("type_instance_flags", "type_flags"),),
+)
+
+Method(
+    comment="""
+Execute vendor-specific DWARF Call Frame Instruction.  OP is the instruction.
+FS are passed from the generic execute_cfa_program function.
+""",
+    name="execute_dwarf_cfa_vendor_op",
+    type="bool",
+    predefault="default_execute_dwarf_cfa_vendor_op",
+    invalid=False,
+    params=(
+        ("gdb_byte", "op"),
+        ("struct dwarf2_frame_state *", "fs"),
+    ),
+)
+
+Method(
+    comment="""
+Return the appropriate type_flags for the supplied address class.
+This function should return true if the address class was recognized and
+type_flags was set, false otherwise.
+""",
+    name="address_class_name_to_type_flags",
+    type="bool",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("const char *", "name"),
+        ("type_instance_flags *", "type_flags_ptr"),
+    ),
+)
+
+Method(
+    comment="""
+Is a register in a group
+""",
+    name="register_reggroup_p",
+    type="int",
+    predefault="default_register_reggroup_p",
+    invalid=False,
+    params=(
+        ("int", "regnum"),
+        ("struct reggroup *", "reggroup"),
+    ),
+)
+
+Function(
+    comment="""
+Fetch the pointer to the ith function argument.
+""",
+    name="fetch_pointer_argument",
+    type="CORE_ADDR",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("struct frame_info *", "frame"),
+        ("int", "argi"),
+        ("struct type *", "type"),
+    ),
+)
+
+Method(
+    comment="""
+Iterate over all supported register notes in a core file.  For each
+supported register note section, the iterator must call CB and pass
+CB_DATA unchanged.  If REGCACHE is not NULL, the iterator can limit
+the supported register note sections based on the current register
+values.  Otherwise it should enumerate all supported register note
+sections.
+""",
+    name="iterate_over_regset_sections",
+    type="void",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("iterate_over_regset_sections_cb *", "cb"),
+        ("void *", "cb_data"),
+        ("const struct regcache *", "regcache"),
+    ),
+)
+
+Method(
+    comment="""
+Create core file notes
+""",
+    name="make_corefile_notes",
+    type="gdb::unique_xmalloc_ptr<char>",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("bfd *", "obfd"),
+        ("int *", "note_size"),
+    ),
+)
+
+Method(
+    comment="""
+Find core file memory regions
+""",
+    name="find_memory_regions",
+    type="int",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("find_memory_region_ftype", "func"),
+        ("void *", "data"),
+    ),
+)
+
+Method(
+    comment="""
+Read offset OFFSET of TARGET_OBJECT_LIBRARIES formatted shared libraries list from
+core file into buffer READBUF with length LEN.  Return the number of bytes read
+(zero indicates failure).
+failed, otherwise, return the red length of READBUF.
+""",
+    name="core_xfer_shared_libraries",
+    type="ULONGEST",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("gdb_byte *", "readbuf"),
+        ("ULONGEST", "offset"),
+        ("ULONGEST", "len"),
+    ),
+)
+
+Method(
+    comment="""
+Read offset OFFSET of TARGET_OBJECT_LIBRARIES_AIX formatted shared
+libraries list from core file into buffer READBUF with length LEN.
+Return the number of bytes read (zero indicates failure).
+""",
+    name="core_xfer_shared_libraries_aix",
+    type="ULONGEST",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("gdb_byte *", "readbuf"),
+        ("ULONGEST", "offset"),
+        ("ULONGEST", "len"),
+    ),
+)
+
+Method(
+    comment="""
+How the core target converts a PTID from a core file to a string.
+""",
+    name="core_pid_to_str",
+    type="std::string",
+    predicate=True,
+    invalid=True,
+    params=(("ptid_t", "ptid"),),
+)
+
+Method(
+    comment="""
+How the core target extracts the name of a thread from a core file.
+""",
+    name="core_thread_name",
+    type="const char *",
+    predicate=True,
+    invalid=True,
+    params=(("struct thread_info *", "thr"),),
+)
+
+Method(
+    comment="""
+Read offset OFFSET of TARGET_OBJECT_SIGNAL_INFO signal information
+from core file into buffer READBUF with length LEN.  Return the number
+of bytes read (zero indicates EOF, a negative value indicates failure).
+""",
+    name="core_xfer_siginfo",
+    type="LONGEST",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("gdb_byte *", "readbuf"),
+        ("ULONGEST", "offset"),
+        ("ULONGEST", "len"),
+    ),
+)
+
+Value(
+    comment="""
+BFD target to use when generating a core file.
+""",
+    name="gcore_bfd_target",
+    type="const char *",
+    predicate=True,
+    predefault="0",
+    invalid=True,
+    printer="pstring (gdbarch->gcore_bfd_target)",
+)
+
+Value(
+    comment="""
+If the elements of C++ vtables are in-place function descriptors rather
+than normal function pointers (which may point to code or a descriptor),
+set this to one.
+""",
+    name="vtable_function_descriptors",
+    type="int",
+    predefault="0",
+    invalid=False,
+)
+
+Value(
+    comment="""
+Set if the least significant bit of the delta is used instead of the least
+significant bit of the pfn for pointers to virtual member functions.
+""",
+    name="vbit_in_delta",
+    type="int",
+    predefault="0",
+    invalid=False,
+)
+
+Function(
+    comment="""
+Advance PC to next instruction in order to skip a permanent breakpoint.
+""",
+    name="skip_permanent_breakpoint",
+    type="void",
+    predefault="default_skip_permanent_breakpoint",
+    invalid=False,
+    params=(("struct regcache *", "regcache"),),
+)
+
+Value(
+    comment="""
+The maximum length of an instruction on this architecture in bytes.
+""",
+    name="max_insn_length",
+    type="ULONGEST",
+    predicate=True,
+    predefault="0",
+    invalid=True,
+)
+
+Method(
+    comment="""
+Copy the instruction at FROM to TO, and make any adjustments
+necessary to single-step it at that address.
+
+REGS holds the state the thread's registers will have before
+executing the copied instruction; the PC in REGS will refer to FROM,
+not the copy at TO.  The caller should update it to point at TO later.
+
+Return a pointer to data of the architecture's choice to be passed
+to gdbarch_displaced_step_fixup.
+
+For a general explanation of displaced stepping and how GDB uses it,
+see the comments in infrun.c.
+
+The TO area is only guaranteed to have space for
+gdbarch_max_insn_length (arch) bytes, so this function must not
+write more bytes than that to that area.
+
+If you do not provide this function, GDB assumes that the
+architecture does not support displaced stepping.
+
+If the instruction cannot execute out of line, return NULL.  The
+core falls back to stepping past the instruction in-line instead in
+that case.
+""",
+    name="displaced_step_copy_insn",
+    type="displaced_step_copy_insn_closure_up",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("CORE_ADDR", "from"),
+        ("CORE_ADDR", "to"),
+        ("struct regcache *", "regs"),
+    ),
+)
+
+Method(
+    comment="""
+Return true if GDB should use hardware single-stepping to execute a displaced
+step instruction.  If false, GDB will simply restart execution at the
+displaced instruction location, and it is up to the target to ensure GDB will
+receive control again (e.g. by placing a software breakpoint instruction into
+the displaced instruction buffer).
+
+The default implementation returns false on all targets that provide a
+gdbarch_software_single_step routine, and true otherwise.
+""",
+    name="displaced_step_hw_singlestep",
+    type="bool",
+    predefault="default_displaced_step_hw_singlestep",
+    invalid=False,
+    params=(),
+)
+
+Method(
+    comment="""
+Fix up the state resulting from successfully single-stepping a
+displaced instruction, to give the result we would have gotten from
+stepping the instruction in its original location.
+
+REGS is the register state resulting from single-stepping the
+displaced instruction.
+
+CLOSURE is the result from the matching call to
+gdbarch_displaced_step_copy_insn.
+
+If you provide gdbarch_displaced_step_copy_insn.but not this
+function, then GDB assumes that no fixup is needed after
+single-stepping the instruction.
+
+For a general explanation of displaced stepping and how GDB uses it,
+see the comments in infrun.c.
+""",
+    name="displaced_step_fixup",
+    type="void",
+    predicate=True,
+    predefault="NULL",
+    invalid=True,
+    params=(
+        ("struct displaced_step_copy_insn_closure *", "closure"),
+        ("CORE_ADDR", "from"),
+        ("CORE_ADDR", "to"),
+        ("struct regcache *", "regs"),
+    ),
+)
+
+Method(
+    comment="""
+Prepare THREAD for it to displaced step the instruction at its current PC.
+
+Throw an exception if any unexpected error happens.
+""",
+    name="displaced_step_prepare",
+    type="displaced_step_prepare_status",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("thread_info *", "thread"),
+        ("CORE_ADDR &", "displaced_pc"),
+    ),
+)
+
+Method(
+    comment="""
+Clean up after a displaced step of THREAD.
+""",
+    name="displaced_step_finish",
+    type="displaced_step_finish_status",
+    predefault="NULL",
+    invalid="(! gdbarch->displaced_step_finish) != (! gdbarch->displaced_step_prepare)",
+    params=(
+        ("thread_info *", "thread"),
+        ("gdb_signal", "sig"),
+    ),
+)
+
+Function(
+    comment="""
+Return the closure associated to the displaced step buffer that is at ADDR.
+""",
+    name="displaced_step_copy_insn_closure_by_addr",
+    type="const displaced_step_copy_insn_closure *",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("inferior *", "inf"),
+        ("CORE_ADDR", "addr"),
+    ),
+)
+
+Function(
+    comment="""
+PARENT_INF has forked and CHILD_PTID is the ptid of the child.  Restore the
+contents of all displaced step buffers in the child's address space.
+""",
+    name="displaced_step_restore_all_in_ptid",
+    type="void",
+    invalid=True,
+    params=(
+        ("inferior *", "parent_inf"),
+        ("ptid_t", "child_ptid"),
+    ),
+)
+
+Method(
+    comment="""
+Relocate an instruction to execute at a different address.  OLDLOC
+is the address in the inferior memory where the instruction to
+relocate is currently at.  On input, TO points to the destination
+where we want the instruction to be copied (and possibly adjusted)
+to.  On output, it points to one past the end of the resulting
+instruction(s).  The effect of executing the instruction at TO shall
+be the same as if executing it at FROM.  For example, call
+instructions that implicitly push the return address on the stack
+should be adjusted to return to the instruction after OLDLOC;
+relative branches, and other PC-relative instructions need the
+offset adjusted; etc.
+""",
+    name="relocate_instruction",
+    type="void",
+    predicate=True,
+    predefault="NULL",
+    invalid=True,
+    params=(
+        ("CORE_ADDR *", "to"),
+        ("CORE_ADDR", "from"),
+    ),
+)
+
+Function(
+    comment="""
+Refresh overlay mapped state for section OSECT.
+""",
+    name="overlay_update",
+    type="void",
+    predicate=True,
+    invalid=True,
+    params=(("struct obj_section *", "osect"),),
+)
+
+Method(
+    name="core_read_description",
+    type="const struct target_desc *",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("struct target_ops *", "target"),
+        ("bfd *", "abfd"),
+    ),
+)
+
+Value(
+    comment="""
+Set if the address in N_SO or N_FUN stabs may be zero.
+""",
+    name="sofun_address_maybe_missing",
+    type="int",
+    predefault="0",
+    invalid=False,
+)
+
+Method(
+    comment="""
+Parse the instruction at ADDR storing in the record execution log
+the registers REGCACHE and memory ranges that will be affected when
+the instruction executes, along with their current values.
+Return -1 if something goes wrong, 0 otherwise.
+""",
+    name="process_record",
+    type="int",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("struct regcache *", "regcache"),
+        ("CORE_ADDR", "addr"),
+    ),
+)
+
+Method(
+    comment="""
+Save process state after a signal.
+Return -1 if something goes wrong, 0 otherwise.
+""",
+    name="process_record_signal",
+    type="int",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("struct regcache *", "regcache"),
+        ("enum gdb_signal", "signal"),
+    ),
+)
+
+Method(
+    comment="""
+Signal translation: translate inferior's signal (target's) number
+into GDB's representation.  The implementation of this method must
+be host independent.  IOW, don't rely on symbols of the NAT_FILE
+header (the nm-*.h files), the host <signal.h> header, or similar
+headers.  This is mainly used when cross-debugging core files ---
+"Live" targets hide the translation behind the target interface
+(target_wait, target_resume, etc.).
+""",
+    name="gdb_signal_from_target",
+    type="enum gdb_signal",
+    predicate=True,
+    invalid=True,
+    params=(("int", "signo"),),
+)
+
+Method(
+    comment="""
+Signal translation: translate the GDB's internal signal number into
+the inferior's signal (target's) representation.  The implementation
+of this method must be host independent.  IOW, don't rely on symbols
+of the NAT_FILE header (the nm-*.h files), the host <signal.h>
+header, or similar headers.
+Return the target signal number if found, or -1 if the GDB internal
+signal number is invalid.
+""",
+    name="gdb_signal_to_target",
+    type="int",
+    predicate=True,
+    invalid=True,
+    params=(("enum gdb_signal", "signal"),),
+)
+
+Method(
+    comment="""
+Extra signal info inspection.
+
+Return a type suitable to inspect extra signal information.
+""",
+    name="get_siginfo_type",
+    type="struct type *",
+    predicate=True,
+    invalid=True,
+    params=(),
+)
+
+Method(
+    comment="""
+Record architecture-specific information from the symbol table.
+""",
+    name="record_special_symbol",
+    type="void",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("struct objfile *", "objfile"),
+        ("asymbol *", "sym"),
+    ),
+)
+
+Method(
+    comment="""
+Function for the 'catch syscall' feature.
+Get architecture-specific system calls information from registers.
+""",
+    name="get_syscall_number",
+    type="LONGEST",
+    predicate=True,
+    invalid=True,
+    params=(("thread_info *", "thread"),),
+)
+
+Value(
+    comment="""
+The filename of the XML syscall for this architecture.
+""",
+    name="xml_syscall_file",
+    type="const char *",
+    predefault="0",
+    invalid=False,
+    printer="pstring (gdbarch->xml_syscall_file)",
+)
+
+Value(
+    comment="""
+Information about system calls from this architecture
+""",
+    name="syscalls_info",
+    type="struct syscalls_info *",
+    predefault="0",
+    invalid=False,
+    printer="host_address_to_string (gdbarch->syscalls_info)",
+)
+
+Value(
+    comment="""
+SystemTap related fields and functions.
+A NULL-terminated array of prefixes used to mark an integer constant
+on the architecture's assembly.
+For example, on x86 integer constants are written as:
+
+$10 ;; integer constant 10
+
+in this case, this prefix would be the character `$'.
+""",
+    name="stap_integer_prefixes",
+    type="const char *const *",
+    predefault="0",
+    invalid=False,
+    printer="pstring_list (gdbarch->stap_integer_prefixes)",
+)
+
+Value(
+    comment="""
+A NULL-terminated array of suffixes used to mark an integer constant
+on the architecture's assembly.
+""",
+    name="stap_integer_suffixes",
+    type="const char *const *",
+    predefault="0",
+    invalid=False,
+    printer="pstring_list (gdbarch->stap_integer_suffixes)",
+)
+
+Value(
+    comment="""
+A NULL-terminated array of prefixes used to mark a register name on
+the architecture's assembly.
+For example, on x86 the register name is written as:
+
+%eax ;; register eax
+
+in this case, this prefix would be the character `%'.
+""",
+    name="stap_register_prefixes",
+    type="const char *const *",
+    predefault="0",
+    invalid=False,
+    printer="pstring_list (gdbarch->stap_register_prefixes)",
+)
+
+Value(
+    comment="""
+A NULL-terminated array of suffixes used to mark a register name on
+the architecture's assembly.
+""",
+    name="stap_register_suffixes",
+    type="const char *const *",
+    predefault="0",
+    invalid=False,
+    printer="pstring_list (gdbarch->stap_register_suffixes)",
+)
+
+Value(
+    comment="""
+A NULL-terminated array of prefixes used to mark a register
+indirection on the architecture's assembly.
+For example, on x86 the register indirection is written as:
+
+(%eax) ;; indirecting eax
+
+in this case, this prefix would be the charater `('.
+
+Please note that we use the indirection prefix also for register
+displacement, e.g., `4(%eax)' on x86.
+""",
+    name="stap_register_indirection_prefixes",
+    type="const char *const *",
+    predefault="0",
+    invalid=False,
+    printer="pstring_list (gdbarch->stap_register_indirection_prefixes)",
+)
+
+Value(
+    comment="""
+A NULL-terminated array of suffixes used to mark a register
+indirection on the architecture's assembly.
+For example, on x86 the register indirection is written as:
+
+(%eax) ;; indirecting eax
+
+in this case, this prefix would be the charater `)'.
+
+Please note that we use the indirection suffix also for register
+displacement, e.g., `4(%eax)' on x86.
+""",
+    name="stap_register_indirection_suffixes",
+    type="const char *const *",
+    predefault="0",
+    invalid=False,
+    printer="pstring_list (gdbarch->stap_register_indirection_suffixes)",
+)
+
+Value(
+    comment="""
+Prefix(es) used to name a register using GDB's nomenclature.
+
+For example, on PPC a register is represented by a number in the assembly
+language (e.g., `10' is the 10th general-purpose register).  However,
+inside GDB this same register has an `r' appended to its name, so the 10th
+register would be represented as `r10' internally.
+""",
+    name="stap_gdb_register_prefix",
+    type="const char *",
+    predefault="0",
+    invalid=False,
+    printer="pstring (gdbarch->stap_gdb_register_prefix)",
+)
+
+Value(
+    comment="""
+Suffix used to name a register using GDB's nomenclature.
+""",
+    name="stap_gdb_register_suffix",
+    type="const char *",
+    predefault="0",
+    invalid=False,
+    printer="pstring (gdbarch->stap_gdb_register_suffix)",
+)
+
+Method(
+    comment="""
+Check if S is a single operand.
+
+Single operands can be:
+- Literal integers, e.g. `$10' on x86
+- Register access, e.g. `%eax' on x86
+- Register indirection, e.g. `(%eax)' on x86
+- Register displacement, e.g. `4(%eax)' on x86
+
+This function should check for these patterns on the string
+and return 1 if some were found, or zero otherwise.  Please try to match
+as much info as you can from the string, i.e., if you have to match
+something like `(%', do not match just the `('.
+""",
+    name="stap_is_single_operand",
+    type="int",
+    predicate=True,
+    invalid=True,
+    params=(("const char *", "s"),),
+)
+
+Method(
+    comment="""
+Function used to handle a "special case" in the parser.
+
+A "special case" is considered to be an unknown token, i.e., a token
+that the parser does not know how to parse.  A good example of special
+case would be ARM's register displacement syntax:
+
+[R0, #4]  ;; displacing R0 by 4
+
+Since the parser assumes that a register displacement is of the form:
+
+<number> <indirection_prefix> <register_name> <indirection_suffix>
+
+it means that it will not be able to recognize and parse this odd syntax.
+Therefore, we should add a special case function that will handle this token.
+
+This function should generate the proper expression form of the expression
+using GDB's internal expression mechanism (e.g., `write_exp_elt_opcode'
+and so on).  It should also return 1 if the parsing was successful, or zero
+if the token was not recognized as a special token (in this case, returning
+zero means that the special parser is deferring the parsing to the generic
+parser), and should advance the buffer pointer (p->arg).
+""",
+    name="stap_parse_special_token",
+    type="expr::operation_up",
+    predicate=True,
+    invalid=True,
+    params=(("struct stap_parse_info *", "p"),),
+)
+
+Method(
+    comment="""
+Perform arch-dependent adjustments to a register name.
+
+In very specific situations, it may be necessary for the register
+name present in a SystemTap probe's argument to be handled in a
+special way.  For example, on i386, GCC may over-optimize the
+register allocation and use smaller registers than necessary.  In
+such cases, the client that is reading and evaluating the SystemTap
+probe (ourselves) will need to actually fetch values from the wider
+version of the register in question.
+
+To illustrate the example, consider the following probe argument
+(i386):
+
+4@%ax
+
+This argument says that its value can be found at the %ax register,
+which is a 16-bit register.  However, the argument's prefix says
+that its type is "uint32_t", which is 32-bit in size.  Therefore, in
+this case, GDB should actually fetch the probe's value from register
+%eax, not %ax.  In this scenario, this function would actually
+replace the register name from %ax to %eax.
+
+The rationale for this can be found at PR breakpoints/24541.
+""",
+    name="stap_adjust_register",
+    type="std::string",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("struct stap_parse_info *", "p"),
+        ("const std::string &", "regname"),
+        ("int", "regnum"),
+    ),
+)
+
+Method(
+    comment="""
+DTrace related functions.
+The expression to compute the NARTGth+1 argument to a DTrace USDT probe.
+NARG must be >= 0.
+""",
+    name="dtrace_parse_probe_argument",
+    type="expr::operation_up",
+    predicate=True,
+    invalid=True,
+    params=(("int", "narg"),),
+)
+
+Method(
+    comment="""
+True if the given ADDR does not contain the instruction sequence
+corresponding to a disabled DTrace is-enabled probe.
+""",
+    name="dtrace_probe_is_enabled",
+    type="int",
+    predicate=True,
+    invalid=True,
+    params=(("CORE_ADDR", "addr"),),
+)
+
+Method(
+    comment="""
+Enable a DTrace is-enabled probe at ADDR.
+""",
+    name="dtrace_enable_probe",
+    type="void",
+    predicate=True,
+    invalid=True,
+    params=(("CORE_ADDR", "addr"),),
+)
+
+Method(
+    comment="""
+Disable a DTrace is-enabled probe at ADDR.
+""",
+    name="dtrace_disable_probe",
+    type="void",
+    predicate=True,
+    invalid=True,
+    params=(("CORE_ADDR", "addr"),),
+)
+
+Value(
+    comment="""
+True if the list of shared libraries is one and only for all
+processes, as opposed to a list of shared libraries per inferior.
+This usually means that all processes, although may or may not share
+an address space, will see the same set of symbols at the same
+addresses.
+""",
+    name="has_global_solist",
+    type="int",
+    predefault="0",
+    invalid=False,
+)
+
+Value(
+    comment="""
+On some targets, even though each inferior has its own private
+address space, the debug interface takes care of making breakpoints
+visible to all address spaces automatically.  For such cases,
+this property should be set to true.
+""",
+    name="has_global_breakpoints",
+    type="int",
+    predefault="0",
+    invalid=False,
+)
+
+Method(
+    comment="""
+True if inferiors share an address space (e.g., uClinux).
+""",
+    name="has_shared_address_space",
+    type="int",
+    predefault="default_has_shared_address_space",
+    invalid=False,
+    params=(),
+)
+
+Method(
+    comment="""
+True if a fast tracepoint can be set at an address.
+""",
+    name="fast_tracepoint_valid_at",
+    type="int",
+    predefault="default_fast_tracepoint_valid_at",
+    invalid=False,
+    params=(
+        ("CORE_ADDR", "addr"),
+        ("std::string *", "msg"),
+    ),
+)
+
+Method(
+    comment="""
+Guess register state based on tracepoint location.  Used for tracepoints
+where no registers have been collected, but there's only one location,
+allowing us to guess the PC value, and perhaps some other registers.
+On entry, regcache has all registers marked as unavailable.
+""",
+    name="guess_tracepoint_registers",
+    type="void",
+    predefault="default_guess_tracepoint_registers",
+    invalid=False,
+    params=(
+        ("struct regcache *", "regcache"),
+        ("CORE_ADDR", "addr"),
+    ),
+)
+
+Function(
+    comment="""
+Return the "auto" target charset.
+""",
+    name="auto_charset",
+    type="const char *",
+    predefault="default_auto_charset",
+    invalid=False,
+    params=(),
+)
+
+Function(
+    comment="""
+Return the "auto" target wide charset.
+""",
+    name="auto_wide_charset",
+    type="const char *",
+    predefault="default_auto_wide_charset",
+    invalid=False,
+    params=(),
+)
+
+Value(
+    comment="""
+If non-empty, this is a file extension that will be opened in place
+of the file extension reported by the shared library list.
+
+This is most useful for toolchains that use a post-linker tool,
+where the names of the files run on the target differ in extension
+compared to the names of the files GDB should load for debug info.
+""",
+    name="solib_symbols_extension",
+    type="const char *",
+    invalid=True,
+    printer="pstring (gdbarch->solib_symbols_extension)",
+)
+
+Value(
+    comment="""
+If true, the target OS has DOS-based file system semantics.  That
+is, absolute paths include a drive name, and the backslash is
+considered a directory separator.
+""",
+    name="has_dos_based_file_system",
+    type="int",
+    predefault="0",
+    invalid=False,
+)
+
+Method(
+    comment="""
+Generate bytecodes to collect the return address in a frame.
+Since the bytecodes run on the target, possibly with GDB not even
+connected, the full unwinding machinery is not available, and
+typically this function will issue bytecodes for one or more likely
+places that the return address may be found.
+""",
+    name="gen_return_address",
+    type="void",
+    predefault="default_gen_return_address",
+    invalid=False,
+    params=(
+        ("struct agent_expr *", "ax"),
+        ("struct axs_value *", "value"),
+        ("CORE_ADDR", "scope"),
+    ),
+)
+
+Method(
+    comment="""
+Implement the "info proc" command.
+""",
+    name="info_proc",
+    type="void",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("const char *", "args"),
+        ("enum info_proc_what", "what"),
+    ),
+)
+
+Method(
+    comment="""
+Implement the "info proc" command for core files.  Noe that there
+are two "info_proc"-like methods on gdbarch -- one for core files,
+one for live targets.
+""",
+    name="core_info_proc",
+    type="void",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("const char *", "args"),
+        ("enum info_proc_what", "what"),
+    ),
+)
+
+Method(
+    comment="""
+Iterate over all objfiles in the order that makes the most sense
+for the architecture to make global symbol searches.
+
+CB is a callback function where OBJFILE is the objfile to be searched,
+and CB_DATA a pointer to user-defined data (the same data that is passed
+when calling this gdbarch method).  The iteration stops if this function
+returns nonzero.
+
+CB_DATA is a pointer to some user-defined data to be passed to
+the callback.
+
+If not NULL, CURRENT_OBJFILE corresponds to the objfile being
+inspected when the symbol search was requested.
+""",
+    name="iterate_over_objfiles_in_search_order",
+    type="void",
+    predefault="default_iterate_over_objfiles_in_search_order",
+    invalid=False,
+    params=(
+        ("iterate_over_objfiles_in_search_order_cb_ftype *", "cb"),
+        ("void *", "cb_data"),
+        ("struct objfile *", "current_objfile"),
+    ),
+)
+
+Value(
+    comment="""
+Ravenscar arch-dependent ops.
+""",
+    name="ravenscar_ops",
+    type="struct ravenscar_arch_ops *",
+    predefault="NULL",
+    invalid=False,
+    printer="host_address_to_string (gdbarch->ravenscar_ops)",
+)
+
+Method(
+    comment="""
+Return non-zero if the instruction at ADDR is a call; zero otherwise.
+""",
+    name="insn_is_call",
+    type="int",
+    predefault="default_insn_is_call",
+    invalid=False,
+    params=(("CORE_ADDR", "addr"),),
+)
+
+Method(
+    comment="""
+Return non-zero if the instruction at ADDR is a return; zero otherwise.
+""",
+    name="insn_is_ret",
+    type="int",
+    predefault="default_insn_is_ret",
+    invalid=False,
+    params=(("CORE_ADDR", "addr"),),
+)
+
+Method(
+    comment="""
+Return non-zero if the instruction at ADDR is a jump; zero otherwise.
+""",
+    name="insn_is_jump",
+    type="int",
+    predefault="default_insn_is_jump",
+    invalid=False,
+    params=(("CORE_ADDR", "addr"),),
+)
+
+Method(
+    comment="""
+Return true if there's a program/permanent breakpoint planted in
+memory at ADDRESS, return false otherwise.
+""",
+    name="program_breakpoint_here_p",
+    type="bool",
+    predefault="default_program_breakpoint_here_p",
+    invalid=False,
+    params=(("CORE_ADDR", "address"),),
+)
+
+Method(
+    comment="""
+Read one auxv entry from *READPTR, not reading locations >= ENDPTR.
+Return 0 if *READPTR is already at the end of the buffer.
+Return -1 if there is insufficient buffer for a whole entry.
+Return 1 if an entry was read into *TYPEP and *VALP.
+""",
+    name="auxv_parse",
+    type="int",
+    predicate=True,
+    invalid=True,
+    params=(
+        ("gdb_byte **", "readptr"),
+        ("gdb_byte *", "endptr"),
+        ("CORE_ADDR *", "typep"),
+        ("CORE_ADDR *", "valp"),
+    ),
+)
+
+Method(
+    comment="""
+Print the description of a single auxv entry described by TYPE and VAL
+to FILE.
+""",
+    name="print_auxv_entry",
+    type="void",
+    predefault="default_print_auxv_entry",
+    invalid=False,
+    params=(
+        ("struct ui_file *", "file"),
+        ("CORE_ADDR", "type"),
+        ("CORE_ADDR", "val"),
+    ),
+)
+
+Method(
+    comment="""
+Find the address range of the current inferior's vsyscall/vDSO, and
+write it to *RANGE.  If the vsyscall's length can't be determined, a
+range with zero length is returned.  Returns true if the vsyscall is
+found, false otherwise.
+""",
+    name="vsyscall_range",
+    type="int",
+    predefault="default_vsyscall_range",
+    invalid=False,
+    params=(("struct mem_range *", "range"),),
+)
+
+Function(
+    comment="""
+Allocate SIZE bytes of PROT protected page aligned memory in inferior.
+PROT has GDB_MMAP_PROT_* bitmask format.
+Throw an error if it is not possible.  Returned address is always valid.
+""",
+    name="infcall_mmap",
+    type="CORE_ADDR",
+    predefault="default_infcall_mmap",
+    invalid=False,
+    params=(
+        ("CORE_ADDR", "size"),
+        ("unsigned", "prot"),
+    ),
+)
+
+Function(
+    comment="""
+Deallocate SIZE bytes of memory at ADDR in inferior from gdbarch_infcall_mmap.
+Print a warning if it is not possible.
+""",
+    name="infcall_munmap",
+    type="void",
+    predefault="default_infcall_munmap",
+    invalid=False,
+    params=(
+        ("CORE_ADDR", "addr"),
+        ("CORE_ADDR", "size"),
+    ),
+)
+
+Method(
+    comment="""
+Return string (caller has to use xfree for it) with options for GCC
+to produce code for this target, typically "-m64", "-m32" or "-m31".
+These options are put before CU's DW_AT_producer compilation options so that
+they can override it.
+""",
+    name="gcc_target_options",
+    type="std::string",
+    predefault="default_gcc_target_options",
+    invalid=False,
+    params=(),
+)
+
+Method(
+    comment="""
+Return a regular expression that matches names used by this
+architecture in GNU configury triplets.  The result is statically
+allocated and must not be freed.  The default implementation simply
+returns the BFD architecture name, which is correct in nearly every
+case.
+""",
+    name="gnu_triplet_regexp",
+    type="const char *",
+    predefault="default_gnu_triplet_regexp",
+    invalid=False,
+    params=(),
+)
+
+Method(
+    comment="""
+Return the size in 8-bit bytes of an addressable memory unit on this
+architecture.  This corresponds to the number of 8-bit bytes associated to
+each address in memory.
+""",
+    name="addressable_memory_unit_size",
+    type="int",
+    predefault="default_addressable_memory_unit_size",
+    invalid=False,
+    params=(),
+)
+
+Value(
+    comment="""
+Functions for allowing a target to modify its disassembler options.
+""",
+    name="disassembler_options_implicit",
+    type="const char *",
+    predefault="0",
+    invalid=False,
+    printer="pstring (gdbarch->disassembler_options_implicit)",
+)
+
+Value(
+    name="disassembler_options",
+    type="char **",
+    predefault="0",
+    invalid=False,
+    printer="pstring_ptr (gdbarch->disassembler_options)",
+)
+
+Value(
+    name="valid_disassembler_options",
+    type="const disasm_options_and_args_t *",
+    predefault="0",
+    invalid=False,
+    printer="host_address_to_string (gdbarch->valid_disassembler_options)",
+)
+
+Method(
+    comment="""
+Type alignment override method.  Return the architecture specific
+alignment required for TYPE.  If there is no special handling
+required for TYPE then return the value 0, GDB will then apply the
+default rules as laid out in gdbtypes.c:type_align.
+""",
+    name="type_align",
+    type="ULONGEST",
+    predefault="default_type_align",
+    invalid=False,
+    params=(("struct type *", "type"),),
+)
+
+Function(
+    comment="""
+Return a string containing any flags for the given PC in the given FRAME.
+""",
+    name="get_pc_address_flags",
+    type="std::string",
+    predefault="default_get_pc_address_flags",
+    invalid=False,
+    params=(
+        ("frame_info *", "frame"),
+        ("CORE_ADDR", "pc"),
+    ),
+)
+
+Method(
+    comment="""
+Read core file mappings
+""",
+    name="read_core_file_mappings",
+    type="void",
+    predefault="default_read_core_file_mappings",
+    invalid=False,
+    params=(
+        ("struct bfd *", "cbfd"),
+        ("read_core_file_mappings_pre_loop_ftype", "pre_loop_cb"),
+        ("read_core_file_mappings_loop_ftype", "loop_cb"),
+    ),
+)
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index a8bd6d5cfc0..eabdcc9582a 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -1715,3 +1715,74 @@ done
 exec 1>&2
 ../move-if-change new-gdbarch.c gdbarch.c
 rm -f new-gdbarch.c
+
+exec > gdbarch-components.py
+copyright | sed 1,3d | grep -v 'was created' |
+    sed -e 's,/\*,  ,' -e 's, *\*/,,' -e 's/^  /#/'
+
+function_list | while do_read
+do
+    printf "\n"
+    if class_is_info_p; then
+	printf Info
+    elif class_is_variable_p; then
+	printf Value
+    elif class_is_multiarch_p; then
+	printf Method
+    elif class_is_function_p; then
+	printf Function
+    else
+	echo FAILURE 1>&2
+	exit 1
+    fi
+    printf "(\n"
+    if [ -n "${comment}" ]
+    then
+	printf "    comment=\"\"\""
+	echo "${comment}" | sed 's/^# *//'
+	printf "\"\"\",\n"
+    fi
+
+    printf "    name=\"%s\",\n" "$function"
+    printf "    type=\"%s\",\n" "$returntype"
+    if class_is_predicate_p; then
+	printf "    predicate=True,\n"
+    fi
+    if ! class_is_info_p; then
+	if test -n "$predefault"; then
+	    printf "    predefault=\"%s\",\n" "$predefault"
+	fi
+	# We can ignore 'actual' and 'staticdefault'.
+	if test -n "$postdefault"; then
+	    printf "    postdefault=\"%s\",\n" "$postdefault"
+	fi
+	# Let's arrange for False to mean suppress checking, and True
+	# to mean default checking.
+	if test "$invalid_p" = "0"; then
+	    printf "    invalid=False,\n"
+	elif test "$invalid_p" = ""; then
+	    printf "    invalid=True,\n"
+	else
+	    printf "    invalid=\"%s\",\n" "$invalid_p"
+	fi
+	if class_is_function_p; then
+	    if test -n "$formal" && test "$formal" != void; then
+		printf "    params=(\n"
+		# Turn TYPE NAME into ("TYPE", "NAME").
+		echo "$formal" | sed -e "s/, */\n/g" |
+		    sed -e 's/ *\([a-zA-Z_][a-zA-Z0-9_]*\)$/", "\1"),/' |
+		    sed -e 's/^/        ("/'
+		printf "    ),\n"
+	    else
+		printf "    params=(),\n"
+	    fi
+	fi
+    fi
+    if test -n "$print"; then
+	printf "    printer=\"%s\",\n" "$print"
+    fi
+    printf ")\n"
+done
+
+exec 1>&2
+black gdbarch-components.py
-- 
2.31.1


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v2 6/8] Add new gdbarch generator
  2021-12-16 20:38 [PATCH v2 0/8] Rewrite gdbarch.sh in Python Tom Tromey
                   ` (4 preceding siblings ...)
  2021-12-16 20:38 ` [PATCH v2 5/8] Generate new gdbarch-components.py from gdbarch.sh Tom Tromey
@ 2021-12-16 20:38 ` Tom Tromey
  2021-12-17 18:33   ` Pedro Alves
  2021-12-16 20:38 ` [PATCH v2 7/8] Remove gdbarch.sh Tom Tromey
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Tom Tromey @ 2021-12-16 20:38 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

From: Simon Marchi <simon.marchi@efficios.com>

The new gdbarch generator is a Python program.  It reads the
"components.py" that was created in the previous patch, and generates
gdbarch.c and gdbarch-gen.h.

This was initially written by Simon, so I've put him as the author.
Thank you, Simon.

This is a relatively straightforward translation of the existing .sh
code.  It doesn't try very hard to be idiomatic Python or to be
especially smart.

It is, however, incredibly faster:

    $ time ./gdbarch.sh

    real	0m8.197s
    user	0m5.779s
    sys	0m3.384s

    $ time ./gdbarch.py

    real	0m0.065s
    user	0m0.053s
    sys	0m0.011s
---
 gdb/gdbarch.py | 526 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 526 insertions(+)
 create mode 100755 gdb/gdbarch.py

diff --git a/gdb/gdbarch.py b/gdb/gdbarch.py
new file mode 100755
index 00000000000..2099e6b0424
--- /dev/null
+++ b/gdb/gdbarch.py
@@ -0,0 +1,526 @@
+#!/usr/bin/env python3
+
+# Architecture commands for GDB, the GNU debugger.
+#
+# Copyright (C) 1998-2021 Free Software Foundation, Inc.
+#
+# This file is part of GDB.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+import textwrap
+
+# All the components created in gdbarch-components.py.
+components = []
+
+
+def join_type_and_name(t, n):
+    "Combine the type T and the name N into a C declaration."
+    if t.endswith("*") or t.endswith("&"):
+        return t + n
+    else:
+        return t + " " + n
+
+
+def join_params(params):
+    """Given a sequence of (TYPE, NAME) pairs, generate a comma-separated
+    list of declarations."""
+    params = [join_type_and_name(p[0], p[1]) for p in params]
+    return ", ".join(params)
+
+
+class _Component:
+    "Base class for all components."
+
+    def __init__(self, **kwargs):
+        for key in kwargs:
+            setattr(self, key, kwargs[key])
+        components.append(self)
+
+    def get_predicate(self):
+        "Return the expression used for validity checking."
+        assert self.predicate and not isinstance(self.invalid, str)
+        if self.predefault:
+            predicate = f"gdbarch->{self.name} != {self.predefault}"
+        elif isinstance(c, Value):
+            predicate = f"gdbarch->{self.name} != 0"
+        else:
+            predicate = f"gdbarch->{self.name} != NULL"
+        return predicate
+
+
+class Info(_Component):
+    "An Info component is copied from the gdbarch_info."
+
+    def __init__(self, *, name, type, printer=None):
+        super().__init__(name=name, type=type, printer=printer)
+        # This little hack makes the generator a bit simpler.
+        self.predicate = None
+
+
+class Value(_Component):
+    "A Value component is just a data member."
+
+    def __init__(
+        self,
+        *,
+        name,
+        type,
+        comment=None,
+        predicate=None,
+        predefault=None,
+        postdefault=None,
+        invalid=None,
+        printer=None,
+    ):
+        super().__init__(
+            comment=comment,
+            name=name,
+            type=type,
+            predicate=predicate,
+            predefault=predefault,
+            postdefault=postdefault,
+            invalid=invalid,
+            printer=printer,
+        )
+
+
+class Function(_Component):
+    "A Function component is a function pointer member."
+
+    def __init__(
+        self,
+        *,
+        name,
+        type,
+        params,
+        comment=None,
+        predicate=None,
+        predefault=None,
+        postdefault=None,
+        invalid=None,
+        printer=None,
+    ):
+        super().__init__(
+            comment=comment,
+            name=name,
+            type=type,
+            predicate=predicate,
+            predefault=predefault,
+            postdefault=postdefault,
+            invalid=invalid,
+            printer=printer,
+            params=params,
+        )
+
+    def ftype(self):
+        "Return the name of the function typedef to use."
+        return f"gdbarch_{self.name}_ftype"
+
+    def param_list(self):
+        "Return the formal parameter list as a string."
+        return join_params(self.params)
+
+    def set_list(self):
+        """Return the formal parameter list of the caller function,
+        as a string.  This list includes the gdbarch."""
+        arch_arg = ("struct gdbarch *", "gdbarch")
+        arch_tuple = (arch_arg,)
+        return join_params(arch_tuple + self.params)
+
+    def actuals(self):
+        "Return the actual parameters to forward, as a string."
+        return ", ".join([p[1] for p in self.params])
+
+
+class Method(Function):
+    "A Method is like a Function but passes the gdbarch through."
+
+    def param_list(self):
+        "See superclass."
+        return self.set_list()
+
+    def actuals(self):
+        "See superclass."
+        result = ["gdbarch"] + [p[1] for p in self.params]
+        return ", ".join(result)
+
+
+# Read the components.
+with open("gdbarch-components.py") as fd:
+    exec(fd.read())
+
+copyright = """/* *INDENT-OFF* */ /* THIS FILE IS GENERATED -*- buffer-read-only: t -*- */
+/* vi:set ro: */
+
+/* Dynamic architecture support for GDB, the GNU debugger.
+
+   Copyright (C) 1998-2021 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* This file was created with the aid of ``gdbarch.py''.  */
+"""
+
+
+def info(c):
+    "Filter function to only allow Info components."
+    return type(c) is Info
+
+
+def not_info(c):
+    "Filter function to omit Info components."
+    return type(c) is not Info
+
+
+with open("gdbarch-gen.h", "w") as f:
+    print(copyright, file=f)
+    print(file=f)
+    print(file=f)
+    print("/* The following are pre-initialized by GDBARCH.  */", file=f)
+
+    # Do Info components first.
+    for c in filter(info, components):
+        print(file=f)
+        print(
+            f"""extern {c.type} gdbarch_{c.name} (struct gdbarch *gdbarch);
+/* set_gdbarch_{c.name}() - not applicable - pre-initialized.  */""",
+            file=f,
+        )
+
+    print(file=f)
+    print(file=f)
+    print("/* The following are initialized by the target dependent code.  */", file=f)
+
+    # Generate decls for accessors, setters, and predicates for all
+    # non-Info components.
+    for c in filter(not_info, components):
+        if c.comment:
+            print(file=f)
+            comment = c.comment.split("\n")
+            if comment[0] == "":
+                comment = comment[1:]
+            if comment[-1] == "":
+                comment = comment[:-1]
+            print("/* ", file=f, end="")
+            print(comment[0], file=f, end="")
+            if len(comment) > 1:
+                print(file=f)
+                print(
+                    textwrap.indent("\n".join(comment[1:]), prefix="   "),
+                    end="",
+                    file=f,
+                )
+            print(" */", file=f)
+
+        if c.predicate:
+            print(file=f)
+            print(f"extern bool gdbarch_{c.name}_p (struct gdbarch *gdbarch);", file=f)
+
+        print(file=f)
+        if isinstance(c, Value):
+            print(
+                f"extern {c.type} gdbarch_{c.name} (struct gdbarch *gdbarch);",
+                file=f,
+            )
+            print(
+                f"extern void set_gdbarch_{c.name} (struct gdbarch *gdbarch, {c.type} {c.name});",
+                file=f,
+            )
+        else:
+            assert isinstance(c, Function)
+            print(
+                f"typedef {c.type} ({c.ftype()}) ({c.param_list()});",
+                file=f,
+            )
+            print(
+                f"extern {c.type} gdbarch_{c.name} ({c.set_list()});",
+                file=f,
+            )
+            print(
+                f"extern void set_gdbarch_{c.name} (struct gdbarch *gdbarch, {c.ftype()} *{c.name});",
+                file=f,
+            )
+
+with open("gdbarch.c", "w") as f:
+    print(copyright, file=f)
+    print(file=f)
+    print("/* Maintain the struct gdbarch object.  */", file=f)
+    print(file=f)
+    #
+    # The struct definition body.
+    #
+    print("struct gdbarch", file=f)
+    print("{", file=f)
+    print("  /* Has this architecture been fully initialized?  */", file=f)
+    print("  int initialized_p;", file=f)
+    print(file=f)
+    print("  /* An obstack bound to the lifetime of the architecture.  */", file=f)
+    print("  struct obstack *obstack;", file=f)
+    print(file=f)
+    print("  /* basic architectural information.  */", file=f)
+    for c in filter(info, components):
+        print(f"  {c.type} {c.name};", file=f)
+    print(file=f)
+    print("  /* target specific vector.  */", file=f)
+    print("  struct gdbarch_tdep *tdep;", file=f)
+    print("  gdbarch_dump_tdep_ftype *dump_tdep;", file=f)
+    print(file=f)
+    print("  /* per-architecture data-pointers.  */", file=f)
+    print("  unsigned nr_data;", file=f)
+    print("  void **data;", file=f)
+    print(file=f)
+    for c in filter(not_info, components):
+        if isinstance(c, Value):
+            print(f"  {c.type} {c.name};", file=f)
+        else:
+            assert isinstance(c, Function)
+            print(f"  gdbarch_{c.name}_ftype *{c.name};", file=f)
+    print("};", file=f)
+    print(file=f)
+    #
+    # Initialization.
+    #
+    print("/* Create a new ``struct gdbarch'' based on information provided by", file=f)
+    print("   ``struct gdbarch_info''.  */", file=f)
+    print(file=f)
+    print("struct gdbarch *", file=f)
+    print("gdbarch_alloc (const struct gdbarch_info *info,", file=f)
+    print("	       struct gdbarch_tdep *tdep)", file=f)
+    print("{", file=f)
+    print("  struct gdbarch *gdbarch;", file=f)
+    print("", file=f)
+    print(
+        "  /* Create an obstack for allocating all the per-architecture memory,", file=f
+    )
+    print("     then use that to allocate the architecture vector.  */", file=f)
+    print("  struct obstack *obstack = XNEW (struct obstack);", file=f)
+    print("  obstack_init (obstack);", file=f)
+    print("  gdbarch = XOBNEW (obstack, struct gdbarch);", file=f)
+    print("  memset (gdbarch, 0, sizeof (*gdbarch));", file=f)
+    print("  gdbarch->obstack = obstack;", file=f)
+    print(file=f)
+    print("  alloc_gdbarch_data (gdbarch);", file=f)
+    print(file=f)
+    print("  gdbarch->tdep = tdep;", file=f)
+    print(file=f)
+    for c in filter(info, components):
+        print(f"  gdbarch->{c.name} = info->{c.name};", file=f)
+    print(file=f)
+    print("  /* Force the explicit initialization of these.  */", file=f)
+    for c in filter(not_info, components):
+        if c.predefault and c.predefault != "0":
+            print(f"  gdbarch->{c.name} = {c.predefault};", file=f)
+    print("  /* gdbarch_alloc() */", file=f)
+    print(file=f)
+    print("  return gdbarch;", file=f)
+    print("}", file=f)
+    print(file=f)
+    print(file=f)
+    print(file=f)
+    #
+    # Post-initialization validation and updating
+    #
+    print("/* Ensure that all values in a GDBARCH are reasonable.  */", file=f)
+    print(file=f)
+    print("static void", file=f)
+    print("verify_gdbarch (struct gdbarch *gdbarch)", file=f)
+    print("{", file=f)
+    print("  string_file log;", file=f)
+    print(file=f)
+    print("  /* fundamental */", file=f)
+    print("  if (gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)", file=f)
+    print("""    log.puts ("\\n\\tbyte-order");""", file=f)
+    print("  if (gdbarch->bfd_arch_info == NULL)", file=f)
+    print("""    log.puts ("\\n\\tbfd_arch_info");""", file=f)
+    print(
+        "  /* Check those that need to be defined for the given multi-arch level.  */",
+        file=f,
+    )
+    for c in filter(not_info, components):
+        if c.invalid is False:
+            print(f"  /* Skip verify of {c.name}, invalid_p == 0 */", file=f)
+        elif c.predicate:
+            print(f"  /* Skip verify of {c.name}, has predicate.  */", file=f)
+        elif isinstance(c.invalid, str) and c.postdefault is not None:
+            print(f"  if ({c.invalid})", file=f)
+            print(f"    gdbarch->{c.name} = {c.postdefault};", file=f)
+        elif c.predefault is not None and c.postdefault is not None:
+            print(f"  if (gdbarch->{c.name} == {c.predefault})", file=f)
+            print(f"    gdbarch->{c.name} = {c.postdefault};", file=f)
+        elif c.postdefault is not None:
+            print(f"  if (gdbarch->{c.name} == 0)", file=f)
+            print(f"    gdbarch->{c.name} = {c.postdefault};", file=f)
+        elif isinstance(c.invalid, str):
+            print(f"  if ({c.invalid})", file=f)
+            print(f"""    log.puts ("\\n\\t{c.name}");""", file=f)
+        elif c.predefault is not None:
+            print(f"  if (gdbarch->{c.name} == {c.predefault})", file=f)
+            print(f"""    log.puts ("\\n\\t{c.name}");""", file=f)
+    print("  if (!log.empty ())", file=f)
+    print("    internal_error (__FILE__, __LINE__,", file=f)
+    print("""		    _("verify_gdbarch: the following are invalid ...%s"),""", file=f)
+    print("		    log.c_str ());", file=f)
+    print("}", file=f)
+    print(file=f)
+    print(file=f)
+    #
+    # Dumping.
+    #
+    print("/* Print out the details of the current architecture.  */", file=f)
+    print(file=f)
+    print("void", file=f)
+    print("gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)", file=f)
+    print("{", file=f)
+    print("""  const char *gdb_nm_file = "<not-defined>";""", file=f)
+    print(file=f)
+    print("#if defined (GDB_NM_FILE)", file=f)
+    print("  gdb_nm_file = GDB_NM_FILE;", file=f)
+    print("#endif", file=f)
+    print("  fprintf_unfiltered (file,", file=f)
+    print("""		      "gdbarch_dump: GDB_NM_FILE = %s\\n",""", file=f)
+    print("		      gdb_nm_file);", file=f)
+    for c in components:
+        if c.predicate:
+            print("  fprintf_unfiltered (file,", file=f)
+            print(
+                f"""                      "gdbarch_dump: gdbarch_{c.name}_p() = %d\\n",""",
+                file=f,
+            )
+            print(f"                      gdbarch_{c.name}_p (gdbarch));", file=f)
+        if isinstance(c, Function):
+            print("  fprintf_unfiltered (file,", file=f)
+            print(
+                f"""                      "gdbarch_dump: {c.name} = <%s>\\n",""", file=f
+            )
+            print(
+                f"                      host_address_to_string (gdbarch->{c.name}));",
+                file=f,
+            )
+        else:
+            if c.printer:
+                printer = c.printer
+            elif c.type == "CORE_ADDR":
+                printer = f"core_addr_to_string_nz (gdbarch->{c.name})"
+            else:
+                printer = f"plongest (gdbarch->{c.name})"
+            print("  fprintf_unfiltered (file,", file=f)
+            print(
+                f"""                      "gdbarch_dump: {c.name} = %s\\n",""", file=f
+            )
+            print(f"                      {printer});", file=f)
+    print("  if (gdbarch->dump_tdep != NULL)", file=f)
+    print("    gdbarch->dump_tdep (gdbarch, file);", file=f)
+    print("}", file=f)
+    print(file=f)
+    #
+    # Bodies of setter, accessor, and predicate functions.
+    #
+    for c in components:
+        if c.predicate:
+            print(file=f)
+            print("bool", file=f)
+            print(f"gdbarch_{c.name}_p (struct gdbarch *gdbarch)", file=f)
+            print("{", file=f)
+            print("  gdb_assert (gdbarch != NULL);", file=f)
+            print(f"  return {c.get_predicate()};", file=f)
+            print("}", file=f)
+        if isinstance(c, Function):
+            print(file=f)
+            print(f"{c.type}", file=f)
+            print(f"gdbarch_{c.name} ({c.set_list()})", file=f)
+            print("{", file=f)
+            print("  gdb_assert (gdbarch != NULL);", file=f)
+            print(f"  gdb_assert (gdbarch->{c.name} != NULL);", file=f)
+            if c.predicate and c.predefault:
+                # Allow a call to a function with a predicate.
+                print(
+                    f"  /* Do not check predicate: {c.get_predicate()}, allow call.  */",
+                    file=f,
+                )
+            print("  if (gdbarch_debug >= 2)", file=f)
+            print(
+                f"""    fprintf_unfiltered (gdb_stdlog, "gdbarch_{c.name} called\\n");""",
+                file=f,
+            )
+            print("  ", file=f, end="")
+            if c.type != "void":
+                print("return ", file=f, end="")
+            print(f"gdbarch->{c.name} ({c.actuals()});", file=f)
+            print("}", file=f)
+            print(file=f)
+            print("void", file=f)
+            print(f"set_gdbarch_{c.name} (struct gdbarch *gdbarch,", file=f)
+            print(
+                f"            {' ' * len(c.name)}  gdbarch_{c.name}_ftype {c.name})",
+                file=f,
+            )
+            print("{", file=f)
+            print(f"  gdbarch->{c.name} = {c.name};", file=f)
+            print("}", file=f)
+        elif isinstance(c, Value):
+            print(file=f)
+            print(f"{c.type}", file=f)
+            print(f"gdbarch_{c.name} (struct gdbarch *gdbarch)", file=f)
+            print("{", file=f)
+            print("  gdb_assert (gdbarch != NULL);", file=f)
+            if c.invalid is False:
+                print(f"  /* Skip verify of {c.name}, invalid_p == 0 */", file=f)
+            elif isinstance(c.invalid, str):
+                print("  /* Check variable is valid.  */", file=f)
+                print(f"  gdb_assert (!({c.invalid}));", file=f)
+            elif c.predefault:
+                print("  /* Check variable changed from pre-default.  */", file=f)
+                print(f"  gdb_assert (gdbarch->{c.name} != {c.predefault});", file=f)
+            print("  if (gdbarch_debug >= 2)", file=f)
+            print(
+                f"""    fprintf_unfiltered (gdb_stdlog, "gdbarch_{c.name} called\\n");""",
+                file=f,
+            )
+            print(f"  return gdbarch->{c.name};", file=f)
+            print("}", file=f)
+            print(file=f)
+            print("void", file=f)
+            print(f"set_gdbarch_{c.name} (struct gdbarch *gdbarch,", file=f)
+            print(f"            {' ' * len(c.name)}  {c.type} {c.name})", file=f)
+            print("{", file=f)
+            print(f"  gdbarch->{c.name} = {c.name};", file=f)
+            print("}", file=f)
+        else:
+            assert isinstance(c, Info)
+            print(file=f)
+            print(f"{c.type}", file=f)
+            print(f"gdbarch_{c.name} (struct gdbarch *gdbarch)", file=f)
+            print("{", file=f)
+            print("  gdb_assert (gdbarch != NULL);", file=f)
+            print("  if (gdbarch_debug >= 2)", file=f)
+            print(
+                f"""    fprintf_unfiltered (gdb_stdlog, "gdbarch_{c.name} called\\n");""",
+                file=f,
+            )
+            print(f"  return gdbarch->{c.name};", file=f)
+            print("}", file=f)
-- 
2.31.1


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v2 7/8] Remove gdbarch.sh
  2021-12-16 20:38 [PATCH v2 0/8] Rewrite gdbarch.sh in Python Tom Tromey
                   ` (5 preceding siblings ...)
  2021-12-16 20:38 ` [PATCH v2 6/8] Add new gdbarch generator Tom Tromey
@ 2021-12-16 20:38 ` Tom Tromey
  2021-12-16 20:38 ` [PATCH v2 8/8] Document gdbarch-components.py Tom Tromey
  2021-12-17  5:29 ` [PATCH v2 0/8] Rewrite gdbarch.sh in Python Simon Marchi
  8 siblings, 0 replies; 21+ messages in thread
From: Tom Tromey @ 2021-12-16 20:38 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This patch runs gdbarch.py and removes gdbarch.sh.
---
 gdb/gdbarch-gen.h |  128 ++--
 gdb/gdbarch.c     |   27 +-
 gdb/gdbarch.sh    | 1788 ---------------------------------------------
 3 files changed, 66 insertions(+), 1877 deletions(-)
 delete mode 100755 gdb/gdbarch.sh

diff --git a/gdb/gdbarch-gen.h b/gdb/gdbarch-gen.h
index 3edf9708d06..7d4b83ad12a 100644
--- a/gdb/gdbarch-gen.h
+++ b/gdb/gdbarch-gen.h
@@ -20,7 +20,7 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-/* This file was created with the aid of ``gdbarch.sh''.  */
+/* This file was created with the aid of ``gdbarch.py''.  */
 
 
 
@@ -124,11 +124,11 @@ extern void set_gdbarch_floatformat_for_type (struct gdbarch *gdbarch, gdbarch_f
    address in GDB have the same size and "look the same".  For such a
    target, you need only set gdbarch_ptr_bit and gdbarch_addr_bit
    / addr_bit will be set from it.
-  
+
    If gdbarch_ptr_bit and gdbarch_addr_bit are different, you'll probably
    also need to set gdbarch_dwarf2_addr_size, gdbarch_pointer_to_address and
    gdbarch_address_to_pointer as well.
-  
+
    ptr_bit is the size of a pointer on the target */
 
 extern int gdbarch_ptr_bit (struct gdbarch *gdbarch);
@@ -145,10 +145,10 @@ extern void set_gdbarch_addr_bit (struct gdbarch *gdbarch, int addr_bit);
    DWARF2_ADDR_SIZE as defined by the target specific GCC back-end.
    Unfortunately there is no good way to determine this value.  Therefore
    dwarf2_addr_size simply defaults to the target pointer size.
-  
+
    dwarf2_addr_size is not used for .eh_frame FDEs, which are generally
    defined using the target's pointer size so far.
-  
+
    Note that dwarf2_addr_size only needs to be redefined by a target if the
    GCC back-end defines a DWARF2_ADDR_SIZE other than the target pointer size,
    and if Dwarf versions < 4 need to be supported. */
@@ -371,7 +371,7 @@ extern void set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, gdbarch_
 
 /* Determine the address where a longjmp will land and save this address
    in PC.  Return nonzero on success.
-  
+
    FRAME corresponds to the longjmp frame. */
 
 extern bool gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch);
@@ -421,9 +421,9 @@ extern void set_gdbarch_integer_to_address (struct gdbarch *gdbarch, gdbarch_int
 /* Return the return-value convention that will be used by FUNCTION
    to return a value of type VALTYPE.  FUNCTION may be NULL in which
    case the return convention is computed based only on VALTYPE.
-  
+
    If READBUF is not NULL, extract the return value and save it in this buffer.
-  
+
    If WRITEBUF is not NULL, it contains a return value which will be
    stored into the appropriate register.  This can be used when we want
    to force the value returned by a function (see the "return" command
@@ -663,10 +663,10 @@ extern void set_gdbarch_memtag_granule_size (struct gdbarch *gdbarch, CORE_ADDR
 /* FIXME/cagney/2001-01-18: This should be split in two.  A target method that
    indicates if the target needs software single step.  An ISA method to
    implement it.
-  
+
    FIXME/cagney/2001-01-18: The logic is backwards.  It should be asking if the
    target can single step.  If not, then implement single step using breakpoints.
-  
+
    Return a vector of addresses on which the software single step
    breakpoints should be inserted.  NULL means software single step is
    not used.
@@ -956,24 +956,24 @@ extern void set_gdbarch_max_insn_length (struct gdbarch *gdbarch, ULONGEST max_i
 
 /* Copy the instruction at FROM to TO, and make any adjustments
    necessary to single-step it at that address.
-  
+
    REGS holds the state the thread's registers will have before
    executing the copied instruction; the PC in REGS will refer to FROM,
    not the copy at TO.  The caller should update it to point at TO later.
-  
+
    Return a pointer to data of the architecture's choice to be passed
    to gdbarch_displaced_step_fixup.
-  
+
    For a general explanation of displaced stepping and how GDB uses it,
    see the comments in infrun.c.
-  
+
    The TO area is only guaranteed to have space for
    gdbarch_max_insn_length (arch) bytes, so this function must not
    write more bytes than that to that area.
-  
+
    If you do not provide this function, GDB assumes that the
    architecture does not support displaced stepping.
-  
+
    If the instruction cannot execute out of line, return NULL.  The
    core falls back to stepping past the instruction in-line instead in
    that case. */
@@ -989,7 +989,7 @@ extern void set_gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch, gdbar
    displaced instruction location, and it is up to the target to ensure GDB will
    receive control again (e.g. by placing a software breakpoint instruction into
    the displaced instruction buffer).
-  
+
    The default implementation returns false on all targets that provide a
    gdbarch_software_single_step routine, and true otherwise. */
 
@@ -1000,17 +1000,17 @@ extern void set_gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, g
 /* Fix up the state resulting from successfully single-stepping a
    displaced instruction, to give the result we would have gotten from
    stepping the instruction in its original location.
-  
+
    REGS is the register state resulting from single-stepping the
    displaced instruction.
-  
+
    CLOSURE is the result from the matching call to
    gdbarch_displaced_step_copy_insn.
-  
+
    If you provide gdbarch_displaced_step_copy_insn.but not this
    function, then GDB assumes that no fixup is needed after
    single-stepping the instruction.
-  
+
    For a general explanation of displaced stepping and how GDB uses it,
    see the comments in infrun.c. */
 
@@ -1021,7 +1021,7 @@ extern void gdbarch_displaced_step_fixup (struct gdbarch *gdbarch, struct displa
 extern void set_gdbarch_displaced_step_fixup (struct gdbarch *gdbarch, gdbarch_displaced_step_fixup_ftype *displaced_step_fixup);
 
 /* Prepare THREAD for it to displaced step the instruction at its current PC.
-  
+
    Throw an exception if any unexpected error happens. */
 
 extern bool gdbarch_displaced_step_prepare_p (struct gdbarch *gdbarch);
@@ -1137,7 +1137,7 @@ extern int gdbarch_gdb_signal_to_target (struct gdbarch *gdbarch, enum gdb_signa
 extern void set_gdbarch_gdb_signal_to_target (struct gdbarch *gdbarch, gdbarch_gdb_signal_to_target_ftype *gdb_signal_to_target);
 
 /* Extra signal info inspection.
-  
+
    Return a type suitable to inspect extra signal information. */
 
 extern bool gdbarch_get_siginfo_type_p (struct gdbarch *gdbarch);
@@ -1177,9 +1177,9 @@ extern void set_gdbarch_syscalls_info (struct gdbarch *gdbarch, struct syscalls_
    A NULL-terminated array of prefixes used to mark an integer constant
    on the architecture's assembly.
    For example, on x86 integer constants are written as:
-  
-    $10 ;; integer constant 10
-  
+
+   $10 ;; integer constant 10
+
    in this case, this prefix would be the character `$'. */
 
 extern const char *const * gdbarch_stap_integer_prefixes (struct gdbarch *gdbarch);
@@ -1194,9 +1194,9 @@ extern void set_gdbarch_stap_integer_suffixes (struct gdbarch *gdbarch, const ch
 /* A NULL-terminated array of prefixes used to mark a register name on
    the architecture's assembly.
    For example, on x86 the register name is written as:
-  
-    %eax ;; register eax
-  
+
+   %eax ;; register eax
+
    in this case, this prefix would be the character `%'. */
 
 extern const char *const * gdbarch_stap_register_prefixes (struct gdbarch *gdbarch);
@@ -1211,11 +1211,11 @@ extern void set_gdbarch_stap_register_suffixes (struct gdbarch *gdbarch, const c
 /* A NULL-terminated array of prefixes used to mark a register
    indirection on the architecture's assembly.
    For example, on x86 the register indirection is written as:
-  
-    (%eax) ;; indirecting eax
-  
+
+   (%eax) ;; indirecting eax
+
    in this case, this prefix would be the charater `('.
-  
+
    Please note that we use the indirection prefix also for register
    displacement, e.g., `4(%eax)' on x86. */
 
@@ -1225,11 +1225,11 @@ extern void set_gdbarch_stap_register_indirection_prefixes (struct gdbarch *gdba
 /* A NULL-terminated array of suffixes used to mark a register
    indirection on the architecture's assembly.
    For example, on x86 the register indirection is written as:
-  
-    (%eax) ;; indirecting eax
-  
+
+   (%eax) ;; indirecting eax
+
    in this case, this prefix would be the charater `)'.
-  
+
    Please note that we use the indirection suffix also for register
    displacement, e.g., `4(%eax)' on x86. */
 
@@ -1237,7 +1237,7 @@ extern const char *const * gdbarch_stap_register_indirection_suffixes (struct gd
 extern void set_gdbarch_stap_register_indirection_suffixes (struct gdbarch *gdbarch, const char *const * stap_register_indirection_suffixes);
 
 /* Prefix(es) used to name a register using GDB's nomenclature.
-  
+
    For example, on PPC a register is represented by a number in the assembly
    language (e.g., `10' is the 10th general-purpose register).  However,
    inside GDB this same register has an `r' appended to its name, so the 10th
@@ -1252,13 +1252,13 @@ extern const char * gdbarch_stap_gdb_register_suffix (struct gdbarch *gdbarch);
 extern void set_gdbarch_stap_gdb_register_suffix (struct gdbarch *gdbarch, const char * stap_gdb_register_suffix);
 
 /* Check if S is a single operand.
-  
+
    Single operands can be:
-    - Literal integers, e.g. `$10' on x86
-    - Register access, e.g. `%eax' on x86
-    - Register indirection, e.g. `(%eax)' on x86
-    - Register displacement, e.g. `4(%eax)' on x86
-  
+   - Literal integers, e.g. `$10' on x86
+   - Register access, e.g. `%eax' on x86
+   - Register indirection, e.g. `(%eax)' on x86
+   - Register displacement, e.g. `4(%eax)' on x86
+
    This function should check for these patterns on the string
    and return 1 if some were found, or zero otherwise.  Please try to match
    as much info as you can from the string, i.e., if you have to match
@@ -1271,20 +1271,20 @@ extern int gdbarch_stap_is_single_operand (struct gdbarch *gdbarch, const char *
 extern void set_gdbarch_stap_is_single_operand (struct gdbarch *gdbarch, gdbarch_stap_is_single_operand_ftype *stap_is_single_operand);
 
 /* Function used to handle a "special case" in the parser.
-  
+
    A "special case" is considered to be an unknown token, i.e., a token
    that the parser does not know how to parse.  A good example of special
    case would be ARM's register displacement syntax:
-  
-    [R0, #4]  ;; displacing R0 by 4
-  
+
+   [R0, #4]  ;; displacing R0 by 4
+
    Since the parser assumes that a register displacement is of the form:
-  
-    <number> <indirection_prefix> <register_name> <indirection_suffix>
-  
+
+   <number> <indirection_prefix> <register_name> <indirection_suffix>
+
    it means that it will not be able to recognize and parse this odd syntax.
    Therefore, we should add a special case function that will handle this token.
-  
+
    This function should generate the proper expression form of the expression
    using GDB's internal expression mechanism (e.g., `write_exp_elt_opcode'
    and so on).  It should also return 1 if the parsing was successful, or zero
@@ -1299,7 +1299,7 @@ extern expr::operation_up gdbarch_stap_parse_special_token (struct gdbarch *gdba
 extern void set_gdbarch_stap_parse_special_token (struct gdbarch *gdbarch, gdbarch_stap_parse_special_token_ftype *stap_parse_special_token);
 
 /* Perform arch-dependent adjustments to a register name.
-  
+
    In very specific situations, it may be necessary for the register
    name present in a SystemTap probe's argument to be handled in a
    special way.  For example, on i386, GCC may over-optimize the
@@ -1307,19 +1307,19 @@ extern void set_gdbarch_stap_parse_special_token (struct gdbarch *gdbarch, gdbar
    such cases, the client that is reading and evaluating the SystemTap
    probe (ourselves) will need to actually fetch values from the wider
    version of the register in question.
-  
+
    To illustrate the example, consider the following probe argument
    (i386):
-  
-      4@%ax
-  
+
+   4@%ax
+
    This argument says that its value can be found at the %ax register,
    which is a 16-bit register.  However, the argument's prefix says
    that its type is "uint32_t", which is 32-bit in size.  Therefore, in
    this case, GDB should actually fetch the probe's value from register
    %eax, not %ax.  In this scenario, this function would actually
    replace the register name from %ax to %eax.
-  
+
    The rationale for this can be found at PR breakpoints/24541. */
 
 extern bool gdbarch_stap_adjust_register_p (struct gdbarch *gdbarch);
@@ -1403,19 +1403,19 @@ extern void set_gdbarch_guess_tracepoint_registers (struct gdbarch *gdbarch, gdb
 
 /* Return the "auto" target charset. */
 
-typedef const char * (gdbarch_auto_charset_ftype) (void);
+typedef const char * (gdbarch_auto_charset_ftype) ();
 extern const char * gdbarch_auto_charset (struct gdbarch *gdbarch);
 extern void set_gdbarch_auto_charset (struct gdbarch *gdbarch, gdbarch_auto_charset_ftype *auto_charset);
 
 /* Return the "auto" target wide charset. */
 
-typedef const char * (gdbarch_auto_wide_charset_ftype) (void);
+typedef const char * (gdbarch_auto_wide_charset_ftype) ();
 extern const char * gdbarch_auto_wide_charset (struct gdbarch *gdbarch);
 extern void set_gdbarch_auto_wide_charset (struct gdbarch *gdbarch, gdbarch_auto_wide_charset_ftype *auto_wide_charset);
 
 /* If non-empty, this is a file extension that will be opened in place
    of the file extension reported by the shared library list.
-  
+
    This is most useful for toolchains that use a post-linker tool,
    where the names of the files run on the target differ in extension
    compared to the names of the files GDB should load for debug info. */
@@ -1460,15 +1460,15 @@ extern void set_gdbarch_core_info_proc (struct gdbarch *gdbarch, gdbarch_core_in
 
 /* Iterate over all objfiles in the order that makes the most sense
    for the architecture to make global symbol searches.
-  
+
    CB is a callback function where OBJFILE is the objfile to be searched,
    and CB_DATA a pointer to user-defined data (the same data that is passed
    when calling this gdbarch method).  The iteration stops if this function
    returns nonzero.
-  
+
    CB_DATA is a pointer to some user-defined data to be passed to
    the callback.
-  
+
    If not NULL, CURRENT_OBJFILE corresponds to the objfile being
    inspected when the symbol search was requested. */
 
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 3f96abe36bb..5575ba2a1a1 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -20,7 +20,7 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-/* This file was created with the aid of ``gdbarch.sh''.  */
+/* This file was created with the aid of ``gdbarch.py''.  */
 
 
 /* Maintain the struct gdbarch object.  */
@@ -48,29 +48,6 @@ struct gdbarch
   unsigned nr_data;
   void **data;
 
-  /* Multi-arch values.
-
-     When extending this structure you must:
-
-     Add the field below.
-
-     Declare set/get functions and define the corresponding
-     macro in gdbarch.h.
-
-     gdbarch_alloc(): If zero/NULL is not a suitable default,
-     initialize the new field.
-
-     verify_gdbarch(): Confirm that the target updated the field
-     correctly.
-
-     gdbarch_dump(): Add a fprintf_unfiltered call so that the new
-     field is dumped out
-
-     get_gdbarch(): Implement the set/get functions (probably using
-     the macro's as shortcuts).
-
-     */
-
   int short_bit;
   int int_bit;
   int long_bit;
@@ -3876,7 +3853,7 @@ gdbarch_core_xfer_siginfo (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST
   gdb_assert (gdbarch->core_xfer_siginfo != NULL);
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_core_xfer_siginfo called\n");
-  return gdbarch->core_xfer_siginfo (gdbarch,  readbuf, offset, len);
+  return gdbarch->core_xfer_siginfo (gdbarch, readbuf, offset, len);
 }
 
 void
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
deleted file mode 100755
index eabdcc9582a..00000000000
--- a/gdb/gdbarch.sh
+++ /dev/null
@@ -1,1788 +0,0 @@
-#!/bin/sh -u
-
-# Architecture commands for GDB, the GNU debugger.
-#
-# Copyright (C) 1998-2021 Free Software Foundation, Inc.
-#
-# This file is part of GDB.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Make certain that the script is not running in an internationalized
-# environment.
-LANG=C ; export LANG
-LC_ALL=C ; export LC_ALL
-
-# Format of the input table
-read="class returntype function formal actual staticdefault predefault postdefault invalid_p print garbage_at_eol"
-
-do_read ()
-{
-    comment=""
-    class=""
-    # On some SH's, 'read' trims leading and trailing whitespace by
-    # default (e.g., bash), while on others (e.g., dash), it doesn't.
-    # Set IFS to empty to disable the trimming everywhere.
-    # shellcheck disable=SC2162
-    while IFS='' read line
-    do
-	if test "${line}" = ""
-	then
-	    continue
-	elif test "${line}" = "#" -a "${comment}" = ""
-	then
-	    continue
-	elif expr "${line}" : "#" > /dev/null
-	then
-	    comment="${comment}
-${line}"
-	else
-
-	    # The semantics of IFS varies between different SH's.  Some
-	    # treat ``;;' as three fields while some treat it as just two.
-	    # Work around this by eliminating ``;;'' ....
-	    line="$(echo "${line}" | sed -e 's/;;/; ;/g' -e 's/;;/; ;/g')"
-
-	    OFS="${IFS}" ; IFS="[;]"
-	    eval read "${read}" <<EOF
-${line}
-EOF
-	    IFS="${OFS}"
-
-	    if test -n "${garbage_at_eol:-}"
-	    then
-		echo "Garbage at end-of-line in ${line}" 1>&2
-		kill $$
-		exit 1
-	    fi
-
-	    # .... and then going back through each field and strip out those
-	    # that ended up with just that space character.
-	    for r in ${read}
-	    do
-		if eval test "\"\${${r}}\" = ' '"
-		then
-		    eval "${r}="
-		fi
-	    done
-
-	    case "${class}" in
-		m ) staticdefault="${predefault:-}" ;;
-		M ) staticdefault="0" ;;
-		* ) test "${staticdefault}" || staticdefault=0 ;;
-	    esac
-
-	    case "${class}" in
-	    F | V | M )
-		case "${invalid_p:-}" in
-		"" )
-		    if test -n "${predefault}"
-		    then
-			#invalid_p="gdbarch->${function} == ${predefault}"
-			predicate="gdbarch->${function:-} != ${predefault}"
-		    elif class_is_variable_p
-		    then
-			predicate="gdbarch->${function} != 0"
-		    elif class_is_function_p
-		    then
-			predicate="gdbarch->${function} != NULL"
-		    fi
-		    ;;
-		* )
-		    echo "Predicate function ${function} with invalid_p." 1>&2
-		    kill $$
-		    exit 1
-		    ;;
-		esac
-	    esac
-
-	    #NOT YET: See gdbarch.log for basic verification of
-	    # database
-
-	    break
-	fi
-    done
-    if [ -n "${class}" ]
-    then
-	true
-    else
-	false
-    fi
-}
-
-
-fallback_default_p ()
-{
-    { [ -n "${postdefault:-}" ] && [ "x${invalid_p}" != "x0" ]; } \
-	|| { [ -n "${predefault}" ] && [ "x${invalid_p}" = "x0" ]; }
-}
-
-class_is_variable_p ()
-{
-    case "${class}" in
-	*v* | *V* ) true ;;
-	* ) false ;;
-    esac
-}
-
-class_is_function_p ()
-{
-    case "${class}" in
-	*f* | *F* | *m* | *M* ) true ;;
-	* ) false ;;
-    esac
-}
-
-class_is_multiarch_p ()
-{
-    case "${class}" in
-	*m* | *M* ) true ;;
-	* ) false ;;
-    esac
-}
-
-class_is_predicate_p ()
-{
-    case "${class}" in
-	*F* | *V* | *M* ) true ;;
-	* ) false ;;
-    esac
-}
-
-class_is_info_p ()
-{
-    case "${class}" in
-	*i* ) true ;;
-	* ) false ;;
-    esac
-}
-
-
-# dump out/verify the doco
-for field in ${read}
-do
-  case ${field} in
-
-    class ) : ;;
-
-	# # -> line disable
-	# f -> function
-	#   hiding a function
-	# F -> function + predicate
-	#   hiding a function + predicate to test function validity
-	# v -> variable
-	#   hiding a variable
-	# V -> variable + predicate
-	#   hiding a variable + predicate to test variables validity
-	# i -> set from info
-	#   hiding something from the ``struct info'' object
-	# m -> multi-arch function
-	#   hiding a multi-arch function (parameterised with the architecture)
-	# M -> multi-arch function + predicate
-	#   hiding a multi-arch function + predicate to test function validity
-
-    returntype ) : ;;
-
-	# For functions, the return type; for variables, the data type
-
-    function ) : ;;
-
-	# For functions, the member function name; for variables, the
-	# variable name.  Member function names are always prefixed with
-	# ``gdbarch_'' for name-space purity.
-
-    formal ) : ;;
-
-	# The formal argument list.  It is assumed that the formal
-	# argument list includes the actual name of each list element.
-	# A function with no arguments shall have ``void'' as the
-	# formal argument list.
-
-    actual ) : ;;
-
-	# The list of actual arguments.  The arguments specified shall
-	# match the FORMAL list given above.  Functions with out
-	# arguments leave this blank.
-
-    staticdefault ) : ;;
-
-	# To help with the GDB startup a static gdbarch object is
-	# created.  STATICDEFAULT is the value to insert into that
-	# static gdbarch object.  Since this a static object only
-	# simple expressions can be used.
-
-	# If STATICDEFAULT is empty, zero is used.
-
-    predefault ) : ;;
-
-	# An initial value to assign to MEMBER of the freshly
-	# malloc()ed gdbarch object.  After initialization, the
-	# freshly malloc()ed object is passed to the target
-	# architecture code for further updates.
-
-	# If PREDEFAULT is empty, zero is used.
-
-	# A non-empty PREDEFAULT, an empty POSTDEFAULT and a zero
-	# INVALID_P are specified, PREDEFAULT will be used as the
-	# default for the non- multi-arch target.
-
-	# A zero PREDEFAULT function will force the fallback to call
-	# internal_error().
-
-	# Variable declarations can refer to ``gdbarch'' which will
-	# contain the current architecture.  Care should be taken.
-
-    postdefault ) : ;;
-
-	# A value to assign to MEMBER of the new gdbarch object should
-	# the target architecture code fail to change the PREDEFAULT
-	# value.
-
-	# If POSTDEFAULT is empty, no post update is performed.
-
-	# If both INVALID_P and POSTDEFAULT are non-empty then
-	# INVALID_P will be used to determine if MEMBER should be
-	# changed to POSTDEFAULT.
-
-	# If a non-empty POSTDEFAULT and a zero INVALID_P are
-	# specified, POSTDEFAULT will be used as the default for the
-	# non- multi-arch target (regardless of the value of
-	# PREDEFAULT).
-
-	# You cannot specify both a zero INVALID_P and a POSTDEFAULT.
-
-	# Variable declarations can refer to ``gdbarch'' which
-	# will contain the current architecture.  Care should be
-	# taken.
-
-    invalid_p ) : ;;
-
-	# A predicate equation that validates MEMBER.  Non-zero is
-	# returned if the code creating the new architecture failed to
-	# initialize MEMBER or the initialized the member is invalid.
-	# If POSTDEFAULT is non-empty then MEMBER will be updated to
-	# that value.  If POSTDEFAULT is empty then internal_error()
-	# is called.
-
-	# If INVALID_P is empty, a check that MEMBER is no longer
-	# equal to PREDEFAULT is used.
-
-	# The expression ``0'' disables the INVALID_P check making
-	# PREDEFAULT a legitimate value.
-
-	# See also PREDEFAULT and POSTDEFAULT.
-
-    print ) : ;;
-
-	# An optional expression that convers MEMBER to a value
-	# suitable for formatting using %s.
-
-	# If PRINT is empty, core_addr_to_string_nz (for CORE_ADDR)
-	# or plongest (anything else) is used.
-
-    garbage_at_eol ) : ;;
-
-	# Catches stray fields.
-
-    *)
-	echo "Bad field ${field}"
-	exit 1;;
-  esac
-done
-
-
-function_list ()
-{
-  # See below (DOCO) for description of each field
-  cat <<EOF
-i;const struct bfd_arch_info *;bfd_arch_info;;;&bfd_default_arch_struct;;;;gdbarch_bfd_arch_info (gdbarch)->printable_name
-#
-i;enum bfd_endian;byte_order;;;BFD_ENDIAN_BIG
-i;enum bfd_endian;byte_order_for_code;;;BFD_ENDIAN_BIG
-#
-i;enum gdb_osabi;osabi;;;GDB_OSABI_UNKNOWN
-#
-i;const struct target_desc *;target_desc;;;;;;;host_address_to_string (gdbarch->target_desc)
-
-# Number of bits in a short or unsigned short for the target machine.
-v;int;short_bit;;;8 * sizeof (short);2*TARGET_CHAR_BIT;;0
-# Number of bits in an int or unsigned int for the target machine.
-v;int;int_bit;;;8 * sizeof (int);4*TARGET_CHAR_BIT;;0
-# Number of bits in a long or unsigned long for the target machine.
-v;int;long_bit;;;8 * sizeof (long);4*TARGET_CHAR_BIT;;0
-# Number of bits in a long long or unsigned long long for the target
-# machine.
-v;int;long_long_bit;;;8 * sizeof (LONGEST);2*gdbarch->long_bit;;0
-
-# The ABI default bit-size and format for "bfloat16", "half", "float", "double", and
-# "long double".  These bit/format pairs should eventually be combined
-# into a single object.  For the moment, just initialize them as a pair.
-# Each format describes both the big and little endian layouts (if
-# useful).
-
-v;int;bfloat16_bit;;;16;2*TARGET_CHAR_BIT;;0
-v;const struct floatformat **;bfloat16_format;;;;;floatformats_bfloat16;;pformat (gdbarch->bfloat16_format)
-v;int;half_bit;;;16;2*TARGET_CHAR_BIT;;0
-v;const struct floatformat **;half_format;;;;;floatformats_ieee_half;;pformat (gdbarch->half_format)
-v;int;float_bit;;;8 * sizeof (float);4*TARGET_CHAR_BIT;;0
-v;const struct floatformat **;float_format;;;;;floatformats_ieee_single;;pformat (gdbarch->float_format)
-v;int;double_bit;;;8 * sizeof (double);8*TARGET_CHAR_BIT;;0
-v;const struct floatformat **;double_format;;;;;floatformats_ieee_double;;pformat (gdbarch->double_format)
-v;int;long_double_bit;;;8 * sizeof (long double);8*TARGET_CHAR_BIT;;0
-v;const struct floatformat **;long_double_format;;;;;floatformats_ieee_double;;pformat (gdbarch->long_double_format)
-
-# The ABI default bit-size for "wchar_t".  wchar_t is a built-in type
-# starting with C++11.
-v;int;wchar_bit;;;8 * sizeof (wchar_t);4*TARGET_CHAR_BIT;;0
-# One if \`wchar_t' is signed, zero if unsigned.
-v;int;wchar_signed;;;1;-1;1
-
-# Returns the floating-point format to be used for values of length LENGTH.
-# NAME, if non-NULL, is the type name, which may be used to distinguish
-# different target formats of the same length.
-m;const struct floatformat **;floatformat_for_type;const char *name, int length;name, length;0;default_floatformat_for_type;;0
-
-# For most targets, a pointer on the target and its representation as an
-# address in GDB have the same size and "look the same".  For such a
-# target, you need only set gdbarch_ptr_bit and gdbarch_addr_bit
-# / addr_bit will be set from it.
-#
-# If gdbarch_ptr_bit and gdbarch_addr_bit are different, you'll probably
-# also need to set gdbarch_dwarf2_addr_size, gdbarch_pointer_to_address and
-# gdbarch_address_to_pointer as well.
-#
-# ptr_bit is the size of a pointer on the target
-v;int;ptr_bit;;;8 * sizeof (void*);gdbarch->int_bit;;0
-# addr_bit is the size of a target address as represented in gdb
-v;int;addr_bit;;;8 * sizeof (void*);0;gdbarch_ptr_bit (gdbarch);
-#
-# dwarf2_addr_size is the target address size as used in the Dwarf debug
-# info.  For .debug_frame FDEs, this is supposed to be the target address
-# size from the associated CU header, and which is equivalent to the
-# DWARF2_ADDR_SIZE as defined by the target specific GCC back-end.
-# Unfortunately there is no good way to determine this value.  Therefore
-# dwarf2_addr_size simply defaults to the target pointer size.
-#
-# dwarf2_addr_size is not used for .eh_frame FDEs, which are generally
-# defined using the target's pointer size so far.
-#
-# Note that dwarf2_addr_size only needs to be redefined by a target if the
-# GCC back-end defines a DWARF2_ADDR_SIZE other than the target pointer size,
-# and if Dwarf versions < 4 need to be supported.
-v;int;dwarf2_addr_size;;;sizeof (void*);0;gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT;
-#
-# One if \`char' acts like \`signed char', zero if \`unsigned char'.
-v;int;char_signed;;;1;-1;1
-#
-F;CORE_ADDR;read_pc;readable_regcache *regcache;regcache
-F;void;write_pc;struct regcache *regcache, CORE_ADDR val;regcache, val
-# Function for getting target's idea of a frame pointer.  FIXME: GDB's
-# whole scheme for dealing with "frames" and "frame pointers" needs a
-# serious shakedown.
-m;void;virtual_frame_pointer;CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset;pc, frame_regnum, frame_offset;0;legacy_virtual_frame_pointer;;0
-#
-M;enum register_status;pseudo_register_read;readable_regcache *regcache, int cookednum, gdb_byte *buf;regcache, cookednum, buf
-# Read a register into a new struct value.  If the register is wholly
-# or partly unavailable, this should call mark_value_bytes_unavailable
-# as appropriate.  If this is defined, then pseudo_register_read will
-# never be called.
-M;struct value *;pseudo_register_read_value;readable_regcache *regcache, int cookednum;regcache, cookednum
-M;void;pseudo_register_write;struct regcache *regcache, int cookednum, const gdb_byte *buf;regcache, cookednum, buf
-#
-v;int;num_regs;;;0;-1
-# This macro gives the number of pseudo-registers that live in the
-# register namespace but do not get fetched or stored on the target.
-# These pseudo-registers may be aliases for other registers,
-# combinations of other registers, or they may be computed by GDB.
-v;int;num_pseudo_regs;;;0;0;;0
-
-# Assemble agent expression bytecode to collect pseudo-register REG.
-# Return -1 if something goes wrong, 0 otherwise.
-M;int;ax_pseudo_register_collect;struct agent_expr *ax, int reg;ax, reg
-
-# Assemble agent expression bytecode to push the value of pseudo-register
-# REG on the interpreter stack.
-# Return -1 if something goes wrong, 0 otherwise.
-M;int;ax_pseudo_register_push_stack;struct agent_expr *ax, int reg;ax, reg
-
-# Some architectures can display additional information for specific
-# signals.
-# UIOUT is the output stream where the handler will place information.
-M;void;report_signal_info;struct ui_out *uiout, enum gdb_signal siggnal;uiout, siggnal
-
-# GDB's standard (or well known) register numbers.  These can map onto
-# a real register or a pseudo (computed) register or not be defined at
-# all (-1).
-# gdbarch_sp_regnum will hopefully be replaced by UNWIND_SP.
-v;int;sp_regnum;;;-1;-1;;0
-v;int;pc_regnum;;;-1;-1;;0
-v;int;ps_regnum;;;-1;-1;;0
-v;int;fp0_regnum;;;0;-1;;0
-# Convert stab register number (from \`r\' declaration) to a gdb REGNUM.
-m;int;stab_reg_to_regnum;int stab_regnr;stab_regnr;;no_op_reg_to_regnum;;0
-# Provide a default mapping from a ecoff register number to a gdb REGNUM.
-m;int;ecoff_reg_to_regnum;int ecoff_regnr;ecoff_regnr;;no_op_reg_to_regnum;;0
-# Convert from an sdb register number to an internal gdb register number.
-m;int;sdb_reg_to_regnum;int sdb_regnr;sdb_regnr;;no_op_reg_to_regnum;;0
-# Provide a default mapping from a DWARF2 register number to a gdb REGNUM.
-# Return -1 for bad REGNUM.  Note: Several targets get this wrong.
-m;int;dwarf2_reg_to_regnum;int dwarf2_regnr;dwarf2_regnr;;no_op_reg_to_regnum;;0
-m;const char *;register_name;int regnr;regnr;;0
-
-# Return the type of a register specified by the architecture.  Only
-# the register cache should call this function directly; others should
-# use "register_type".
-M;struct type *;register_type;int reg_nr;reg_nr
-
-# Generate a dummy frame_id for THIS_FRAME assuming that the frame is
-# a dummy frame.  A dummy frame is created before an inferior call,
-# the frame_id returned here must match the frame_id that was built
-# for the inferior call.  Usually this means the returned frame_id's
-# stack address should match the address returned by
-# gdbarch_push_dummy_call, and the returned frame_id's code address
-# should match the address at which the breakpoint was set in the dummy
-# frame.
-m;struct frame_id;dummy_id;struct frame_info *this_frame;this_frame;;default_dummy_id;;0
-# Implement DUMMY_ID and PUSH_DUMMY_CALL, then delete
-# deprecated_fp_regnum.
-v;int;deprecated_fp_regnum;;;-1;-1;;0
-
-M;CORE_ADDR;push_dummy_call;struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, function_call_return_method return_method, CORE_ADDR struct_addr;function, regcache, bp_addr, nargs, args, sp, return_method, struct_addr
-v;int;call_dummy_location;;;;AT_ENTRY_POINT;;0
-M;CORE_ADDR;push_dummy_code;CORE_ADDR sp, CORE_ADDR funaddr, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache;sp, funaddr, args, nargs, value_type, real_pc, bp_addr, regcache
-
-# Return true if the code of FRAME is writable.
-m;int;code_of_frame_writable;struct frame_info *frame;frame;;default_code_of_frame_writable;;0
-
-m;void;print_registers_info;struct ui_file *file, struct frame_info *frame, int regnum, int all;file, frame, regnum, all;;default_print_registers_info;;0
-m;void;print_float_info;struct ui_file *file, struct frame_info *frame, const char *args;file, frame, args;;default_print_float_info;;0
-M;void;print_vector_info;struct ui_file *file, struct frame_info *frame, const char *args;file, frame, args
-# MAP a GDB RAW register number onto a simulator register number.  See
-# also include/...-sim.h.
-m;int;register_sim_regno;int reg_nr;reg_nr;;legacy_register_sim_regno;;0
-m;int;cannot_fetch_register;int regnum;regnum;;cannot_register_not;;0
-m;int;cannot_store_register;int regnum;regnum;;cannot_register_not;;0
-
-# Determine the address where a longjmp will land and save this address
-# in PC.  Return nonzero on success.
-#
-# FRAME corresponds to the longjmp frame.
-F;int;get_longjmp_target;struct frame_info *frame, CORE_ADDR *pc;frame, pc
-
-#
-v;int;believe_pcc_promotion;;;;;;;
-#
-m;int;convert_register_p;int regnum, struct type *type;regnum, type;0;generic_convert_register_p;;0
-f;int;register_to_value;struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf, int *optimizedp, int *unavailablep;frame, regnum, type, buf, optimizedp, unavailablep;0
-f;void;value_to_register;struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf;frame, regnum, type, buf;0
-# Construct a value representing the contents of register REGNUM in
-# frame FRAME_ID, interpreted as type TYPE.  The routine needs to
-# allocate and return a struct value with all value attributes
-# (but not the value contents) filled in.
-m;struct value *;value_from_register;struct type *type, int regnum, struct frame_id frame_id;type, regnum, frame_id;;default_value_from_register;;0
-#
-m;CORE_ADDR;pointer_to_address;struct type *type, const gdb_byte *buf;type, buf;;unsigned_pointer_to_address;;0
-m;void;address_to_pointer;struct type *type, gdb_byte *buf, CORE_ADDR addr;type, buf, addr;;unsigned_address_to_pointer;;0
-M;CORE_ADDR;integer_to_address;struct type *type, const gdb_byte *buf;type, buf
-
-# Return the return-value convention that will be used by FUNCTION
-# to return a value of type VALTYPE.  FUNCTION may be NULL in which
-# case the return convention is computed based only on VALTYPE.
-#
-# If READBUF is not NULL, extract the return value and save it in this buffer.
-#
-# If WRITEBUF is not NULL, it contains a return value which will be
-# stored into the appropriate register.  This can be used when we want
-# to force the value returned by a function (see the "return" command
-# for instance).
-M;enum return_value_convention;return_value;struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf;function, valtype, regcache, readbuf, writebuf
-
-# Return true if the return value of function is stored in the first hidden
-# parameter.  In theory, this feature should be language-dependent, specified
-# by language and its ABI, such as C++.  Unfortunately, compiler may
-# implement it to a target-dependent feature.  So that we need such hook here
-# to be aware of this in GDB.
-m;int;return_in_first_hidden_param_p;struct type *type;type;;default_return_in_first_hidden_param_p;;0
-
-m;CORE_ADDR;skip_prologue;CORE_ADDR ip;ip;0;0
-M;CORE_ADDR;skip_main_prologue;CORE_ADDR ip;ip
-# On some platforms, a single function may provide multiple entry points,
-# e.g. one that is used for function-pointer calls and a different one
-# that is used for direct function calls.
-# In order to ensure that breakpoints set on the function will trigger
-# no matter via which entry point the function is entered, a platform
-# may provide the skip_entrypoint callback.  It is called with IP set
-# to the main entry point of a function (as determined by the symbol table),
-# and should return the address of the innermost entry point, where the
-# actual breakpoint needs to be set.  Note that skip_entrypoint is used
-# by GDB common code even when debugging optimized code, where skip_prologue
-# is not used.
-M;CORE_ADDR;skip_entrypoint;CORE_ADDR ip;ip
-
-f;int;inner_than;CORE_ADDR lhs, CORE_ADDR rhs;lhs, rhs;0;0
-m;const gdb_byte *;breakpoint_from_pc;CORE_ADDR *pcptr, int *lenptr;pcptr, lenptr;0;default_breakpoint_from_pc;;0
-
-# Return the breakpoint kind for this target based on *PCPTR.
-m;int;breakpoint_kind_from_pc;CORE_ADDR *pcptr;pcptr;;0;
-
-# Return the software breakpoint from KIND.  KIND can have target
-# specific meaning like the Z0 kind parameter.
-# SIZE is set to the software breakpoint's length in memory.
-m;const gdb_byte *;sw_breakpoint_from_kind;int kind, int *size;kind, size;;NULL;;0
-
-# Return the breakpoint kind for this target based on the current
-# processor state (e.g. the current instruction mode on ARM) and the
-# *PCPTR.  In default, it is gdbarch->breakpoint_kind_from_pc.
-m;int;breakpoint_kind_from_current_state;struct regcache *regcache, CORE_ADDR *pcptr;regcache, pcptr;0;default_breakpoint_kind_from_current_state;;0
-
-M;CORE_ADDR;adjust_breakpoint_address;CORE_ADDR bpaddr;bpaddr
-m;int;memory_insert_breakpoint;struct bp_target_info *bp_tgt;bp_tgt;0;default_memory_insert_breakpoint;;0
-m;int;memory_remove_breakpoint;struct bp_target_info *bp_tgt;bp_tgt;0;default_memory_remove_breakpoint;;0
-v;CORE_ADDR;decr_pc_after_break;;;0;;;0
-
-# A function can be addressed by either it's "pointer" (possibly a
-# descriptor address) or "entry point" (first executable instruction).
-# The method "convert_from_func_ptr_addr" converting the former to the
-# latter.  gdbarch_deprecated_function_start_offset is being used to implement
-# a simplified subset of that functionality - the function's address
-# corresponds to the "function pointer" and the function's start
-# corresponds to the "function entry point" - and hence is redundant.
-
-v;CORE_ADDR;deprecated_function_start_offset;;;0;;;0
-
-# Return the remote protocol register number associated with this
-# register.  Normally the identity mapping.
-m;int;remote_register_number;int regno;regno;;default_remote_register_number;;0
-
-# Fetch the target specific address used to represent a load module.
-F;CORE_ADDR;fetch_tls_load_module_address;struct objfile *objfile;objfile
-
-# Return the thread-local address at OFFSET in the thread-local
-# storage for the thread PTID and the shared library or executable
-# file given by LM_ADDR.  If that block of thread-local storage hasn't
-# been allocated yet, this function may throw an error.  LM_ADDR may
-# be zero for statically linked multithreaded inferiors.
-
-M;CORE_ADDR;get_thread_local_address;ptid_t ptid, CORE_ADDR lm_addr, CORE_ADDR offset;ptid, lm_addr, offset
-#
-v;CORE_ADDR;frame_args_skip;;;0;;;0
-m;CORE_ADDR;unwind_pc;struct frame_info *next_frame;next_frame;;default_unwind_pc;;0
-m;CORE_ADDR;unwind_sp;struct frame_info *next_frame;next_frame;;default_unwind_sp;;0
-# DEPRECATED_FRAME_LOCALS_ADDRESS as been replaced by the per-frame
-# frame-base.  Enable frame-base before frame-unwind.
-F;int;frame_num_args;struct frame_info *frame;frame
-#
-M;CORE_ADDR;frame_align;CORE_ADDR address;address
-m;int;stabs_argument_has_addr;struct type *type;type;;default_stabs_argument_has_addr;;0
-v;int;frame_red_zone_size
-#
-m;CORE_ADDR;convert_from_func_ptr_addr;CORE_ADDR addr, struct target_ops *targ;addr, targ;;convert_from_func_ptr_addr_identity;;0
-# On some machines there are bits in addresses which are not really
-# part of the address, but are used by the kernel, the hardware, etc.
-# for special purposes.  gdbarch_addr_bits_remove takes out any such bits so
-# we get a "real" address such as one would find in a symbol table.
-# This is used only for addresses of instructions, and even then I'm
-# not sure it's used in all contexts.  It exists to deal with there
-# being a few stray bits in the PC which would mislead us, not as some
-# sort of generic thing to handle alignment or segmentation (it's
-# possible it should be in TARGET_READ_PC instead).
-m;CORE_ADDR;addr_bits_remove;CORE_ADDR addr;addr;;core_addr_identity;;0
-
-# On some machines, not all bits of an address word are significant.
-# For example, on AArch64, the top bits of an address known as the "tag"
-# are ignored by the kernel, the hardware, etc. and can be regarded as
-# additional data associated with the address.
-v;int;significant_addr_bit;;;;;;0
-
-# Return a string representation of the memory tag TAG.
-m;std::string;memtag_to_string;struct value *tag;tag;;default_memtag_to_string;;0
-
-# Return true if ADDRESS contains a tag and false otherwise.  ADDRESS
-# must be either a pointer or a reference type.
-m;bool;tagged_address_p;struct value *address;address;;default_tagged_address_p;;0
-
-# Return true if the tag from ADDRESS matches the memory tag for that
-# particular address.  Return false otherwise.
-m;bool;memtag_matches_p;struct value *address;address;;default_memtag_matches_p;;0
-
-# Set the tags of type TAG_TYPE, for the memory address range
-# [ADDRESS, ADDRESS + LENGTH) to TAGS.
-# Return true if successful and false otherwise.
-m;bool;set_memtags;struct value *address, size_t length, const gdb::byte_vector \&tags, memtag_type tag_type;address, length, tags, tag_type;;default_set_memtags;;0
-
-# Return the tag of type TAG_TYPE associated with the memory address ADDRESS,
-# assuming ADDRESS is tagged.
-m;struct value *;get_memtag;struct value *address, memtag_type tag_type;address, tag_type;;default_get_memtag;;0
-
-# memtag_granule_size is the size of the allocation tag granule, for
-# architectures that support memory tagging.
-# This is 0 for architectures that do not support memory tagging.
-# For a non-zero value, this represents the number of bytes of memory per tag.
-v;CORE_ADDR;memtag_granule_size;;;;;;0
-
-# FIXME/cagney/2001-01-18: This should be split in two.  A target method that
-# indicates if the target needs software single step.  An ISA method to
-# implement it.
-#
-# FIXME/cagney/2001-01-18: The logic is backwards.  It should be asking if the
-# target can single step.  If not, then implement single step using breakpoints.
-#
-# Return a vector of addresses on which the software single step
-# breakpoints should be inserted.  NULL means software single step is
-# not used.
-# Multiple breakpoints may be inserted for some instructions such as
-# conditional branch.  However, each implementation must always evaluate
-# the condition and only put the breakpoint at the branch destination if
-# the condition is true, so that we ensure forward progress when stepping
-# past a conditional branch to self.
-F;std::vector<CORE_ADDR>;software_single_step;struct regcache *regcache;regcache
-
-# Return non-zero if the processor is executing a delay slot and a
-# further single-step is needed before the instruction finishes.
-M;int;single_step_through_delay;struct frame_info *frame;frame
-# FIXME: cagney/2003-08-28: Need to find a better way of selecting the
-# disassembler.  Perhaps objdump can handle it?
-f;int;print_insn;bfd_vma vma, struct disassemble_info *info;vma, info;;default_print_insn;;0
-f;CORE_ADDR;skip_trampoline_code;struct frame_info *frame, CORE_ADDR pc;frame, pc;;generic_skip_trampoline_code;;0
-
-
-# If in_solib_dynsym_resolve_code() returns true, and SKIP_SOLIB_RESOLVER
-# evaluates non-zero, this is the address where the debugger will place
-# a step-resume breakpoint to get us past the dynamic linker.
-m;CORE_ADDR;skip_solib_resolver;CORE_ADDR pc;pc;;generic_skip_solib_resolver;;0
-# Some systems also have trampoline code for returning from shared libs.
-m;int;in_solib_return_trampoline;CORE_ADDR pc, const char *name;pc, name;;generic_in_solib_return_trampoline;;0
-
-# Return true if PC lies inside an indirect branch thunk.
-m;bool;in_indirect_branch_thunk;CORE_ADDR pc;pc;;default_in_indirect_branch_thunk;;0
-
-# A target might have problems with watchpoints as soon as the stack
-# frame of the current function has been destroyed.  This mostly happens
-# as the first action in a function's epilogue.  stack_frame_destroyed_p()
-# is defined to return a non-zero value if either the given addr is one
-# instruction after the stack destroying instruction up to the trailing
-# return instruction or if we can figure out that the stack frame has
-# already been invalidated regardless of the value of addr.  Targets
-# which don't suffer from that problem could just let this functionality
-# untouched.
-m;int;stack_frame_destroyed_p;CORE_ADDR addr;addr;0;generic_stack_frame_destroyed_p;;0
-# Process an ELF symbol in the minimal symbol table in a backend-specific
-# way.  Normally this hook is supposed to do nothing, however if required,
-# then this hook can be used to apply tranformations to symbols that are
-# considered special in some way.  For example the MIPS backend uses it
-# to interpret \`st_other' information to mark compressed code symbols so
-# that they can be treated in the appropriate manner in the processing of
-# the main symbol table and DWARF-2 records.
-F;void;elf_make_msymbol_special;asymbol *sym, struct minimal_symbol *msym;sym, msym
-f;void;coff_make_msymbol_special;int val, struct minimal_symbol *msym;val, msym;;default_coff_make_msymbol_special;;0
-# Process a symbol in the main symbol table in a backend-specific way.
-# Normally this hook is supposed to do nothing, however if required,
-# then this hook can be used to apply tranformations to symbols that
-# are considered special in some way.  This is currently used by the
-# MIPS backend to make sure compressed code symbols have the ISA bit
-# set.  This in turn is needed for symbol values seen in GDB to match
-# the values used at the runtime by the program itself, for function
-# and label references.
-f;void;make_symbol_special;struct symbol *sym, struct objfile *objfile;sym, objfile;;default_make_symbol_special;;0
-# Adjust the address retrieved from a DWARF-2 record other than a line
-# entry in a backend-specific way.  Normally this hook is supposed to
-# return the address passed unchanged, however if that is incorrect for
-# any reason, then this hook can be used to fix the address up in the
-# required manner.  This is currently used by the MIPS backend to make
-# sure addresses in FDE, range records, etc. referring to compressed
-# code have the ISA bit set, matching line information and the symbol
-# table.
-f;CORE_ADDR;adjust_dwarf2_addr;CORE_ADDR pc;pc;;default_adjust_dwarf2_addr;;0
-# Adjust the address updated by a line entry in a backend-specific way.
-# Normally this hook is supposed to return the address passed unchanged,
-# however in the case of inconsistencies in these records, this hook can
-# be used to fix them up in the required manner.  This is currently used
-# by the MIPS backend to make sure all line addresses in compressed code
-# are presented with the ISA bit set, which is not always the case.  This
-# in turn ensures breakpoint addresses are correctly matched against the
-# stop PC.
-f;CORE_ADDR;adjust_dwarf2_line;CORE_ADDR addr, int rel;addr, rel;;default_adjust_dwarf2_line;;0
-v;int;cannot_step_breakpoint;;;0;0;;0
-# See comment in target.h about continuable, steppable and
-# non-steppable watchpoints.
-v;int;have_nonsteppable_watchpoint;;;0;0;;0
-F;type_instance_flags;address_class_type_flags;int byte_size, int dwarf2_addr_class;byte_size, dwarf2_addr_class
-M;const char *;address_class_type_flags_to_name;type_instance_flags type_flags;type_flags
-# Execute vendor-specific DWARF Call Frame Instruction.  OP is the instruction.
-# FS are passed from the generic execute_cfa_program function.
-m;bool;execute_dwarf_cfa_vendor_op;gdb_byte op, struct dwarf2_frame_state *fs;op, fs;;default_execute_dwarf_cfa_vendor_op;;0
-
-# Return the appropriate type_flags for the supplied address class.
-# This function should return true if the address class was recognized and
-# type_flags was set, false otherwise.
-M;bool;address_class_name_to_type_flags;const char *name, type_instance_flags *type_flags_ptr;name, type_flags_ptr
-# Is a register in a group
-m;int;register_reggroup_p;int regnum, struct reggroup *reggroup;regnum, reggroup;;default_register_reggroup_p;;0
-# Fetch the pointer to the ith function argument.
-F;CORE_ADDR;fetch_pointer_argument;struct frame_info *frame, int argi, struct type *type;frame, argi, type
-
-# Iterate over all supported register notes in a core file.  For each
-# supported register note section, the iterator must call CB and pass
-# CB_DATA unchanged.  If REGCACHE is not NULL, the iterator can limit
-# the supported register note sections based on the current register
-# values.  Otherwise it should enumerate all supported register note
-# sections.
-M;void;iterate_over_regset_sections;iterate_over_regset_sections_cb *cb, void *cb_data, const struct regcache *regcache;cb, cb_data, regcache
-
-# Create core file notes
-M;gdb::unique_xmalloc_ptr<char>;make_corefile_notes;bfd *obfd, int *note_size;obfd, note_size
-
-# Find core file memory regions
-M;int;find_memory_regions;find_memory_region_ftype func, void *data;func, data
-
-# Read offset OFFSET of TARGET_OBJECT_LIBRARIES formatted shared libraries list from
-# core file into buffer READBUF with length LEN.  Return the number of bytes read
-# (zero indicates failure).
-# failed, otherwise, return the red length of READBUF.
-M;ULONGEST;core_xfer_shared_libraries;gdb_byte *readbuf, ULONGEST offset, ULONGEST len;readbuf, offset, len
-
-# Read offset OFFSET of TARGET_OBJECT_LIBRARIES_AIX formatted shared
-# libraries list from core file into buffer READBUF with length LEN.
-# Return the number of bytes read (zero indicates failure).
-M;ULONGEST;core_xfer_shared_libraries_aix;gdb_byte *readbuf, ULONGEST offset, ULONGEST len;readbuf, offset, len
-
-# How the core target converts a PTID from a core file to a string.
-M;std::string;core_pid_to_str;ptid_t ptid;ptid
-
-# How the core target extracts the name of a thread from a core file.
-M;const char *;core_thread_name;struct thread_info *thr;thr
-
-# Read offset OFFSET of TARGET_OBJECT_SIGNAL_INFO signal information
-# from core file into buffer READBUF with length LEN.  Return the number
-# of bytes read (zero indicates EOF, a negative value indicates failure).
-M;LONGEST;core_xfer_siginfo;gdb_byte *readbuf, ULONGEST offset, ULONGEST len; readbuf, offset, len
-
-# BFD target to use when generating a core file.
-V;const char *;gcore_bfd_target;;;0;0;;;pstring (gdbarch->gcore_bfd_target)
-
-# If the elements of C++ vtables are in-place function descriptors rather
-# than normal function pointers (which may point to code or a descriptor),
-# set this to one.
-v;int;vtable_function_descriptors;;;0;0;;0
-
-# Set if the least significant bit of the delta is used instead of the least
-# significant bit of the pfn for pointers to virtual member functions.
-v;int;vbit_in_delta;;;0;0;;0
-
-# Advance PC to next instruction in order to skip a permanent breakpoint.
-f;void;skip_permanent_breakpoint;struct regcache *regcache;regcache;default_skip_permanent_breakpoint;default_skip_permanent_breakpoint;;0
-
-# The maximum length of an instruction on this architecture in bytes.
-V;ULONGEST;max_insn_length;;;0;0
-
-# Copy the instruction at FROM to TO, and make any adjustments
-# necessary to single-step it at that address.
-#
-# REGS holds the state the thread's registers will have before
-# executing the copied instruction; the PC in REGS will refer to FROM,
-# not the copy at TO.  The caller should update it to point at TO later.
-#
-# Return a pointer to data of the architecture's choice to be passed
-# to gdbarch_displaced_step_fixup.
-#
-# For a general explanation of displaced stepping and how GDB uses it,
-# see the comments in infrun.c.
-#
-# The TO area is only guaranteed to have space for
-# gdbarch_max_insn_length (arch) bytes, so this function must not
-# write more bytes than that to that area.
-#
-# If you do not provide this function, GDB assumes that the
-# architecture does not support displaced stepping.
-#
-# If the instruction cannot execute out of line, return NULL.  The
-# core falls back to stepping past the instruction in-line instead in
-# that case.
-M;displaced_step_copy_insn_closure_up;displaced_step_copy_insn;CORE_ADDR from, CORE_ADDR to, struct regcache *regs;from, to, regs
-
-# Return true if GDB should use hardware single-stepping to execute a displaced
-# step instruction.  If false, GDB will simply restart execution at the
-# displaced instruction location, and it is up to the target to ensure GDB will
-# receive control again (e.g. by placing a software breakpoint instruction into
-# the displaced instruction buffer).
-#
-# The default implementation returns false on all targets that provide a
-# gdbarch_software_single_step routine, and true otherwise.
-m;bool;displaced_step_hw_singlestep;void;;;default_displaced_step_hw_singlestep;;0
-
-# Fix up the state resulting from successfully single-stepping a
-# displaced instruction, to give the result we would have gotten from
-# stepping the instruction in its original location.
-#
-# REGS is the register state resulting from single-stepping the
-# displaced instruction.
-#
-# CLOSURE is the result from the matching call to
-# gdbarch_displaced_step_copy_insn.
-#
-# If you provide gdbarch_displaced_step_copy_insn.but not this
-# function, then GDB assumes that no fixup is needed after
-# single-stepping the instruction.
-#
-# For a general explanation of displaced stepping and how GDB uses it,
-# see the comments in infrun.c.
-M;void;displaced_step_fixup;struct displaced_step_copy_insn_closure *closure, CORE_ADDR from, CORE_ADDR to, struct regcache *regs;closure, from, to, regs;;NULL
-
-# Prepare THREAD for it to displaced step the instruction at its current PC.
-#
-# Throw an exception if any unexpected error happens.
-M;displaced_step_prepare_status;displaced_step_prepare;thread_info *thread, CORE_ADDR &displaced_pc;thread, displaced_pc
-
-# Clean up after a displaced step of THREAD.
-m;displaced_step_finish_status;displaced_step_finish;thread_info *thread, gdb_signal sig;thread, sig;;NULL;;(! gdbarch->displaced_step_finish) != (! gdbarch->displaced_step_prepare)
-
-# Return the closure associated to the displaced step buffer that is at ADDR.
-F;const displaced_step_copy_insn_closure *;displaced_step_copy_insn_closure_by_addr;inferior *inf, CORE_ADDR addr;inf, addr
-
-# PARENT_INF has forked and CHILD_PTID is the ptid of the child.  Restore the
-# contents of all displaced step buffers in the child's address space.
-f;void;displaced_step_restore_all_in_ptid;inferior *parent_inf, ptid_t child_ptid;parent_inf, child_ptid
-
-# Relocate an instruction to execute at a different address.  OLDLOC
-# is the address in the inferior memory where the instruction to
-# relocate is currently at.  On input, TO points to the destination
-# where we want the instruction to be copied (and possibly adjusted)
-# to.  On output, it points to one past the end of the resulting
-# instruction(s).  The effect of executing the instruction at TO shall
-# be the same as if executing it at FROM.  For example, call
-# instructions that implicitly push the return address on the stack
-# should be adjusted to return to the instruction after OLDLOC;
-# relative branches, and other PC-relative instructions need the
-# offset adjusted; etc.
-M;void;relocate_instruction;CORE_ADDR *to, CORE_ADDR from;to, from;;NULL
-
-# Refresh overlay mapped state for section OSECT.
-F;void;overlay_update;struct obj_section *osect;osect
-
-M;const struct target_desc *;core_read_description;struct target_ops *target, bfd *abfd;target, abfd
-
-# Set if the address in N_SO or N_FUN stabs may be zero.
-v;int;sofun_address_maybe_missing;;;0;0;;0
-
-# Parse the instruction at ADDR storing in the record execution log
-# the registers REGCACHE and memory ranges that will be affected when
-# the instruction executes, along with their current values.
-# Return -1 if something goes wrong, 0 otherwise.
-M;int;process_record;struct regcache *regcache, CORE_ADDR addr;regcache, addr
-
-# Save process state after a signal.
-# Return -1 if something goes wrong, 0 otherwise.
-M;int;process_record_signal;struct regcache *regcache, enum gdb_signal signal;regcache, signal
-
-# Signal translation: translate inferior's signal (target's) number
-# into GDB's representation.  The implementation of this method must
-# be host independent.  IOW, don't rely on symbols of the NAT_FILE
-# header (the nm-*.h files), the host <signal.h> header, or similar
-# headers.  This is mainly used when cross-debugging core files ---
-# "Live" targets hide the translation behind the target interface
-# (target_wait, target_resume, etc.).
-M;enum gdb_signal;gdb_signal_from_target;int signo;signo
-
-# Signal translation: translate the GDB's internal signal number into
-# the inferior's signal (target's) representation.  The implementation
-# of this method must be host independent.  IOW, don't rely on symbols
-# of the NAT_FILE header (the nm-*.h files), the host <signal.h>
-# header, or similar headers.
-# Return the target signal number if found, or -1 if the GDB internal
-# signal number is invalid.
-M;int;gdb_signal_to_target;enum gdb_signal signal;signal
-
-# Extra signal info inspection.
-#
-# Return a type suitable to inspect extra signal information.
-M;struct type *;get_siginfo_type;void;
-
-# Record architecture-specific information from the symbol table.
-M;void;record_special_symbol;struct objfile *objfile, asymbol *sym;objfile, sym
-
-# Function for the 'catch syscall' feature.
-
-# Get architecture-specific system calls information from registers.
-M;LONGEST;get_syscall_number;thread_info *thread;thread
-
-# The filename of the XML syscall for this architecture.
-v;const char *;xml_syscall_file;;;0;0;;0;pstring (gdbarch->xml_syscall_file)
-
-# Information about system calls from this architecture
-v;struct syscalls_info *;syscalls_info;;;0;0;;0;host_address_to_string (gdbarch->syscalls_info)
-
-# SystemTap related fields and functions.
-
-# A NULL-terminated array of prefixes used to mark an integer constant
-# on the architecture's assembly.
-# For example, on x86 integer constants are written as:
-#
-#  \$10 ;; integer constant 10
-#
-# in this case, this prefix would be the character \`\$\'.
-v;const char *const *;stap_integer_prefixes;;;0;0;;0;pstring_list (gdbarch->stap_integer_prefixes)
-
-# A NULL-terminated array of suffixes used to mark an integer constant
-# on the architecture's assembly.
-v;const char *const *;stap_integer_suffixes;;;0;0;;0;pstring_list (gdbarch->stap_integer_suffixes)
-
-# A NULL-terminated array of prefixes used to mark a register name on
-# the architecture's assembly.
-# For example, on x86 the register name is written as:
-#
-#  \%eax ;; register eax
-#
-# in this case, this prefix would be the character \`\%\'.
-v;const char *const *;stap_register_prefixes;;;0;0;;0;pstring_list (gdbarch->stap_register_prefixes)
-
-# A NULL-terminated array of suffixes used to mark a register name on
-# the architecture's assembly.
-v;const char *const *;stap_register_suffixes;;;0;0;;0;pstring_list (gdbarch->stap_register_suffixes)
-
-# A NULL-terminated array of prefixes used to mark a register
-# indirection on the architecture's assembly.
-# For example, on x86 the register indirection is written as:
-#
-#  \(\%eax\) ;; indirecting eax
-#
-# in this case, this prefix would be the charater \`\(\'.
-#
-# Please note that we use the indirection prefix also for register
-# displacement, e.g., \`4\(\%eax\)\' on x86.
-v;const char *const *;stap_register_indirection_prefixes;;;0;0;;0;pstring_list (gdbarch->stap_register_indirection_prefixes)
-
-# A NULL-terminated array of suffixes used to mark a register
-# indirection on the architecture's assembly.
-# For example, on x86 the register indirection is written as:
-#
-#  \(\%eax\) ;; indirecting eax
-#
-# in this case, this prefix would be the charater \`\)\'.
-#
-# Please note that we use the indirection suffix also for register
-# displacement, e.g., \`4\(\%eax\)\' on x86.
-v;const char *const *;stap_register_indirection_suffixes;;;0;0;;0;pstring_list (gdbarch->stap_register_indirection_suffixes)
-
-# Prefix(es) used to name a register using GDB's nomenclature.
-#
-# For example, on PPC a register is represented by a number in the assembly
-# language (e.g., \`10\' is the 10th general-purpose register).  However,
-# inside GDB this same register has an \`r\' appended to its name, so the 10th
-# register would be represented as \`r10\' internally.
-v;const char *;stap_gdb_register_prefix;;;0;0;;0;pstring (gdbarch->stap_gdb_register_prefix)
-
-# Suffix used to name a register using GDB's nomenclature.
-v;const char *;stap_gdb_register_suffix;;;0;0;;0;pstring (gdbarch->stap_gdb_register_suffix)
-
-# Check if S is a single operand.
-#
-# Single operands can be:
-#  \- Literal integers, e.g. \`\$10\' on x86
-#  \- Register access, e.g. \`\%eax\' on x86
-#  \- Register indirection, e.g. \`\(\%eax\)\' on x86
-#  \- Register displacement, e.g. \`4\(\%eax\)\' on x86
-#
-# This function should check for these patterns on the string
-# and return 1 if some were found, or zero otherwise.  Please try to match
-# as much info as you can from the string, i.e., if you have to match
-# something like \`\(\%\', do not match just the \`\(\'.
-M;int;stap_is_single_operand;const char *s;s
-
-# Function used to handle a "special case" in the parser.
-#
-# A "special case" is considered to be an unknown token, i.e., a token
-# that the parser does not know how to parse.  A good example of special
-# case would be ARM's register displacement syntax:
-#
-#  [R0, #4]  ;; displacing R0 by 4
-#
-# Since the parser assumes that a register displacement is of the form:
-#
-#  <number> <indirection_prefix> <register_name> <indirection_suffix>
-#
-# it means that it will not be able to recognize and parse this odd syntax.
-# Therefore, we should add a special case function that will handle this token.
-#
-# This function should generate the proper expression form of the expression
-# using GDB\'s internal expression mechanism (e.g., \`write_exp_elt_opcode\'
-# and so on).  It should also return 1 if the parsing was successful, or zero
-# if the token was not recognized as a special token (in this case, returning
-# zero means that the special parser is deferring the parsing to the generic
-# parser), and should advance the buffer pointer (p->arg).
-M;expr::operation_up;stap_parse_special_token;struct stap_parse_info *p;p
-
-# Perform arch-dependent adjustments to a register name.
-#
-# In very specific situations, it may be necessary for the register
-# name present in a SystemTap probe's argument to be handled in a
-# special way.  For example, on i386, GCC may over-optimize the
-# register allocation and use smaller registers than necessary.  In
-# such cases, the client that is reading and evaluating the SystemTap
-# probe (ourselves) will need to actually fetch values from the wider
-# version of the register in question.
-#
-# To illustrate the example, consider the following probe argument
-# (i386):
-#
-#    4@%ax
-#
-# This argument says that its value can be found at the %ax register,
-# which is a 16-bit register.  However, the argument's prefix says
-# that its type is "uint32_t", which is 32-bit in size.  Therefore, in
-# this case, GDB should actually fetch the probe's value from register
-# %eax, not %ax.  In this scenario, this function would actually
-# replace the register name from %ax to %eax.
-#
-# The rationale for this can be found at PR breakpoints/24541.
-M;std::string;stap_adjust_register;struct stap_parse_info *p, const std::string \&regname, int regnum;p, regname, regnum
-
-# DTrace related functions.
-
-# The expression to compute the NARTGth+1 argument to a DTrace USDT probe.
-# NARG must be >= 0.
-M;expr::operation_up;dtrace_parse_probe_argument;int narg;narg
-
-# True if the given ADDR does not contain the instruction sequence
-# corresponding to a disabled DTrace is-enabled probe.
-M;int;dtrace_probe_is_enabled;CORE_ADDR addr;addr
-
-# Enable a DTrace is-enabled probe at ADDR.
-M;void;dtrace_enable_probe;CORE_ADDR addr;addr
-
-# Disable a DTrace is-enabled probe at ADDR.
-M;void;dtrace_disable_probe;CORE_ADDR addr;addr
-
-# True if the list of shared libraries is one and only for all
-# processes, as opposed to a list of shared libraries per inferior.
-# This usually means that all processes, although may or may not share
-# an address space, will see the same set of symbols at the same
-# addresses.
-v;int;has_global_solist;;;0;0;;0
-
-# On some targets, even though each inferior has its own private
-# address space, the debug interface takes care of making breakpoints
-# visible to all address spaces automatically.  For such cases,
-# this property should be set to true.
-v;int;has_global_breakpoints;;;0;0;;0
-
-# True if inferiors share an address space (e.g., uClinux).
-m;int;has_shared_address_space;void;;;default_has_shared_address_space;;0
-
-# True if a fast tracepoint can be set at an address.
-m;int;fast_tracepoint_valid_at;CORE_ADDR addr, std::string *msg;addr, msg;;default_fast_tracepoint_valid_at;;0
-
-# Guess register state based on tracepoint location.  Used for tracepoints
-# where no registers have been collected, but there's only one location,
-# allowing us to guess the PC value, and perhaps some other registers.
-# On entry, regcache has all registers marked as unavailable.
-m;void;guess_tracepoint_registers;struct regcache *regcache, CORE_ADDR addr;regcache, addr;;default_guess_tracepoint_registers;;0
-
-# Return the "auto" target charset.
-f;const char *;auto_charset;void;;default_auto_charset;default_auto_charset;;0
-# Return the "auto" target wide charset.
-f;const char *;auto_wide_charset;void;;default_auto_wide_charset;default_auto_wide_charset;;0
-
-# If non-empty, this is a file extension that will be opened in place
-# of the file extension reported by the shared library list.
-#
-# This is most useful for toolchains that use a post-linker tool,
-# where the names of the files run on the target differ in extension
-# compared to the names of the files GDB should load for debug info.
-v;const char *;solib_symbols_extension;;;;;;;pstring (gdbarch->solib_symbols_extension)
-
-# If true, the target OS has DOS-based file system semantics.  That
-# is, absolute paths include a drive name, and the backslash is
-# considered a directory separator.
-v;int;has_dos_based_file_system;;;0;0;;0
-
-# Generate bytecodes to collect the return address in a frame.
-# Since the bytecodes run on the target, possibly with GDB not even
-# connected, the full unwinding machinery is not available, and
-# typically this function will issue bytecodes for one or more likely
-# places that the return address may be found.
-m;void;gen_return_address;struct agent_expr *ax, struct axs_value *value, CORE_ADDR scope;ax, value, scope;;default_gen_return_address;;0
-
-# Implement the "info proc" command.
-M;void;info_proc;const char *args, enum info_proc_what what;args, what
-
-# Implement the "info proc" command for core files.  Noe that there
-# are two "info_proc"-like methods on gdbarch -- one for core files,
-# one for live targets.
-M;void;core_info_proc;const char *args, enum info_proc_what what;args, what
-
-# Iterate over all objfiles in the order that makes the most sense
-# for the architecture to make global symbol searches.
-#
-# CB is a callback function where OBJFILE is the objfile to be searched,
-# and CB_DATA a pointer to user-defined data (the same data that is passed
-# when calling this gdbarch method).  The iteration stops if this function
-# returns nonzero.
-#
-# CB_DATA is a pointer to some user-defined data to be passed to
-# the callback.
-#
-# If not NULL, CURRENT_OBJFILE corresponds to the objfile being
-# inspected when the symbol search was requested.
-m;void;iterate_over_objfiles_in_search_order;iterate_over_objfiles_in_search_order_cb_ftype *cb, void *cb_data, struct objfile *current_objfile;cb, cb_data, current_objfile;0;default_iterate_over_objfiles_in_search_order;;0
-
-# Ravenscar arch-dependent ops.
-v;struct ravenscar_arch_ops *;ravenscar_ops;;;NULL;NULL;;0;host_address_to_string (gdbarch->ravenscar_ops)
-
-# Return non-zero if the instruction at ADDR is a call; zero otherwise.
-m;int;insn_is_call;CORE_ADDR addr;addr;;default_insn_is_call;;0
-
-# Return non-zero if the instruction at ADDR is a return; zero otherwise.
-m;int;insn_is_ret;CORE_ADDR addr;addr;;default_insn_is_ret;;0
-
-# Return non-zero if the instruction at ADDR is a jump; zero otherwise.
-m;int;insn_is_jump;CORE_ADDR addr;addr;;default_insn_is_jump;;0
-
-# Return true if there's a program/permanent breakpoint planted in
-# memory at ADDRESS, return false otherwise.
-m;bool;program_breakpoint_here_p;CORE_ADDR address;address;;default_program_breakpoint_here_p;;0
-
-# Read one auxv entry from *READPTR, not reading locations >= ENDPTR.
-# Return 0 if *READPTR is already at the end of the buffer.
-# Return -1 if there is insufficient buffer for a whole entry.
-# Return 1 if an entry was read into *TYPEP and *VALP.
-M;int;auxv_parse;gdb_byte **readptr, gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp;readptr, endptr, typep, valp
-
-# Print the description of a single auxv entry described by TYPE and VAL
-# to FILE.
-m;void;print_auxv_entry;struct ui_file *file, CORE_ADDR type, CORE_ADDR val;file, type, val;;default_print_auxv_entry;;0
-
-# Find the address range of the current inferior's vsyscall/vDSO, and
-# write it to *RANGE.  If the vsyscall's length can't be determined, a
-# range with zero length is returned.  Returns true if the vsyscall is
-# found, false otherwise.
-m;int;vsyscall_range;struct mem_range *range;range;;default_vsyscall_range;;0
-
-# Allocate SIZE bytes of PROT protected page aligned memory in inferior.
-# PROT has GDB_MMAP_PROT_* bitmask format.
-# Throw an error if it is not possible.  Returned address is always valid.
-f;CORE_ADDR;infcall_mmap;CORE_ADDR size, unsigned prot;size, prot;;default_infcall_mmap;;0
-
-# Deallocate SIZE bytes of memory at ADDR in inferior from gdbarch_infcall_mmap.
-# Print a warning if it is not possible.
-f;void;infcall_munmap;CORE_ADDR addr, CORE_ADDR size;addr, size;;default_infcall_munmap;;0
-
-# Return string (caller has to use xfree for it) with options for GCC
-# to produce code for this target, typically "-m64", "-m32" or "-m31".
-# These options are put before CU's DW_AT_producer compilation options so that
-# they can override it.
-m;std::string;gcc_target_options;void;;;default_gcc_target_options;;0
-
-# Return a regular expression that matches names used by this
-# architecture in GNU configury triplets.  The result is statically
-# allocated and must not be freed.  The default implementation simply
-# returns the BFD architecture name, which is correct in nearly every
-# case.
-m;const char *;gnu_triplet_regexp;void;;;default_gnu_triplet_regexp;;0
-
-# Return the size in 8-bit bytes of an addressable memory unit on this
-# architecture.  This corresponds to the number of 8-bit bytes associated to
-# each address in memory.
-m;int;addressable_memory_unit_size;void;;;default_addressable_memory_unit_size;;0
-
-# Functions for allowing a target to modify its disassembler options.
-v;const char *;disassembler_options_implicit;;;0;0;;0;pstring (gdbarch->disassembler_options_implicit)
-v;char **;disassembler_options;;;0;0;;0;pstring_ptr (gdbarch->disassembler_options)
-v;const disasm_options_and_args_t *;valid_disassembler_options;;;0;0;;0;host_address_to_string (gdbarch->valid_disassembler_options)
-
-# Type alignment override method.  Return the architecture specific
-# alignment required for TYPE.  If there is no special handling
-# required for TYPE then return the value 0, GDB will then apply the
-# default rules as laid out in gdbtypes.c:type_align.
-m;ULONGEST;type_align;struct type *type;type;;default_type_align;;0
-
-# Return a string containing any flags for the given PC in the given FRAME.
-f;std::string;get_pc_address_flags;frame_info *frame, CORE_ADDR pc;frame, pc;;default_get_pc_address_flags;;0
-
-# Read core file mappings
-m;void;read_core_file_mappings;struct bfd *cbfd, read_core_file_mappings_pre_loop_ftype pre_loop_cb, read_core_file_mappings_loop_ftype loop_cb;cbfd, pre_loop_cb, loop_cb;;default_read_core_file_mappings;;0
-
-EOF
-}
-
-#
-# The .log file
-#
-exec > gdbarch.log
-function_list | while do_read
-do
-    cat <<EOF
-${class} ${returntype:-} ${function} (${formal:-})
-EOF
-    for r in ${read}
-    do
-	eval echo "\"    ${r}=\${${r}}\""
-    done
-    if class_is_predicate_p && fallback_default_p
-    then
-	echo "Error: predicate function ${function} can not have a non- multi-arch default" 1>&2
-	kill $$
-	exit 1
-    fi
-    if [ "x${invalid_p}" = "x0" ] && [ -n "${postdefault}" ]
-    then
-	echo "Error: postdefault is useless when invalid_p=0" 1>&2
-	kill $$
-	exit 1
-    fi
-    if class_is_multiarch_p
-    then
-	if class_is_predicate_p ; then :
-	elif test "x${predefault}" = "x"
-	then
-	    echo "Error: pure multi-arch function ${function} must have a predefault" 1>&2
-	    kill $$
-	    exit 1
-	fi
-    fi
-    echo ""
-done
-
-exec 1>&2
-
-
-copyright ()
-{
-cat <<EOF
-/* *INDENT-OFF* */ /* THIS FILE IS GENERATED -*- buffer-read-only: t -*- */
-/* vi:set ro: */
-
-/* Dynamic architecture support for GDB, the GNU debugger.
-
-   Copyright (C) 1998-2021 Free Software Foundation, Inc.
-
-   This file is part of GDB.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* This file was created with the aid of \`\`gdbarch.sh''.  */
-
-EOF
-}
-
-exec > new-gdbarch-gen.h
-copyright
-
-# function typedef's
-printf "\n"
-printf "\n"
-printf "/* The following are pre-initialized by GDBARCH.  */\n"
-function_list | while do_read
-do
-    if class_is_info_p
-    then
-	printf "\n"
-	printf "extern %s gdbarch_%s (struct gdbarch *gdbarch);\n" "$returntype" "$function"
-	printf "/* set_gdbarch_%s() - not applicable - pre-initialized.  */\n" "$function"
-    fi
-done
-
-# function typedef's
-printf "\n"
-printf "\n"
-printf "/* The following are initialized by the target dependent code.  */\n"
-function_list | while do_read
-do
-    if [ -n "${comment}" ]
-    then
-	echo "${comment}" | sed \
-	    -e '2 s,#,/*,' \
-	    -e '3,$ s,#,  ,' \
-	    -e '$ s,$, */,'
-    fi
-
-    if class_is_predicate_p
-    then
-	printf "\n"
-	printf "extern bool gdbarch_%s_p (struct gdbarch *gdbarch);\n" "$function"
-    fi
-    if class_is_variable_p
-    then
-	printf "\n"
-	printf "extern %s gdbarch_%s (struct gdbarch *gdbarch);\n" "$returntype" "$function"
-	printf "extern void set_gdbarch_%s (struct gdbarch *gdbarch, %s %s);\n" "$function" "$returntype" "$function"
-    fi
-    if class_is_function_p
-    then
-	printf "\n"
-	if [ "x${formal}" = "xvoid" ] && class_is_multiarch_p
-	then
-	    printf "typedef %s (gdbarch_%s_ftype) (struct gdbarch *gdbarch);\n" "$returntype" "$function"
-	elif class_is_multiarch_p
-	then
-	    printf "typedef %s (gdbarch_%s_ftype) (struct gdbarch *gdbarch, %s);\n" "$returntype" "$function" "$formal"
-	else
-	    printf "typedef %s (gdbarch_%s_ftype) (%s);\n" "$returntype" "$function" "$formal"
-	fi
-	if [ "x${formal}" = "xvoid" ]
-	then
-	  printf "extern %s gdbarch_%s (struct gdbarch *gdbarch);\n" "$returntype" "$function"
-	else
-	  printf "extern %s gdbarch_%s (struct gdbarch *gdbarch, %s);\n" "$returntype" "$function" "$formal"
-	fi
-	printf "extern void set_gdbarch_%s (struct gdbarch *gdbarch, gdbarch_%s_ftype *%s);\n" "$function" "$function" "$function"
-    fi
-done
-
-exec 1>&2
-../move-if-change new-gdbarch-gen.h gdbarch-gen.h
-rm -f new-gdbarch-gen.h
-
-
-#
-# C file
-#
-
-exec > new-gdbarch.c
-copyright
-
-# gdbarch open the gdbarch object
-printf "\n"
-printf "/* Maintain the struct gdbarch object.  */\n"
-printf "\n"
-printf "struct gdbarch\n"
-printf "{\n"
-printf "  /* Has this architecture been fully initialized?  */\n"
-printf "  int initialized_p;\n"
-printf "\n"
-printf "  /* An obstack bound to the lifetime of the architecture.  */\n"
-printf "  struct obstack *obstack;\n"
-printf "\n"
-printf "  /* basic architectural information.  */\n"
-function_list | while do_read
-do
-    if class_is_info_p
-    then
-	printf "  %s %s;\n" "$returntype" "$function"
-    fi
-done
-printf "\n"
-printf "  /* target specific vector.  */\n"
-printf "  struct gdbarch_tdep *tdep;\n"
-printf "  gdbarch_dump_tdep_ftype *dump_tdep;\n"
-printf "\n"
-printf "  /* per-architecture data-pointers.  */\n"
-printf "  unsigned nr_data;\n"
-printf "  void **data;\n"
-printf "\n"
-cat <<EOF
-  /* Multi-arch values.
-
-     When extending this structure you must:
-
-     Add the field below.
-
-     Declare set/get functions and define the corresponding
-     macro in gdbarch.h.
-
-     gdbarch_alloc(): If zero/NULL is not a suitable default,
-     initialize the new field.
-
-     verify_gdbarch(): Confirm that the target updated the field
-     correctly.
-
-     gdbarch_dump(): Add a fprintf_unfiltered call so that the new
-     field is dumped out
-
-     get_gdbarch(): Implement the set/get functions (probably using
-     the macro's as shortcuts).
-
-     */
-
-EOF
-function_list | while do_read
-do
-    if class_is_variable_p
-    then
-	printf "  %s %s;\n" "$returntype" "$function"
-    elif class_is_function_p
-    then
-	printf "  gdbarch_%s_ftype *%s;\n" "$function" "$function"
-    fi
-done
-printf "};\n"
-
-# Create a new gdbarch struct
-cat <<EOF
-
-/* Create a new \`\`struct gdbarch'' based on information provided by
-   \`\`struct gdbarch_info''.  */
-EOF
-printf "\n"
-cat <<EOF
-struct gdbarch *
-gdbarch_alloc (const struct gdbarch_info *info,
-	       struct gdbarch_tdep *tdep)
-{
-  struct gdbarch *gdbarch;
-
-  /* Create an obstack for allocating all the per-architecture memory,
-     then use that to allocate the architecture vector.  */
-  struct obstack *obstack = XNEW (struct obstack);
-  obstack_init (obstack);
-  gdbarch = XOBNEW (obstack, struct gdbarch);
-  memset (gdbarch, 0, sizeof (*gdbarch));
-  gdbarch->obstack = obstack;
-
-  alloc_gdbarch_data (gdbarch);
-
-  gdbarch->tdep = tdep;
-EOF
-printf "\n"
-function_list | while do_read
-do
-    if class_is_info_p
-    then
-	printf "  gdbarch->%s = info->%s;\n" "$function" "$function"
-    fi
-done
-printf "\n"
-printf "  /* Force the explicit initialization of these.  */\n"
-function_list | while do_read
-do
-    if class_is_function_p || class_is_variable_p
-    then
-	if [ -n "${predefault}" ] && [ "x${predefault}" != "x0" ]
-	then
-	  printf "  gdbarch->%s = %s;\n" "$function" "$predefault"
-	fi
-    fi
-done
-cat <<EOF
-  /* gdbarch_alloc() */
-
-  return gdbarch;
-}
-EOF
-
-# Free a gdbarch struct.
-printf "\n"
-
-# verify a new architecture
-cat <<EOF
-
-
-/* Ensure that all values in a GDBARCH are reasonable.  */
-
-static void
-verify_gdbarch (struct gdbarch *gdbarch)
-{
-  string_file log;
-
-  /* fundamental */
-  if (gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
-    log.puts ("\n\tbyte-order");
-  if (gdbarch->bfd_arch_info == NULL)
-    log.puts ("\n\tbfd_arch_info");
-  /* Check those that need to be defined for the given multi-arch level.  */
-EOF
-function_list | while do_read
-do
-    if class_is_function_p || class_is_variable_p
-    then
-	if [ "x${invalid_p}" = "x0" ]
-	then
-	    printf "  /* Skip verify of %s, invalid_p == 0 */\n" "$function"
-	elif class_is_predicate_p
-	then
-	    printf "  /* Skip verify of %s, has predicate.  */\n" "$function"
-	# FIXME: See do_read for potential simplification
-	elif [ -n "${invalid_p}" ] && [ -n "${postdefault}" ]
-	then
-	    printf "  if (%s)\n" "$invalid_p"
-	    printf "    gdbarch->%s = %s;\n" "$function" "$postdefault"
-	elif [ -n "${predefault}" ] && [ -n "${postdefault}" ]
-	then
-	    printf "  if (gdbarch->%s == %s)\n" "$function" "$predefault"
-	    printf "    gdbarch->%s = %s;\n" "$function" "$postdefault"
-	elif [ -n "${postdefault}" ]
-	then
-	    printf "  if (gdbarch->%s == 0)\n" "$function"
-	    printf "    gdbarch->%s = %s;\n" "$function" "$postdefault"
-	elif [ -n "${invalid_p}" ]
-	then
-	    printf "  if (%s)\n" "$invalid_p"
-	    printf "    log.puts (\"\\\\n\\\\t%s\");\n" "$function"
-	elif [ -n "${predefault}" ]
-	then
-	    printf "  if (gdbarch->%s == %s)\n" "$function" "$predefault"
-	    printf "    log.puts (\"\\\\n\\\\t%s\");\n" "$function"
-	fi
-    fi
-done
-cat <<EOF
-  if (!log.empty ())
-    internal_error (__FILE__, __LINE__,
-		    _("verify_gdbarch: the following are invalid ...%s"),
-		    log.c_str ());
-}
-EOF
-
-# dump the structure
-printf "\n"
-printf "\n"
-cat <<EOF
-/* Print out the details of the current architecture.  */
-
-void
-gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
-{
-  const char *gdb_nm_file = "<not-defined>";
-
-#if defined (GDB_NM_FILE)
-  gdb_nm_file = GDB_NM_FILE;
-#endif
-  fprintf_unfiltered (file,
-		      "gdbarch_dump: GDB_NM_FILE = %s\\n",
-		      gdb_nm_file);
-EOF
-function_list | while do_read
-do
-    # First the predicate
-    if class_is_predicate_p
-    then
-	printf "  fprintf_unfiltered (file,\n"
-	printf "                      \"gdbarch_dump: gdbarch_%s_p() = %%d\\\\n\",\n" "$function"
-	printf "                      gdbarch_%s_p (gdbarch));\n" "$function"
-    fi
-    # Print the corresponding value.
-    if class_is_function_p
-    then
-	printf "  fprintf_unfiltered (file,\n"
-	printf "                      \"gdbarch_dump: %s = <%%s>\\\\n\",\n" "$function"
-	printf "                      host_address_to_string (gdbarch->%s));\n" "$function"
-    else
-	# It is a variable
-	case "${print}:${returntype}" in
-	    :CORE_ADDR )
-		fmt="%s"
-		print="core_addr_to_string_nz (gdbarch->${function})"
-		;;
-	    :* )
-		fmt="%s"
-		print="plongest (gdbarch->${function})"
-		;;
-	    * )
-		fmt="%s"
-		;;
-	esac
-	printf "  fprintf_unfiltered (file,\n"
-	printf "                      \"gdbarch_dump: %s = %s\\\\n\",\n" "$function" "$fmt"
-	printf "                      %s);\n" "$print"
-    fi
-done
-cat <<EOF
-  if (gdbarch->dump_tdep != NULL)
-    gdbarch->dump_tdep (gdbarch, file);
-}
-EOF
-
-
-printf "\n"
-function_list | while do_read
-do
-    if class_is_predicate_p
-    then
-	printf "\n"
-	printf "bool\n"
-	printf "gdbarch_%s_p (struct gdbarch *gdbarch)\n" "$function"
-	printf "{\n"
-	printf "  gdb_assert (gdbarch != NULL);\n"
-	printf "  return %s;\n" "$predicate"
-	printf "}\n"
-    fi
-    if class_is_function_p
-    then
-	printf "\n"
-	printf "%s\n" "$returntype"
-	if [ "x${formal}" = "xvoid" ]
-	then
-	  printf "gdbarch_%s (struct gdbarch *gdbarch)\n" "$function"
-	else
-	  printf "gdbarch_%s (struct gdbarch *gdbarch, %s)\n" "$function" "$formal"
-	fi
-	printf "{\n"
-	printf "  gdb_assert (gdbarch != NULL);\n"
-	printf "  gdb_assert (gdbarch->%s != NULL);\n" "$function"
-	if class_is_predicate_p && test -n "${predefault}"
-	then
-	    # Allow a call to a function with a predicate.
-	    printf "  /* Do not check predicate: %s, allow call.  */\n" "$predicate"
-	fi
-	printf "  if (gdbarch_debug >= 2)\n"
-	printf "    fprintf_unfiltered (gdb_stdlog, \"gdbarch_%s called\\\\n\");\n" "$function"
-	if [ "x${actual:-}" = "x-" ] || [ "x${actual:-}" = "x" ]
-	then
-	    if class_is_multiarch_p
-	    then
-		params="gdbarch"
-	    else
-		params=""
-	    fi
-	else
-	    if class_is_multiarch_p
-	    then
-		params="gdbarch, ${actual}"
-	    else
-		params="${actual}"
-	    fi
-	fi
-       	if [ "x${returntype}" = "xvoid" ]
-	then
-	  printf "  gdbarch->%s (%s);\n" "$function" "$params"
-	else
-	  printf "  return gdbarch->%s (%s);\n" "$function" "$params"
-	fi
-	printf "}\n"
-	printf "\n"
-	printf "void\n"
-	printf "set_gdbarch_%s (struct gdbarch *gdbarch,\n" "$function"
-	printf "            %s  gdbarch_%s_ftype %s)\n" "$(echo "$function" | sed -e 's/./ /g')" "$function" "$function"
-	printf "{\n"
-	printf "  gdbarch->%s = %s;\n" "$function" "$function"
-	printf "}\n"
-    elif class_is_variable_p
-    then
-	printf "\n"
-	printf "%s\n" "$returntype"
-	printf "gdbarch_%s (struct gdbarch *gdbarch)\n" "$function"
-	printf "{\n"
-	printf "  gdb_assert (gdbarch != NULL);\n"
-	if [ "x${invalid_p}" = "x0" ]
-	then
-	    printf "  /* Skip verify of %s, invalid_p == 0 */\n" "$function"
-	elif [ -n "${invalid_p}" ]
-	then
-	    printf "  /* Check variable is valid.  */\n"
-	    printf "  gdb_assert (!(%s));\n" "$invalid_p"
-	elif [ -n "${predefault}" ]
-	then
-	    printf "  /* Check variable changed from pre-default.  */\n"
-	    printf "  gdb_assert (gdbarch->%s != %s);\n" "$function" "$predefault"
-	fi
-	printf "  if (gdbarch_debug >= 2)\n"
-	printf "    fprintf_unfiltered (gdb_stdlog, \"gdbarch_%s called\\\\n\");\n" "$function"
-	printf "  return gdbarch->%s;\n" "$function"
-	printf "}\n"
-	printf "\n"
-	printf "void\n"
-	printf "set_gdbarch_%s (struct gdbarch *gdbarch,\n" "$function"
-	printf "            %s  %s %s)\n" "$(echo "$function" | sed -e 's/./ /g')" "$returntype" "$function"
-	printf "{\n"
-	printf "  gdbarch->%s = %s;\n" "$function" "$function"
-	printf "}\n"
-    elif class_is_info_p
-    then
-	printf "\n"
-	printf "%s\n" "$returntype"
-	printf "gdbarch_%s (struct gdbarch *gdbarch)\n" "$function"
-	printf "{\n"
-	printf "  gdb_assert (gdbarch != NULL);\n"
-	printf "  if (gdbarch_debug >= 2)\n"
-	printf "    fprintf_unfiltered (gdb_stdlog, \"gdbarch_%s called\\\\n\");\n" "$function"
-	printf "  return gdbarch->%s;\n" "$function"
-	printf "}\n"
-    fi
-done
-
-# close things off
-exec 1>&2
-../move-if-change new-gdbarch.c gdbarch.c
-rm -f new-gdbarch.c
-
-exec > gdbarch-components.py
-copyright | sed 1,3d | grep -v 'was created' |
-    sed -e 's,/\*,  ,' -e 's, *\*/,,' -e 's/^  /#/'
-
-function_list | while do_read
-do
-    printf "\n"
-    if class_is_info_p; then
-	printf Info
-    elif class_is_variable_p; then
-	printf Value
-    elif class_is_multiarch_p; then
-	printf Method
-    elif class_is_function_p; then
-	printf Function
-    else
-	echo FAILURE 1>&2
-	exit 1
-    fi
-    printf "(\n"
-    if [ -n "${comment}" ]
-    then
-	printf "    comment=\"\"\""
-	echo "${comment}" | sed 's/^# *//'
-	printf "\"\"\",\n"
-    fi
-
-    printf "    name=\"%s\",\n" "$function"
-    printf "    type=\"%s\",\n" "$returntype"
-    if class_is_predicate_p; then
-	printf "    predicate=True,\n"
-    fi
-    if ! class_is_info_p; then
-	if test -n "$predefault"; then
-	    printf "    predefault=\"%s\",\n" "$predefault"
-	fi
-	# We can ignore 'actual' and 'staticdefault'.
-	if test -n "$postdefault"; then
-	    printf "    postdefault=\"%s\",\n" "$postdefault"
-	fi
-	# Let's arrange for False to mean suppress checking, and True
-	# to mean default checking.
-	if test "$invalid_p" = "0"; then
-	    printf "    invalid=False,\n"
-	elif test "$invalid_p" = ""; then
-	    printf "    invalid=True,\n"
-	else
-	    printf "    invalid=\"%s\",\n" "$invalid_p"
-	fi
-	if class_is_function_p; then
-	    if test -n "$formal" && test "$formal" != void; then
-		printf "    params=(\n"
-		# Turn TYPE NAME into ("TYPE", "NAME").
-		echo "$formal" | sed -e "s/, */\n/g" |
-		    sed -e 's/ *\([a-zA-Z_][a-zA-Z0-9_]*\)$/", "\1"),/' |
-		    sed -e 's/^/        ("/'
-		printf "    ),\n"
-	    else
-		printf "    params=(),\n"
-	    fi
-	fi
-    fi
-    if test -n "$print"; then
-	printf "    printer=\"%s\",\n" "$print"
-    fi
-    printf ")\n"
-done
-
-exec 1>&2
-black gdbarch-components.py
-- 
2.31.1


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v2 8/8] Document gdbarch-components.py
  2021-12-16 20:38 [PATCH v2 0/8] Rewrite gdbarch.sh in Python Tom Tromey
                   ` (6 preceding siblings ...)
  2021-12-16 20:38 ` [PATCH v2 7/8] Remove gdbarch.sh Tom Tromey
@ 2021-12-16 20:38 ` Tom Tromey
  2021-12-17  5:29 ` [PATCH v2 0/8] Rewrite gdbarch.sh in Python Simon Marchi
  8 siblings, 0 replies; 21+ messages in thread
From: Tom Tromey @ 2021-12-16 20:38 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This adds a comment to document how to update gdbarch.
---
 gdb/gdbarch-components.py | 82 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 82 insertions(+)

diff --git a/gdb/gdbarch-components.py b/gdb/gdbarch-components.py
index 2a85655b0f6..fe5b8111f01 100644
--- a/gdb/gdbarch-components.py
+++ b/gdb/gdbarch-components.py
@@ -17,6 +17,88 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# How to add to gdbarch:
+#
+# There are four kinds of fields in gdbarch:
+#
+# * Info - you should never need this; it is only for things that are
+# copied directly from the gdbarch_info.
+#
+# * Value - a variable.
+#
+# * Function - a function pointer.
+#
+# * Method - a function pointer, but the function takes a gdbarch as
+# its first parameter.
+#
+# You construct a new one with a call to one of those functions.  So,
+# for instance, you can use the function named "Value" to make a new
+# Value.
+#
+# All parameters are keyword-only.  This is done to help catch typos.
+#
+# Some parameters are shared among all types (including Info):
+#
+# * "name" - required, the name of the field.
+#
+# * "type" - required, the type of the field.  For functions and
+# methods, this is the return type.
+#
+# * "printer" - an expression to turn this field into a 'const char
+# *'.  This is used for dumping.  The string must live long enough to
+# be passed to printf.
+#
+# Value, Function, and Method share some more parameters.  Some of
+# these work in conjunction in a somewhat complicated way, so they are
+# described in a separate sub-section below.
+#
+# * "comment" - a comment that's written to the .h file.  Please
+# always use this.  (It isn't currently a required option for
+# historical reasons.)
+#
+# * "predicate" - a boolean, if True then a _p predicate function will
+# be generated.  The predicate will use the generic validation
+# function for the field.  See below.
+#
+# * "predefault", "postdefault", and "invalid" - These are used for
+# the initialization and verification steps:
+#
+# A gdbarch is zero-initialized.  Then, if a field has a pre-default,
+# the field is set to that value.  After initialization is complete
+# (that is, after the tdep code has a change to change the settings),
+# the post-initialization step is done.
+#
+# There is a generic algorithm to generate a "validation function" for
+# all fields.  If the field has an "invalid" attribute with a string
+# value, then this string is the expression (note that a string-valued
+# "invalid" and "predicate" are mutually exclusive; and the case where
+# invalid is True means to ignore this field and instead use the
+# default checking that is about to be described).  Otherwise, if
+# there is a "predefault", then the field is valid if it differs from
+# the predefault.  Otherwise, the check is done against 0 (really NULL
+# for function pointers, but same idea).
+#
+# In post-initialization / validation, there are several cases.
+#
+# * If "invalid" is False, or if the field specifies "predicate",
+# validation is skipped.  Otherwise, a validation step is emitted.
+#
+# * Otherwise, the validity is checked using the usual validation
+# function (see above).  If the field is considered valid, nothing is
+# done.
+#
+# * Otherwise, the field's value is invalid.  If there is a
+# "postdefault", then the field is assigned that value.
+#
+# * Otherwise, the gdbarch will fail validation and gdb will crash.
+#
+# Function and Method share:
+#
+# * "params" - required, a tuple of tuples.  Each inner tuple is a
+# pair of the form (TYPE, NAME), where TYPE is the type of this
+# argument, and NAME is the name.  Note that while the names could be
+# auto-generated, this approach lets the "comment" field refer to
+# arguments in a nicer way.  It is also just nicer for users.
 
 Info(
     name="bfd_arch_info",
-- 
2.31.1


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 0/8] Rewrite gdbarch.sh in Python
  2021-12-16 20:38 [PATCH v2 0/8] Rewrite gdbarch.sh in Python Tom Tromey
                   ` (7 preceding siblings ...)
  2021-12-16 20:38 ` [PATCH v2 8/8] Document gdbarch-components.py Tom Tromey
@ 2021-12-17  5:29 ` Simon Marchi
  2021-12-17 15:01   ` Tom Tromey
  8 siblings, 1 reply; 21+ messages in thread
From: Simon Marchi @ 2021-12-17  5:29 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches

On 2021-12-16 15:38, Tom Tromey wrote:
> Here's v2 of the series to rewrite gdbarch.sh in Python.  I think this
> version addresses all the review comments.
> 
> Let me know what you think.

Thanks, LGTM from my side.  I noticed we are using some f-strings in the
code.  They are available starting at Python 3.6.  We support building
GDB against older Python libs than that (including Python 2.7, still).
But since this is a development-only dependency, and Python 3.6 has been
there for a while (it is the default python3 version in Ubuntu 18.04,
for example), I think this is ok.

Simon

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 0/8] Rewrite gdbarch.sh in Python
  2021-12-17  5:29 ` [PATCH v2 0/8] Rewrite gdbarch.sh in Python Simon Marchi
@ 2021-12-17 15:01   ` Tom Tromey
  2021-12-17 16:18     ` Simon Marchi
  0 siblings, 1 reply; 21+ messages in thread
From: Tom Tromey @ 2021-12-17 15:01 UTC (permalink / raw)
  To: Simon Marchi; +Cc: Tom Tromey, gdb-patches

Simon> I noticed we are using some f-strings in the code.  They are
Simon> available starting at Python 3.6.

FWIW I think the keyword-argument-only approach is also a Python 3-ism.

Tom

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 0/8] Rewrite gdbarch.sh in Python
  2021-12-17 15:01   ` Tom Tromey
@ 2021-12-17 16:18     ` Simon Marchi
  0 siblings, 0 replies; 21+ messages in thread
From: Simon Marchi @ 2021-12-17 16:18 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 2021-12-17 10:01 a.m., Tom Tromey wrote:
> Simon> I noticed we are using some f-strings in the code.  They are
> Simon> available starting at Python 3.6.
> 
> FWIW I think the keyword-argument-only approach is also a Python 3-ism.
> 
> Tom
> 

Perhaps, I didn't even know about this before reading your patch.  I think
it's a good idea to force callers to be descriptive.

Simon

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 5/8] Generate new gdbarch-components.py from gdbarch.sh
  2021-12-16 20:38 ` [PATCH v2 5/8] Generate new gdbarch-components.py from gdbarch.sh Tom Tromey
@ 2021-12-17 18:32   ` Pedro Alves
  2021-12-17 18:55     ` Simon Marchi
                       ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Pedro Alves @ 2021-12-17 18:32 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches

On 2021-12-16 20:38, Tom Tromey wrote:
> +    params=(("readable_regcache *", "regcache"),),

This gave me pause, until I saw an entry with more than one argument.  Do you think it would be possible
to tweak the generator to avoid putting the comma after the last entry, so that we'd get:

     params=(("readable_regcache *", "regcache")),

?


Also, I'd suggest putting params right after type, so that the function's prototype is all together:

I.e., instead of:

 Method(
     comment="""
 Provide a default mapping from a DWARF2 register number to a gdb REGNUM.
 Return -1 for bad REGNUM.  Note: Several targets get this wrong.
 """,
     name="dwarf2_reg_to_regnum",
     type="int",
     predefault="no_op_reg_to_regnum",
     invalid=False,
     params=(("int", "dwarf2_regnr"),),
 )

This:

 Method(
     comment="""
 Provide a default mapping from a DWARF2 register number to a gdb REGNUM.
 Return -1 for bad REGNUM.  Note: Several targets get this wrong.
 """,
     name="dwarf2_reg_to_regnum",
     type="int",
     params=(("int", "dwarf2_regnr"),),
     predefault="no_op_reg_to_regnum",
     invalid=False,
 )

The latter seems easier to eyeball to me.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 6/8] Add new gdbarch generator
  2021-12-16 20:38 ` [PATCH v2 6/8] Add new gdbarch generator Tom Tromey
@ 2021-12-17 18:33   ` Pedro Alves
  2021-12-17 18:50     ` Simon Marchi
  2021-12-17 21:54     ` Tom Tromey
  0 siblings, 2 replies; 21+ messages in thread
From: Pedro Alves @ 2021-12-17 18:33 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches; +Cc: Simon Marchi

On 2021-12-16 20:38, Tom Tromey wrote:
> From: Simon Marchi <simon.marchi@efficios.com>
> 
> The new gdbarch generator is a Python program.  It reads the
> "components.py" that was created in the previous patch, and generates
> gdbarch.c and gdbarch-gen.h.
> 
> This was initially written by Simon, so I've put him as the author.
> Thank you, Simon.

This sentence will read funny once this is committed, since he's the commit author
and no other name appears in the commit log.  Like, anyone reading this there will
go "but who is talking?"  :-)

I'd remove it here and add your name as Co-Authored-By:.

This is all super awesome, BTW.  Thank you both for doing this.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 6/8] Add new gdbarch generator
  2021-12-17 18:33   ` Pedro Alves
@ 2021-12-17 18:50     ` Simon Marchi
  2021-12-17 21:54     ` Tom Tromey
  1 sibling, 0 replies; 21+ messages in thread
From: Simon Marchi @ 2021-12-17 18:50 UTC (permalink / raw)
  To: Pedro Alves, Tom Tromey, gdb-patches; +Cc: Simon Marchi

On 2021-12-17 1:33 p.m., Pedro Alves wrote:
> On 2021-12-16 20:38, Tom Tromey wrote:
>> From: Simon Marchi <simon.marchi@efficios.com>
>>
>> The new gdbarch generator is a Python program.  It reads the
>> "components.py" that was created in the previous patch, and generates
>> gdbarch.c and gdbarch-gen.h.
>>
>> This was initially written by Simon, so I've put him as the author.
>> Thank you, Simon.
>
> This sentence will read funny once this is committed, since he's the commit author
> and no other name appears in the commit log.  Like, anyone reading this there will
> go "but who is talking?"  :-)
>
> I'd remove it here and add your name as Co-Authored-By:.

Haha, I agree :).  Or you as the author and me as Co-Authored-By, since
you are the final author.  Doesn't matter either way.

Simon

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 5/8] Generate new gdbarch-components.py from gdbarch.sh
  2021-12-17 18:32   ` Pedro Alves
@ 2021-12-17 18:55     ` Simon Marchi
  2021-12-17 19:26     ` John Baldwin
  2021-12-17 21:52     ` Tom Tromey
  2 siblings, 0 replies; 21+ messages in thread
From: Simon Marchi @ 2021-12-17 18:55 UTC (permalink / raw)
  To: Pedro Alves, Tom Tromey, gdb-patches

On 2021-12-17 1:32 p.m., Pedro Alves wrote:
> On 2021-12-16 20:38, Tom Tromey wrote:
>> +    params=(("readable_regcache *", "regcache"),),
>
> This gave me pause, until I saw an entry with more than one argument.  Do you think it would be possible
> to tweak the generator to avoid putting the comma after the last entry, so that we'd get:
>
>      params=(("readable_regcache *", "regcache")),
>
> ?

No, because that would not mean the same thing:

    In [1]: ((1, 2),)
    Out[1]: ((1, 2),)

    In [2]: ((1, 2))
    Out[2]: (1, 2)


The latter does not yield a tuple with a tuple with two integers, it
just yields a tuple with two integer.  The outer parenthesis are
interpreted as "arithmetic" parenthesis (not sure how to call them, the
kind of parenthesis you use to force order of expression evaluation).
Having the comma there forces it to be interpreted as a tuple.

> Also, I'd suggest putting params right after type, so that the function's prototype is all together:
>
> I.e., instead of:
>
>  Method(
>      comment="""
>  Provide a default mapping from a DWARF2 register number to a gdb REGNUM.
>  Return -1 for bad REGNUM.  Note: Several targets get this wrong.
>  """,
>      name="dwarf2_reg_to_regnum",
>      type="int",
>      predefault="no_op_reg_to_regnum",
>      invalid=False,
>      params=(("int", "dwarf2_regnr"),),
>  )
>
> This:
>
>  Method(
>      comment="""
>  Provide a default mapping from a DWARF2 register number to a gdb REGNUM.
>  Return -1 for bad REGNUM.  Note: Several targets get this wrong.
>  """,
>      name="dwarf2_reg_to_regnum",
>      type="int",
>      params=(("int", "dwarf2_regnr"),),
>      predefault="no_op_reg_to_regnum",
>      invalid=False,
>  )
>
> The latter seems easier to eyeball to me.

Sounds like a good idea to me, if it's not too difficult.

Simon

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 5/8] Generate new gdbarch-components.py from gdbarch.sh
  2021-12-17 18:32   ` Pedro Alves
  2021-12-17 18:55     ` Simon Marchi
@ 2021-12-17 19:26     ` John Baldwin
  2021-12-17 21:53       ` Tom Tromey
  2021-12-17 21:52     ` Tom Tromey
  2 siblings, 1 reply; 21+ messages in thread
From: John Baldwin @ 2021-12-17 19:26 UTC (permalink / raw)
  To: Pedro Alves, Tom Tromey, gdb-patches

On 12/17/21 10:32 AM, Pedro Alves wrote:
> On 2021-12-16 20:38, Tom Tromey wrote:
>> +    params=(("readable_regcache *", "regcache"),),
> 
> This gave me pause, until I saw an entry with more than one argument.  Do you think it would be possible
> to tweak the generator to avoid putting the comma after the last entry, so that we'd get:
> 
>       params=(("readable_regcache *", "regcache")),
> 
> ?
> 
> 
> Also, I'd suggest putting params right after type, so that the function's prototype is all together:
> 
> I.e., instead of:
> 
>   Method(
>       comment="""
>   Provide a default mapping from a DWARF2 register number to a gdb REGNUM.
>   Return -1 for bad REGNUM.  Note: Several targets get this wrong.
>   """,
>       name="dwarf2_reg_to_regnum",
>       type="int",
>       predefault="no_op_reg_to_regnum",
>       invalid=False,
>       params=(("int", "dwarf2_regnr"),),
>   )
> 
> This:
> 
>   Method(
>       comment="""
>   Provide a default mapping from a DWARF2 register number to a gdb REGNUM.
>   Return -1 for bad REGNUM.  Note: Several targets get this wrong.
>   """,
>       name="dwarf2_reg_to_regnum",
>       type="int",
>       params=(("int", "dwarf2_regnr"),),
>       predefault="no_op_reg_to_regnum",
>       invalid=False,
>   )
> 
> The latter seems easier to eyeball to me.

If you moved 'type' up you'd almost have it match what ends up in C:

   Method(
       comment="""
   Provide a default mapping from a DWARF2 register number to a gdb REGNUM.
   Return -1 for bad REGNUM.  Note: Several targets get this wrong.
   """,
       type="int",
       name="dwarf2_reg_to_regnum",
       params=(("int", "dwarf2_regnr"),),
       predefault="no_op_reg_to_regnum",
       invalid=False,
   )

But any order is fine really.

-- 
John Baldwin

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 5/8] Generate new gdbarch-components.py from gdbarch.sh
  2021-12-17 18:32   ` Pedro Alves
  2021-12-17 18:55     ` Simon Marchi
  2021-12-17 19:26     ` John Baldwin
@ 2021-12-17 21:52     ` Tom Tromey
  2021-12-17 22:06       ` Tom Tromey
  2 siblings, 1 reply; 21+ messages in thread
From: Tom Tromey @ 2021-12-17 21:52 UTC (permalink / raw)
  To: Pedro Alves; +Cc: Tom Tromey, gdb-patches

>>>>> "Pedro" == Pedro Alves <pedro@palves.net> writes:

Pedro> This gave me pause, until I saw an entry with more than one
Pedro> argument.  Do you think it would be possible to tweak the
Pedro> generator to avoid putting the comma after the last entry, so
Pedro> that we'd get:
Pedro>      params=(("readable_regcache *", "regcache")),
Pedro> ?

As Simon and John pointed out, this isn't possible due to a quirk of
Python syntax:

    >>> (1,2) == ((1,2))
    True

However we can use a list instead.  This is mildly less idiomatic (it's
more normal, I think, to use tuples for non-extensible sequences) but
avoids the weirdess.  This will look like

     params=[("readable_regcache *", "regcache")]

I'll see if I can do this.

Tom

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 5/8] Generate new gdbarch-components.py from gdbarch.sh
  2021-12-17 19:26     ` John Baldwin
@ 2021-12-17 21:53       ` Tom Tromey
  0 siblings, 0 replies; 21+ messages in thread
From: Tom Tromey @ 2021-12-17 21:53 UTC (permalink / raw)
  To: John Baldwin; +Cc: Pedro Alves, Tom Tromey, gdb-patches

>>>>> "John" == John Baldwin <jhb@FreeBSD.org> writes:

John> If you moved 'type' up you'd almost have it match what ends up in C:

John>   Method(
John>       comment="""
John>   Provide a default mapping from a DWARF2 register number to a gdb REGNUM.
John>   Return -1 for bad REGNUM.  Note: Several targets get this wrong.
John>   """,
John>       type="int",
John>       name="dwarf2_reg_to_regnum",
John>       params=(("int", "dwarf2_regnr"),),

I'll look into it.

Tom

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 6/8] Add new gdbarch generator
  2021-12-17 18:33   ` Pedro Alves
  2021-12-17 18:50     ` Simon Marchi
@ 2021-12-17 21:54     ` Tom Tromey
  1 sibling, 0 replies; 21+ messages in thread
From: Tom Tromey @ 2021-12-17 21:54 UTC (permalink / raw)
  To: Pedro Alves; +Cc: Tom Tromey, gdb-patches, Simon Marchi

[...]
Pedro> I'd remove it here and add your name as Co-Authored-By:.

I did this.

Tom

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 5/8] Generate new gdbarch-components.py from gdbarch.sh
  2021-12-17 21:52     ` Tom Tromey
@ 2021-12-17 22:06       ` Tom Tromey
  0 siblings, 0 replies; 21+ messages in thread
From: Tom Tromey @ 2021-12-17 22:06 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Pedro Alves, gdb-patches

>>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:

Tom>      params=[("readable_regcache *", "regcache")]

Tom> I'll see if I can do this.

I did this.  black likes to change:

params=[
  x,
  y,
  z
]

into

params=[
  x,
  y,
  z,
]

... when it decides that each entry should have its own line.
It's like putting the trailing comma into an enum in C.

Anyway I think this is decent, so I'm going to go forward with this and
check it all in.

Tom

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2021-12-17 22:09 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-16 20:38 [PATCH v2 0/8] Rewrite gdbarch.sh in Python Tom Tromey
2021-12-16 20:38 ` [PATCH v2 1/8] Move ordinary gdbarch code to arch-utils Tom Tromey
2021-12-16 20:38 ` [PATCH v2 2/8] Split gdbarch.h into two files Tom Tromey
2021-12-16 20:38 ` [PATCH v2 3/8] Do not generate gdbarch.h Tom Tromey
2021-12-16 20:38 ` [PATCH v2 4/8] Do not sort the fields in gdbarch_dump Tom Tromey
2021-12-16 20:38 ` [PATCH v2 5/8] Generate new gdbarch-components.py from gdbarch.sh Tom Tromey
2021-12-17 18:32   ` Pedro Alves
2021-12-17 18:55     ` Simon Marchi
2021-12-17 19:26     ` John Baldwin
2021-12-17 21:53       ` Tom Tromey
2021-12-17 21:52     ` Tom Tromey
2021-12-17 22:06       ` Tom Tromey
2021-12-16 20:38 ` [PATCH v2 6/8] Add new gdbarch generator Tom Tromey
2021-12-17 18:33   ` Pedro Alves
2021-12-17 18:50     ` Simon Marchi
2021-12-17 21:54     ` Tom Tromey
2021-12-16 20:38 ` [PATCH v2 7/8] Remove gdbarch.sh Tom Tromey
2021-12-16 20:38 ` [PATCH v2 8/8] Document gdbarch-components.py Tom Tromey
2021-12-17  5:29 ` [PATCH v2 0/8] Rewrite gdbarch.sh in Python Simon Marchi
2021-12-17 15:01   ` Tom Tromey
2021-12-17 16:18     ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).