This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Dump the value of the gdbarch predicates
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Thu, 05 Dec 2002 10:21:48 -0500
- Subject: [commit] Dump the value of the gdbarch predicates
FYI,
This adds the value of any predicate to the list of things dumped by the
command `maint print architecture'.
committed,
Andrew
2002-12-05 Andrew Cagney <ac131313@redhat.com>
* gdbarch.sh: Dump the predicate function and macro values.
(read): Print error on standard error.
* gdbarch.c: Regenerate.
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.177
diff -u -r1.177 gdbarch.sh
--- gdbarch.sh 1 Dec 2002 19:07:14 -0000 1.177
+++ gdbarch.sh 5 Dec 2002 15:17:28 -0000
@@ -129,7 +129,7 @@
fi
;;
* )
- echo "Predicate function ${function} with invalid_p."
+ echo "Predicate function ${function} with invalid_p." 1>&2
kill $$
exit 1
;;
@@ -1572,6 +1572,27 @@
EOF
function_list | sort -t: -k 3 | while do_read
do
+ # First the predicate
+ if class_is_predicate_p
+ then
+ if class_is_multiarch_p
+ then
+ printf " if (GDB_MULTI_ARCH)\n"
+ printf " fprintf_unfiltered (file,\n"
+ printf " \"gdbarch_dump: gdbarch_${function}_p() = %%d\\\\n\",\n"
+ printf " gdbarch_${function}_p (current_gdbarch));\n"
+ else
+ printf "#ifdef ${macro}_P\n"
+ printf " fprintf_unfiltered (file,\n"
+ printf " \"gdbarch_dump: %%s # %%s\\\\n\",\n"
+ printf " \"${macro}_P()\",\n"
+ printf " XSTRING (${macro}_P ()));\n"
+ printf " fprintf_unfiltered (file,\n"
+ printf " \"gdbarch_dump: ${macro}_P() = %%d\\\\n\",\n"
+ printf " ${macro}_P ());\n"
+ printf "#endif\n"
+ fi
+ fi
# multiarch functions don't have macros.
if class_is_multiarch_p
then