aboutsummaryrefslogtreecommitdiff
path: root/sim/cris
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2005-11-16 04:50:57 +0000
committerHans-Peter Nilsson <hp@axis.com>2005-11-16 04:50:57 +0000
commitae81c235497c566a30bfeef3f6b3fc9884becd5a (patch)
tree3683f113abba5a33762c23b689f835664f36928c /sim/cris
parent3896cfd563f33073b3097ace79886605170cd5c2 (diff)
downloadgdb-ae81c235497c566a30bfeef3f6b3fc9884becd5a.zip
gdb-ae81c235497c566a30bfeef3f6b3fc9884becd5a.tar.gz
gdb-ae81c235497c566a30bfeef3f6b3fc9884becd5a.tar.bz2
* cris/cris-tmpl.c (MY (f_model_insn_before)): Make sure only the
low 32 bits are used after an unsigned long cast.
Diffstat (limited to 'sim/cris')
-rw-r--r--sim/cris/cris-tmpl.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/sim/cris/cris-tmpl.c b/sim/cris/cris-tmpl.c
index 3a24cf3..678ac01 100644
--- a/sim/cris/cris-tmpl.c
+++ b/sim/cris/cris-tmpl.c
@@ -121,13 +121,15 @@ MY (f_model_insn_before) (SIM_CPU *current_cpu, int first_p ATTRIBUTE_UNUSED)
char flags[7];
SIM_DESC sd = CPU_STATE (current_cpu);
- cris_trace_printf (sd, current_cpu, "%lx ", (unsigned long) (CPU (h_pc)));
+ cris_trace_printf (sd, current_cpu, "%lx ",
+ 0xffffffffUL & (unsigned long) (CPU (h_pc)));
for (i = 0; i < 15; i++)
cris_trace_printf (sd, current_cpu, "%lx ",
- (unsigned long) (XCONCAT3(crisv,BASENUM,
- f_h_gr_get) (current_cpu,
- i)));
+ 0xffffffffUL
+ & (unsigned long) (XCONCAT3(crisv,BASENUM,
+ f_h_gr_get) (current_cpu,
+ i)));
flags[0] = GET_H_IBIT () != 0 ? 'I' : 'i';
flags[1] = GET_H_XBIT () != 0 ? 'X' : 'x';
flags[2] = GET_H_NBIT () != 0 ? 'N' : 'n';
@@ -148,9 +150,10 @@ MY (f_model_insn_before) (SIM_CPU *current_cpu, int first_p ATTRIBUTE_UNUSED)
->unaligned_mem_dword_count
- CPU_CRIS_PREV_MISC_PROFILE (current_cpu)
->unaligned_mem_dword_count)),
- (unsigned long) (XCONCAT3(crisv,BASENUM,
- f_h_gr_get) (current_cpu,
- 15)));
+ 0xffffffffUL
+ & (unsigned long) (XCONCAT3(crisv,BASENUM,
+ f_h_gr_get) (current_cpu,
+ 15)));
else
cris_trace_printf (sd, current_cpu, "%s %d\n", flags,
(int)