From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15402 invoked by alias); 23 Sep 2010 23:39:47 -0000 Received: (qmail 15394 invoked by uid 22791); 23 Sep 2010 23:39:46 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 23 Sep 2010 23:39:42 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8NNdemW021721 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 23 Sep 2010 19:39:40 -0400 Received: from mesquite.lan (ovpn-113-43.phx2.redhat.com [10.3.113.43]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8NNdeJb009941 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Thu, 23 Sep 2010 19:39:40 -0400 Date: Fri, 24 Sep 2010 07:42:00 -0000 From: Kevin Buettner To: gdb-patches@sourceware.org Subject: [commit/rx sim] Fix a "Cycle count not updated!" abort Message-ID: <20100923163939.30023897@mesquite.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-09/txt/msg00426.txt.bz2 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