# 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'`"
+ line="$(echo "${line}" | sed -e 's/;;/; ;/g' -e 's/;;/; ;/g')"
OFS="${IFS}" ; IFS="[;]"
eval read "${read}" <<EOF
EOF
IFS="${OFS}"
- if test -n "${garbage_at_eol}"
+ if test -n "${garbage_at_eol:-}"
then
echo "Garbage at end-of-line in ${line}" 1>&2
kill $$
done
case "${class}" in
- m ) staticdefault="${predefault}" ;;
+ m ) staticdefault="${predefault:-}" ;;
M ) staticdefault="0" ;;
* ) test "${staticdefault}" || staticdefault=0 ;;
esac
case "${class}" in
F | V | M )
- case "${invalid_p}" in
+ case "${invalid_p:-}" in
"" )
if test -n "${predefault}"
then
#invalid_p="gdbarch->${function} == ${predefault}"
- predicate="gdbarch->${function} != ${predefault}"
+ predicate="gdbarch->${function:-} != ${predefault}"
elif class_is_variable_p
then
predicate="gdbarch->${function} != 0"
esac
esac
- # PREDEFAULT is a valid fallback definition of MEMBER when
- # multi-arch is not enabled. This ensures that the
- # default value, when multi-arch is the same as the
- # default value when not multi-arch. POSTDEFAULT is
- # always a valid definition of MEMBER as this again
- # ensures consistency.
-
- if [ -n "${postdefault}" ]
- then
- fallbackdefault="${postdefault}"
- elif [ -n "${predefault}" ]
- then
- fallbackdefault="${predefault}"
- else
- fallbackdefault="0"
- fi
-
#NOT YET: See gdbarch.log for basic verification of
# database
fallback_default_p ()
{
- [ -n "${postdefault}" -a "x${invalid_p}" != "x0" ] \
- || [ -n "${predefault}" -a "x${invalid_p}" = "x0" ]
+ { [ -n "${postdefault:-}" ] && [ "x${invalid_p}" != "x0" ]; } \
+ || { [ -n "${predefault}" ] && [ "x${invalid_p}" = "x0" ]; }
}
class_is_variable_p ()
function_list | while do_read
do
cat <<EOF
-${class} ${returntype} ${function} ($formal)
+${class} ${returntype:-} ${function} (${formal:-})
EOF
for r in ${read}
do
kill $$
exit 1
fi
- if [ "x${invalid_p}" = "x0" -a -n "${postdefault}" ]
+ if [ "x${invalid_p}" = "x0" ] && [ -n "${postdefault}" ]
then
echo "Error: postdefault is useless when invalid_p=0" 1>&2
kill $$
do
if class_is_function_p || class_is_variable_p
then
- if [ -n "${predefault}" -a "x${predefault}" != "x0" ]
+ if [ -n "${predefault}" ] && [ "x${predefault}" != "x0" ]
then
printf " gdbarch->%s = %s;\n" "$function" "$predefault"
fi
then
printf " /* Skip verify of %s, has predicate. */\n" "$function"
# FIXME: See do_read for potential simplification
- elif [ -n "${invalid_p}" -a -n "${postdefault}" ]
+ elif [ -n "${invalid_p}" ] && [ -n "${postdefault}" ]
then
printf " if (%s)\n" "$invalid_p"
printf " gdbarch->%s = %s;\n" "$function" "$postdefault"
- elif [ -n "${predefault}" -a -n "${postdefault}" ]
+ elif [ -n "${predefault}" ] && [ -n "${postdefault}" ]
then
printf " if (gdbarch->%s == %s)\n" "$function" "$predefault"
printf " gdbarch->%s = %s;\n" "$function" "$postdefault"
fi
printf " if (gdbarch_debug >= 2)\n"
printf " fprintf_unfiltered (gdb_stdlog, \"gdbarch_%s called\\\\n\");\n" "$function"
- if [ "x${actual}" = "x-" -o "x${actual}" = "x" ]
+ if [ "x${actual:-}" = "x-" ] || [ "x${actual:-}" = "x" ]
then
if class_is_multiarch_p
then
printf "\n"
printf "void\n"
printf "set_gdbarch_%s (struct gdbarch *gdbarch,\n" "$function"
- printf " `echo "$function" | sed -e 's/./ /g'` gdbarch_%s_ftype %s)\n" "$function" "$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"
printf "\n"
printf "void\n"
printf "set_gdbarch_%s (struct gdbarch *gdbarch,\n" "$function"
- printf " `echo "$function" | sed -e 's/./ /g'` %s %s)\n" "$returntype" "$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"