summaryrefslogtreecommitdiff
path: root/gdb/gdbarch.sh
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-07-10 22:01:14 +0000
committerAndrew Cagney <cagney@redhat.com>2003-07-10 22:01:14 +0000
commit0892072970fe557b6dabb70d77d21eff5b1fed4e (patch)
treed8c0ba82bbee17dd954e4d11ff9b212d6d71a42a /gdb/gdbarch.sh
parente4a227e13ccb0a962e574173c3443053dc5cf4ba (diff)
downloadgdb-0892072970fe557b6dabb70d77d21eff5b1fed4e.tar.gz
2003-07-10 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh: Use gdb_assert instead of internal_error. Compare functions against NULL, not 0. * gdbarch.c: Re-generate.
Diffstat (limited to 'gdb/gdbarch.sh')
-rwxr-xr-xgdb/gdbarch.sh18
1 files changed, 7 insertions, 11 deletions
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 02a1dc7c6be..06885598003 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -1733,7 +1733,7 @@ do
then
printf " return ${predicate};\n"
else
- printf " return gdbarch->${function} != 0;\n"
+ printf " return gdbarch->${function} != NULL;\n"
fi
printf "}\n"
fi
@@ -1749,13 +1749,11 @@ do
fi
printf "{\n"
printf " gdb_assert (gdbarch != NULL);\n"
- printf " if (gdbarch->${function} == 0)\n"
- printf " internal_error (__FILE__, __LINE__,\n"
- printf " \"gdbarch: gdbarch_${function} invalid\");\n"
+ printf " gdb_assert (gdbarch->${function} != NULL);\n"
if class_is_predicate_p && test -n "${predicate}"
then
# Allow a call to a function with a predicate.
- printf " /* Ignore predicate (${predicate}). */\n"
+ printf " /* Do not check predicate: ${predicate}, allow call. */\n"
fi
printf " if (gdbarch_debug >= 2)\n"
printf " fprintf_unfiltered (gdb_stdlog, \"gdbarch_${function} called\\\\n\");\n"
@@ -1801,14 +1799,12 @@ do
printf " /* Skip verify of ${function}, invalid_p == 0 */\n"
elif [ -n "${invalid_p}" ]
then
- printf " if (${invalid_p})\n"
- printf " internal_error (__FILE__, __LINE__,\n"
- printf " \"gdbarch: gdbarch_${function} invalid\");\n"
+ printf " /* Check variable is valid. */\n"
+ printf " gdb_assert (!(${invalid_p}));\n"
elif [ -n "${predefault}" ]
then
- printf " if (gdbarch->${function} == ${predefault})\n"
- printf " internal_error (__FILE__, __LINE__,\n"
- printf " \"gdbarch: gdbarch_${function} invalid\");\n"
+ printf " /* Check variable changed from pre-default. */\n"
+ printf " gdb_assert (gdbarch->${function} != ${predefault});\n"
fi
printf " if (gdbarch_debug >= 2)\n"
printf " fprintf_unfiltered (gdb_stdlog, \"gdbarch_${function} called\\\\n\");\n"