public inbox for frysk-bugzilla@sourceware.org
help / color / mirror / Atom feed
From: "scox at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: frysk-bugzilla@sourceware.org
Subject: [Bug general/5540] New: location expression DW_OP_breg is sign extended
Date: Thu, 03 Jan 2008 22:32:00 -0000	[thread overview]
Message-ID: <20080103223124.5540.scox@redhat.com> (raw)

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.


             reply	other threads:[~2008-01-03 22:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-03 22:32 scox at redhat dot com [this message]
2008-01-03 23:03 ` [Bug general/5540] " scox at redhat dot com
2008-01-11 17:44 ` cagney at redhat dot com
2008-01-14 21:08 ` tthomas at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080103223124.5540.scox@redhat.com \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=frysk-bugzilla@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).