Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [commit/rx sim] Fix a "Cycle count not updated!" abort
@ 2010-09-24  7:42 Kevin Buettner
  2010-09-24 11:25 ` Masaki Muranaka
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Buettner @ 2010-09-24  7:42 UTC (permalink / raw)
  To: gdb-patches

I've commited the patch below.

In rx.c, the RXO_suntil case contains the following line:

	  cycles (3 + 3 * (tx / 4) + 3 * (tx % 4));

If tx (which DJ tells me is the transaction count) is -1, that
expression reduces to 0 which ends up meaning that the operation in
question took 0 cycles.  This causes a sanity check at the top of the
loop to fail printing the message:

    Cycle count not updated!  id RXO_suntil

The simulator aborts when this happens.

DJ agrees that negative tx values make no sense, leading to the
patch below.

With this patch in place, I'm able to run the gdb.base/break.exp
test program to completion.  Without it, it aborts in the midst
of executing the print statement.

I still see a number of failures when running gdb.base/break.exp
though.  I'll address those in the next patch.

Kevin

sim/rx/ChangeLog:

	* rx.c (decode_opcode): Declare `rx' as unsigned.

Index: rx.c
===================================================================
RCS file: /cvs/src/src/sim/rx/rx.c,v
retrieving revision 1.6
diff -u -p -r1.6 rx.c
--- rx.c	29 Jul 2010 18:41:28 -0000	1.6
+++ rx.c	23 Sep 2010 23:25:38 -0000
@@ -878,7 +878,7 @@ decode_opcode ()
   unsigned long long prev_cycle_count;
 #endif
 #ifdef CYCLE_ACCURATE
-  int tx;
+  unsigned int tx;
 #endif
 
 #ifdef CYCLE_STATS


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-09-24  4:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-24  7:42 [commit/rx sim] Fix a "Cycle count not updated!" abort Kevin Buettner
2010-09-24 11:25 ` Masaki Muranaka
2010-09-24 12:39   ` Kevin Buettner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox