* ltconfig, ltmain.sh: Upgrade to libtool 1.4a 1.641.2.256.
[deliverable/binutils-gdb.git] / gdb / gdbarch.sh
index 991ea132415663e3ebf83d0a38e72faadb447c2d..14e88c30a83f12724de977dca7877379427805f9 100755 (executable)
@@ -376,8 +376,8 @@ v::TARGET_BFD_VMA_BIT:int:bfd_vma_bit::::8 * sizeof (void*):TARGET_ARCHITECTURE-
 #
 v::IEEE_FLOAT:int:ieee_float::::0:0::0:::
 #
-f::TARGET_READ_PC:CORE_ADDR:read_pc:int pid:pid::0:generic_target_read_pc::0
-f::TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, int pid:val, pid::0:generic_target_write_pc::0
+f::TARGET_READ_PC:CORE_ADDR:read_pc:ptid_t ptid:ptid::0:generic_target_read_pc::0
+f::TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, ptid_t ptid:val, ptid::0:generic_target_write_pc::0
 f::TARGET_READ_FP:CORE_ADDR:read_fp:void:::0:generic_target_read_fp::0
 f::TARGET_WRITE_FP:void:write_fp:CORE_ADDR val:val::0:generic_target_write_fp::0
 f::TARGET_READ_SP:CORE_ADDR:read_sp:void:::0:generic_target_read_sp::0
@@ -489,6 +489,7 @@ f:2:BREAKPOINT_FROM_PC:unsigned char *:breakpoint_from_pc:CORE_ADDR *pcptr, int
 f:2:MEMORY_INSERT_BREAKPOINT:int:memory_insert_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_insert_breakpoint::0
 f:2:MEMORY_REMOVE_BREAKPOINT:int:memory_remove_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_remove_breakpoint::0
 v:2:DECR_PC_AFTER_BREAK:CORE_ADDR:decr_pc_after_break::::0:-1
+f::PREPARE_TO_PROCEED:int:prepare_to_proceed:int select_it:select_it::0:default_prepare_to_proceed::0
 v:2:FUNCTION_START_OFFSET:CORE_ADDR:function_start_offset::::0:-1
 #
 f:2:REMOTE_TRANSLATE_XFER_ADDRESS:void:remote_translate_xfer_address:CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len:gdb_addr, gdb_len, rem_addr, rem_len:::generic_remote_translate_xfer_address::0
