From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7399 invoked by alias); 3 Jan 2008 22:32:34 -0000 Received: (qmail 7049 invoked by uid 48); 3 Jan 2008 22:31:25 -0000 Date: Thu, 03 Jan 2008 22:32:00 -0000 From: "scox at redhat dot com" To: frysk-bugzilla@sourceware.org Message-ID: <20080103223124.5540.scox@redhat.com> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug general/5540] New: location expression DW_OP_breg is sign extended X-Bugzilla-Reason: AssignedTo Mailing-List: contact frysk-bugzilla-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: frysk-bugzilla-owner@sourceware.org X-SW-Source: 2008-q1/txt/msg00002.txt.bz2 List-Id: There is an intermittent failure caused by the sign extending of DW_OP_breg values in LocationExpression.java at: long regval = frame.getRegister(register); The scenario is: frysk.stack.Frame.getRegister return getRegisterValue(register).asLong() frysk.stack.Frame.getRegisterValue return new Value(register.getType() frysk.value.Value.Value where Location might have values such as: -128, 62, -105, -1 where asLong is: frysk.value.Value.asLong return ((ArithmeticType)type.getUltimateType()).getBigInteger(location).longValue() frysk.value.SignedType.getBigInteger return new BigInteger(location.get(order())) I'm trying to come up with a simple test but here is a small java example showing what is happening above: import java.math.BigInteger; // bigInteger.longValue is -15654349 for bytes = {-1,0x11,0x22,0x33} // bigInteger.longValue is 4279312947 for bytes = {0,-1,0x11,0x22,0x33} public class tstbi { public static void main(String[] args) { BigInteger bigInteger; byte [] bytes = {0,-1,0x11,0x22,0x33}; bigInteger = new BigInteger(bytes); System.out.println("bigInteger=" + bigInteger.longValue()); } } -- Summary: location expression DW_OP_breg is sign extended Product: frysk Version: unspecified Status: NEW Severity: normal Priority: P2 Component: general AssignedTo: frysk-bugzilla at sourceware dot org ReportedBy: scox at redhat dot com http://sourceware.org/bugzilla/show_bug.cgi?id=5540 ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.