This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH]: Set WITH_TARGET_ADDRESS_BITSIZE=32 for HC11/HC12 simulator
- From: Stephane Carrez <stcarrez at nerim dot fr>
- To: gdb-patches at sources dot redhat dot com
- Date: Sun, 02 Mar 2003 11:04:38 +0100
- Subject: [PATCH]: Set WITH_TARGET_ADDRESS_BITSIZE=32 for HC11/HC12 simulator
Hi!
I committed this patch to switch the HC11/HC12 simulator to use 32-bit address representation
so that memory bank switching can be used.
There is a bug in sim/common where at various places we use a 'unsigned_word' instead
of 'address_word'. Since for HC11 the 'unsigned_word' is 16-bit, this bug creates a truncation
of the 32-bit address to 16-bit. I had to switch the simulator to use 32-bit until this
bug is fixed.
Stephane
2003-03-02 Stephane Carrez <stcarrez at nerim dot fr>
* Makefile.in (SIM_EXTRA_CFLAGS): Set WITH_TARGET_ADDRESS_BITSIZE
to 32 to support memory bank switching; temporarily use 32-bit for
WORD_BITSIZE to avoid a bug in sim-common.
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/sim/m68hc11/Makefile.in,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile.in
--- Makefile.in 9 Jun 2002 15:45:48 -0000 1.5
+++ Makefile.in 2 Mar 2003 09:56:56 -0000
@@ -35,9 +35,15 @@ SIM_OBJS = $(M68HC11_OBJS) \
$(SIM_EXTRA_OBJS)
SIM_PROFILE= -DPROFILE=1 -DWITH_PROFILE=-1
-SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=16 \
+# We must use 32-bit addresses to support memory bank switching.
+# The WORD_BITSIZE is normally 16 but must be switched (temporarily)
+# to 32 to avoid a bug in the sim-common which uses 'unsigned_word'
+# instead of 'address_word' in some places (the result is a truncation
+# of the 32-bit address to 16-bit; and this breaks the simulator).
+SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=32 \
-DWITH_TARGET_CELL_BITSIZE=32 \
- -DWITH_TARGET_WORD_MSB=15
+ -DWITH_TARGET_ADDRESS_BITSIZE=32 \
+ -DWITH_TARGET_WORD_MSB=31
SIM_EXTRA_CLEAN = clean-extra
SIM_EXTRA_OBJS = @m68hc11_extra_objs@