This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
FYI: remove last of vestiges gdbarch_swap
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 31 Oct 2012 08:28:49 -0600
- Subject: FYI: remove last of vestiges gdbarch_swap
While reading through the corefile code I noticed a comment that I
thought was obsolete. It referred to some "swap" data in gdbarch; and
looking at gdbarch I saw there was still a field for it. But, nothing
actually uses this field.
The uses of this field were removed here:
commit 37a8c3ffd0bbe4a9a3e63f5e0102802e901344f8
Author: Ulrich Weigand <uweigand@de.ibm.com>
Date: Fri Jun 22 12:45:38 2007 +0000
* gdbarch.sh (gdbarch_swap_ftype, deprecated_register_gdbarch_swap,
DEPRECATED_REGISTER_GDBARCH_SWAP): Remove.
[...]
This patch removes the field itself and the out-of-date comment from
corelow.c.
Tested by rebuilding. I'm going to check it in.
Tom
2012-10-31 Tom Tromey <tromey@redhat.com>
* gdbarch.c: Rebuild.
* gdbarch.sh: Remove references to gdbarch_swap.
* corelow.c (core_open): Remove obsolete comment.
Index: corelow.c
===================================================================
RCS file: /cvs/src/src/gdb/corelow.c,v
retrieving revision 1.122
diff -u -r1.122 corelow.c
--- corelow.c 23 Jul 2012 14:57:54 -0000 1.122
+++ corelow.c 31 Oct 2012 14:28:06 -0000
@@ -344,12 +344,6 @@
core_bfd = temp_bfd;
old_chain = make_cleanup (core_close_cleanup, 0 /*ignore*/);
- /* FIXME: kettenis/20031023: This is very dangerous. The
- CORE_GDBARCH that results from this call may very well be
- different from CURRENT_GDBARCH. However, its methods may only
- work if it is selected as the current architecture, because they
- rely on swapped data (see gdbarch.c). We should get rid of that
- swapped data. */
core_gdbarch = gdbarch_from_bfd (core_bfd);
/* Find a suitable core file handler to munch on core_bfd */
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.545
diff -u -r1.545 gdbarch.sh
--- gdbarch.sh 22 Oct 2012 13:35:43 -0000 1.545
+++ gdbarch.sh 31 Oct 2012 14:28:06 -0000
@@ -1479,9 +1479,6 @@
printf " unsigned nr_data;\n"
printf " void **data;\n"
printf "\n"
-printf " /* per-architecture swap-regions. */\n"
-printf " struct gdbarch_swap *swap;\n"
-printf "\n"
cat <<EOF
/* Multi-arch values.
@@ -1547,8 +1544,8 @@
cat <<EOF
/* target specific vector and its dump routine. */
NULL, NULL,
- /*per-architecture data-pointers and swap regions. */
- 0, NULL, NULL,
+ /*per-architecture data-pointers. */
+ 0, NULL,
/* Multi-arch values */
EOF
function_list | while do_read