This is the mail archive of the
frysk-bugzilla@sourceware.org
mailing list for the frysk project.
[Bug general/5540] New: location expression DW_OP_breg is sign extended
- From: "scox at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: frysk-bugzilla at sourceware dot org
- Date: 3 Jan 2008 22:31:24 -0000
- Subject: [Bug general/5540] New: location expression DW_OP_breg is sign extended
- Reply-to: sourceware-bugzilla at sourceware dot org
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.