Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tcf-dev] negative input number for unsigned ints

Hi Konrad,

 

Yes, it is a bug.

Fixed.

 

Thanks!

Eugene

 

From: tcf-dev-bounces@xxxxxxxxxxx [mailto:tcf-dev-bounces@xxxxxxxxxxx] On Behalf Of Konrad Anheim
Sent: Monday, December 21, 2015 6:48 AM
To: tcf-dev@xxxxxxxxxxx
Subject: [tcf-dev] negative input number for unsigned ints

 

Hi,

 

I’m not sure, but I potentially found a bug:

Let’s assume your C code to debug contains an “unsigned int” variable. If you change the value of this variable to “-9” in the _expression_/variables view, it finally outputs 0xf7, but should read 0xfffffff7.

 

I tracked down the issue in file:

./plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNumberFormat.java

 

Function:

     public static byte[] toByteArray(String s, int radix, boolean fp, int size, boolean signed, boolean big_endian) with arguments:

     s          => "-9"

     radix      => 10

     fp => false

     size       4

     signed => false

     big_endian => false

 

will produce the byte array:

     [ -9, 0, 0, 0 ]

 

should produce the byte array:

     [ -9, -1, -1, -1 ]

 

What do you think?

 

Cheers,

Conny

 

 



This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.


Back to the top