@@ -837,9 +838,6 @@ struct gdbarch_list
 
 struct gdbarch_info
 {
-  /* Use default: bfd_arch_unknown (ZERO). */
-  enum bfd_architecture bfd_architecture;
-
   /* Use default: NULL (ZERO). */
   const struct bfd_arch_info *bfd_arch_info;
 
@@ -893,16 +891,12 @@ extern struct gdbarch *gdbarch_alloc (const struct gdbarch_info *info, struct gd
 extern void gdbarch_free (struct gdbarch *);
 
 
-/* Helper function. Force an update of the current architecture.  Used
-   by legacy targets that have added their own target specific
-   architecture manipulation commands.
+/* Helper function. Force an update of the current architecture.
 
-   The INFO parameter shall be fully initialized (\`\`memset (&INFO,
-   sizeof (info), 0)'' set relevant fields) before gdbarch_update_p()
-   is called.  gdbarch_update_p() shall initialize any \`\`default''
-   fields using information obtained from the previous architecture or
-   INFO.ABFD (if specified) before calling the corresponding
-   architectures INIT function.
+   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 */
 
@@ -1944,75 +1938,72 @@ gdbarch_update_p (struct gdbarch_info info)
   struct gdbarch_list **list;
   struct gdbarch_registration *rego;
 
-  /* Fill in any missing bits. Most important is the bfd_architecture
-     which is used to select the target architecture. */
-  if (info.bfd_architecture == bfd_arch_unknown)
-    {
-      if (info.bfd_arch_info != NULL)
-       info.bfd_architecture = info.bfd_arch_info->arch;
-      else if (info.abfd != NULL)
-       info.bfd_architecture = bfd_get_arch (info.abfd);
-      /* FIXME - should query BFD for its default architecture. */
-      else
-       info.bfd_architecture = current_gdbarch->bfd_arch_info->arch;
-    }
+  /* Fill in missing parts of the INFO struct using a number of
+     sources: \`\`set ...''; INFOabfd supplied; existing target.  */
+
+  /* \`\`(gdb) set architecture ...'' */
+  if (info.bfd_arch_info == NULL
+      && !TARGET_ARCHITECTURE_AUTO)
+    info.bfd_arch_info = TARGET_ARCHITECTURE;
+  if (info.bfd_arch_info == NULL
+      && info.abfd != NULL
+      && bfd_get_arch (info.abfd) != bfd_arch_unknown
+      && bfd_get_arch (info.abfd) != bfd_arch_obscure)
+    info.bfd_arch_info = bfd_get_arch_info (info.abfd);
   if (info.bfd_arch_info == NULL)
-    {
-      if (target_architecture_auto && info.abfd != NULL)
-       info.bfd_arch_info = bfd_get_arch_info (info.abfd);
-      else
-       info.bfd_arch_info = current_gdbarch->bfd_arch_info;
-    }
+    info.bfd_arch_info = TARGET_ARCHITECTURE;
+
+  /* \`\`(gdb) set byte-order ...'' */
+  if (info.byte_order == 0
+      && !TARGET_BYTE_ORDER_AUTO)
+    info.byte_order = TARGET_BYTE_ORDER;
+  /* From the INFO struct. */
+  if (info.byte_order == 0
+      && info.abfd != NULL)
+    info.byte_order = (bfd_big_endian (info.abfd) ? BIG_ENDIAN
+                      : bfd_little_endian (info.abfd) ? LITTLE_ENDIAN
+                      : 0);
+  /* From the current target. */
   if (info.byte_order == 0)
-    {
-      if (target_byte_order_auto && info.abfd != NULL)
-       info.byte_order = (bfd_big_endian (info.abfd) ? BIG_ENDIAN
-                          : bfd_little_endian (info.abfd) ? LITTLE_ENDIAN
-                          : 0);
-      else
-       info.byte_order = current_gdbarch->byte_order;
-      /* FIXME - should query BFD for its default byte-order. */
-    }
-  /* A default for abfd? */
+    info.byte_order = TARGET_BYTE_ORDER;
 
-  /* Find the target that knows about this architecture. */
-  for (rego = gdbarch_registry;
-       rego != NULL;
-       rego = rego->next)
-    if (rego->bfd_architecture == info.bfd_architecture)
-      break;
-  if (rego == NULL)
-    {
-      if (gdbarch_debug)
-       fprintf_unfiltered (gdb_stdlog, "gdbarch_update: No matching architecture\\n");
-      return 0;
-    }
+  /* Must have found some sort of architecture. */
+  gdb_assert (info.bfd_arch_info != NULL);
 
   if (gdbarch_debug)
     {
       fprintf_unfiltered (gdb_stdlog,
-                         "gdbarch_update: info.bfd_architecture %d (%s)\\n",
-                         info.bfd_architecture,
-                         bfd_lookup_arch (info.bfd_architecture, 0)->printable_name);
-      fprintf_unfiltered (gdb_stdlog,
-                         "gdbarch_update: info.bfd_arch_info %s\\n",
+                         "gdbarch_update: info.bfd_arch_info %s\n",
                          (info.bfd_arch_info != NULL
                           ? info.bfd_arch_info->printable_name
                           : "(null)"));
       fprintf_unfiltered (gdb_stdlog,
-                         "gdbarch_update: info.byte_order %d (%s)\\n",
+                         "gdbarch_update: info.byte_order %d (%s)\n",
                          info.byte_order,
                          (info.byte_order == BIG_ENDIAN ? "big"
                           : info.byte_order == LITTLE_ENDIAN ? "little"
                           : "default"));
       fprintf_unfiltered (gdb_stdlog,
-                         "gdbarch_update: info.abfd 0x%lx\\n",
+                         "gdbarch_update: info.abfd 0x%lx\n",
                          (long) info.abfd);
       fprintf_unfiltered (gdb_stdlog,
-                         "gdbarch_update: info.tdep_info 0x%lx\\n",
+                         "gdbarch_update: info.tdep_info 0x%lx\n",
                          (long) info.tdep_info);
     }
 
+  /* Find the target 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_update: No matching architecture\\n");
+      return 0;
+    }
+
   /* Ask the target for a replacement architecture. */
   new_gdbarch = rego->init (info, rego->arches);
 
This page took 0.025957 seconds and 4 git commands to generate.