From 2001-07-09 D.J. Barrow <djbarrow@de.ibm.com>:
[deliverable/binutils-gdb.git] / gdb / gdbarch.sh
index a8c908989d79fd14777b71089d08161594968da1..a1d5962b5b9a0377fed2d30a4b00c98f3706f205 100755 (executable)
@@ -440,7 +440,7 @@ v:1:USE_GENERIC_DUMMY_FRAMES:int:use_generic_dummy_frames::::0:-1
 v:2:CALL_DUMMY_LOCATION:int:call_dummy_location::::0:0
 f:2:CALL_DUMMY_ADDRESS:CORE_ADDR:call_dummy_address:void:::0:0::gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0
 v:2:CALL_DUMMY_START_OFFSET:CORE_ADDR:call_dummy_start_offset::::0:-1:::0x%08lx
-v:2:CALL_DUMMY_BREAKPOINT_OFFSET:CORE_ADDR:call_dummy_breakpoint_offset::::0:-1:::0x%08lx::CALL_DUMMY_BREAKPOINT_OFFSET_P
+v:2:CALL_DUMMY_BREAKPOINT_OFFSET:CORE_ADDR:call_dummy_breakpoint_offset::::0:-1::gdbarch->call_dummy_breakpoint_offset_p && gdbarch->call_dummy_breakpoint_offset == -1:0x%08lx::CALL_DUMMY_BREAKPOINT_OFFSET_P
 v:1:CALL_DUMMY_BREAKPOINT_OFFSET_P:int:call_dummy_breakpoint_offset_p::::0:-1
 v:2:CALL_DUMMY_LENGTH:int:call_dummy_length::::0:-1:::::CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END
 f:2:PC_IN_CALL_DUMMY:int:pc_in_call_dummy:CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address:pc, sp, frame_address::0:0
@@ -539,6 +539,8 @@ f:2:ADDR_BITS_REMOVE:CORE_ADDR:addr_bits_remove:CORE_ADDR addr:addr:::core_addr_
 # 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.
 F:2:SOFTWARE_SINGLE_STEP:void:software_single_step:enum target_signal sig, int insert_breakpoints_p:sig, insert_breakpoints_p::0:0
+f:2:TARGET_PRINT_INSN:int:print_insn:bfd_vma vma, disassemble_info *info:vma, info:::legacy_print_insn::0
+f:2:SKIP_TRAMPOLINE_CODE:CORE_ADDR:skip_trampoline_code:CORE_ADDR pc:pc:::generic_skip_trampoline_code::0
 EOF
 }
 
@@ -628,6 +630,8 @@ cat <<EOF
 #ifndef GDBARCH_H
 #define GDBARCH_H
 
+#include "dis-asm.h" /* Get defs for disassemble_info, which unfortunately is a typedef. */
+
 struct frame_info;
 struct value;
 
@@ -1047,8 +1051,6 @@ extern const struct bfd_arch_info *target_architecture;
 
 /* The target-system-dependent disassembler is semi-dynamic */
 
-#include "dis-asm.h"           /* Get defs for disassemble_info */
-
 extern int dis_asm_read_memory (bfd_vma memaddr, bfd_byte *myaddr,
                                unsigned int len, disassemble_info *info);
 
@@ -1060,9 +1062,6 @@ extern void dis_asm_print_address (bfd_vma addr,
 
 extern int (*tm_print_insn) (bfd_vma, disassemble_info*);
 extern disassemble_info tm_print_insn_info;
-#ifndef TARGET_PRINT_INSN
-#define TARGET_PRINT_INSN(vma, info) (*tm_print_insn) (vma, info)
-#endif
 #ifndef TARGET_PRINT_INSN_INFO
 #define TARGET_PRINT_INSN_INFO (&tm_print_insn_info)
 #endif
@@ -1290,19 +1289,25 @@ struct gdbarch *
 gdbarch_alloc (const struct gdbarch_info *info,
                struct gdbarch_tdep *tdep)
 {
-  struct gdbarch *gdbarch = XMALLOC (struct gdbarch);
-  memset (gdbarch, 0, sizeof (*gdbarch));
-
-  alloc_gdbarch_data (gdbarch);
-
-  gdbarch->tdep = tdep;
+  /* NOTE: The new architecture variable is named \`\`current_gdbarch''
+     so that macros such as TARGET_DOUBLE_BIT, when expanded, refer to
+     the current local architecture and not the previous global
+     architecture.  This ensures that the new architectures initial
+     values are not influenced by the previous architecture.  Once
+     everything is parameterised with gdbarch, this will go away.  */
+  struct gdbarch *current_gdbarch = XMALLOC (struct gdbarch);
+  memset (current_gdbarch, 0, sizeof (*current_gdbarch));
+
+  alloc_gdbarch_data (current_gdbarch);
+
+  current_gdbarch->tdep = tdep;
 EOF
 printf "\n"
 function_list | while do_read
 do
     if class_is_info_p
     then
-       printf "  gdbarch->${function} = info->${function};\n"
+       printf "  current_gdbarch->${function} = info->${function};\n"
     fi
 done
 printf "\n"
@@ -1313,14 +1318,14 @@ do
     then
        if [ -n "${predefault}" -a "x${predefault}" != "x0" ]
        then
-         printf "  gdbarch->${function} = ${predefault};\n"
+         printf "  current_gdbarch->${function} = ${predefault};\n"
        fi
     fi
 done
 cat <<EOF
   /* gdbarch_alloc() */
 
-  return gdbarch;
+  return current_gdbarch;
 }
 EOF
 
@@ -1425,16 +1430,22 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "gdbarch_dump: GDB_MULTI_ARCH = %d\\n",
                       GDB_MULTI_ARCH);
 EOF
-function_list | while do_read
+function_list | sort -t: +2 | while do_read
 do
     # multiarch functions don't have macros.
-    class_is_multiarch_p && continue
+    if class_is_multiarch_p
+    then
+       printf "  if (GDB_MULTI_ARCH)\n"
+       printf "    fprintf_unfiltered (file,\n"
+       printf "                        \"gdbarch_dump: ${function} = 0x%%08lx\\\\n\",\n"
+       printf "                        (long) current_gdbarch->${function});\n"
+       continue
+    fi
+    printf "#ifdef ${macro}\n"
     if [ "x${returntype}" = "xvoid" ]
     then
-       printf "#if defined (${macro}) && GDB_MULTI_ARCH\n"
+       printf "#if GDB_MULTI_ARCH\n"
        printf "  /* Macro might contain \`[{}]' when not multi-arch */\n"
-    else
-       printf "#ifdef ${macro}\n"
     fi
     if class_is_function_p
     then
@@ -1447,19 +1458,10 @@ do
        printf "                      \"gdbarch_dump: ${macro} # %%s\\\\n\",\n"
        printf "                      XSTRING (${macro}));\n"
     fi
-    printf "#endif\n"
-done
-function_list | while do_read
-do
-    if class_is_multiarch_p
+    if [ "x${returntype}" = "xvoid" ]
     then
-       printf "  if (GDB_MULTI_ARCH)\n"
-       printf "    fprintf_unfiltered (file,\n"
-       printf "                        \"gdbarch_dump: ${function} = 0x%%08lx\\\\n\",\n"
-       printf "                        (long) current_gdbarch->${function});\n"
-       continue
+       printf "#endif\n"
     fi
-    printf "#ifdef ${macro}\n"
     if [ "x${print_p}" = "x()" ]
     then
         printf "  gdbarch_dump_${function} (current_gdbarch);\n"
This page took 0.02508 seconds and 4 git commands to generate.