2000-05-10 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
[deliverable/binutils-gdb.git] / gdb / gdbarch.sh
index a6ad33ce9d6936e8ce360514a64599fddd0d6fc8..6026ca167845e922db66c7da8a40459f2d422866 100755 (executable)
@@ -241,6 +241,9 @@ v:2:NUM_REGS:int:num_regs::::0:-1
 v:2:SP_REGNUM:int:sp_regnum::::0:-1
 v:2:FP_REGNUM:int:fp_regnum::::0:-1
 v:2:PC_REGNUM:int:pc_regnum::::0:-1
+v:2:FP0_REGNUM:int:fp0_regnum::::0:-1:0
+v:2:NPC_REGNUM:int:npc_regnum::::0:-1:0
+v:2:NNPC_REGNUM:int:nnpc_regnum::::0:-1:0
 f:2:REGISTER_NAME:char *:register_name:int regnr:regnr:::legacy_register_name:0
 v:2:REGISTER_SIZE:int:register_size::::0:-1
 v:2:REGISTER_BYTES:int:register_bytes::::0:-1
@@ -351,6 +354,7 @@ EOF
        if class_is_predicate_p && default_is_fallback_p
        then
            echo "Error: predicate function can not have a non- multi-arch default" 1>&2
+           kill $$
            exit 1
        fi
     done
@@ -468,9 +472,15 @@ do
        echo ""
        echo "#if defined (${macro})"
        echo "/* Legacy for systems yet to multi-arch ${macro} */"
+#      echo "#if (GDB_MULTI_ARCH <= 2) && defined (${macro})"
        echo "#define ${macro}_P() (1)"
        echo "#endif"
        echo ""
+       echo "/* Default predicate for non- multi-arch targets. */"
+       echo "#if (GDB_MULTI_ARCH == 0) && !defined (${macro}_P)"
+       echo "#define ${macro}_P() (0)"
+       echo "#endif"
+       echo ""
        echo "extern int gdbarch_${function}_p (struct gdbarch *gdbarch);"
        echo "#if (GDB_MULTI_ARCH > 1) || !defined (${macro}_P)"
        echo "#define ${macro}_P() (gdbarch_${function}_p (current_gdbarch))"
@@ -478,23 +488,38 @@ do
     fi
     if class_is_variable_p
     then
+       if default_is_fallback_p || class_is_predicate_p
+       then
+           echo ""
+           echo "/* Default (value) for non- multi-arch platforms. */"
+           echo "#if (GDB_MULTI_ARCH == 0) && !defined (${macro})"
+           echo "#define ${macro} (${default})"
+           echo "#endif"
+       fi
        echo ""
        echo "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);"
        echo "extern void set_gdbarch_${function} (struct gdbarch *gdbarch, ${returntype} ${function});"
-       if ! default_is_fallback_p && ! class_is_predicate_p
-       then
-           echo "#if GDB_MULTI_ARCH"
-       fi
+       echo "#if GDB_MULTI_ARCH"
        echo "#if (GDB_MULTI_ARCH > 1) || !defined (${macro})"
        echo "#define ${macro} (gdbarch_${function} (current_gdbarch))"
        echo "#endif"
-       if ! default_is_fallback_p && ! class_is_predicate_p
-       then
-           echo "#endif"
-       fi
+       echo "#endif"
     fi
     if class_is_function_p
     then
+       if default_is_fallback_p || class_is_predicate_p
+       then
+           echo ""
+           echo "/* Default (function) for non- multi-arch platforms. */"
+           echo "#if (GDB_MULTI_ARCH == 0) && !defined (${macro})"
+           if [ "${default}" = "0" ]
+           then
+               echo "#define ${macro}(${actual}) (internal_error (\"${macro}\"), 0)"
+           else
+               echo "#define ${macro}(${actual}) (${default} (${actual}))"
+           fi
+           echo "#endif"
+       fi
        echo ""
        echo "typedef ${returntype} (gdbarch_${function}_ftype) (${formal});"
        if [ "${formal}" = "void" ]
@@ -504,10 +529,7 @@ do
          echo "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch, ${formal});"
        fi
        echo "extern void set_gdbarch_${function} (struct gdbarch *gdbarch, gdbarch_${function}_ftype *${function});"
-       if ! default_is_fallback_p && ! class_is_predicate_p
-       then
-           echo "#if GDB_MULTI_ARCH"
-       fi
+       echo "#if GDB_MULTI_ARCH"
        echo "#if (GDB_MULTI_ARCH > 1) || !defined (${macro})"
        if [ "${actual}" = "" ]
        then
@@ -519,10 +541,7 @@ do
          echo "#define ${macro}(${actual}) (gdbarch_${function} (current_gdbarch, ${actual}))"
        fi
        echo "#endif"
-       if ! default_is_fallback_p && ! class_is_predicate_p
-       then
-           echo "#endif"
-       fi
+       echo "#endif"
     fi
 done
 
@@ -1176,19 +1195,6 @@ do
          echo "gdbarch_${function} (struct gdbarch *gdbarch, ${formal})"
        fi
        echo "{"
-       if default_is_fallback_p && [ "${default}" != "0" ]
-       then
-           echo "  if (GDB_MULTI_ARCH == 0)"
-           if [ "${returntype}" = "void" ]
-           then
-               echo "    {"
-               echo "      ${default} (${actual});"
-               echo "      return;"
-               echo "    }"
-           else
-               echo "    return ${default} (${actual});"
-           fi
-       fi
         echo "  if (gdbarch->${function} == 0)"
         echo "    internal_error (\"gdbarch: gdbarch_${function} invalid\");"
        echo "  if (gdbarch_debug >= 2)"
@@ -1214,11 +1220,6 @@ do
        echo "${returntype}"
        echo "gdbarch_${function} (struct gdbarch *gdbarch)"
        echo "{"
-       if default_is_fallback_p && [ "${default}" != "0" ]
-       then
-           echo "  if (GDB_MULTI_ARCH == 0)"
-           echo "    return ${default};"
-       fi
        if [ "${invalid_p}" = "0" ]
        then
            echo "  /* Skip verify of ${function}, invalid_p == 0 */"
This page took 0.025013 seconds and 4 git commands to generate.