summaryrefslogtreecommitdiff
path: root/gdb/gdbarch.sh
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2000-05-02 08:57:21 +0000
committerAndrew Cagney <cagney@redhat.com>2000-05-02 08:57:21 +0000
commita623914c6dd956eb0d9d0d48ca05a4dac90f8219 (patch)
tree0ec58fbbeb9acad361149894e39a158df4163cee /gdb/gdbarch.sh
parent9fe318f4ad47fc615f1ad42cbe25e3d1d555cde2 (diff)
downloadgdb-a623914c6dd956eb0d9d0d48ca05a4dac90f8219.tar.gz
re-do how gdbarch provides non-multi arch defaults so that non-
multi-arch gdbservers can continue to compile.
Diffstat (limited to 'gdb/gdbarch.sh')
-rwxr-xr-xgdb/gdbarch.sh66
1 files changed, 32 insertions, 34 deletions
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index a6ad33ce9d6..790db4ffc33 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -351,6 +351,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 +469,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 +485,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 +526,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 +538,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 +1192,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 +1217,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 */"