Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-1751] Debugger shows data not matching the type of a variable #4520

Closed
swift-ci opened this issue Jun 14, 2016 · 2 comments
Closed

[SR-1751] Debugger shows data not matching the type of a variable #4520

swift-ci opened this issue Jun 14, 2016 · 2 comments
Labels
bug Something isn't working LLDB for Swift

Comments

@swift-ci
Copy link

Previous ID SR-1751
Radar None
Original Reporter nameghino (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate

Attachment: Download

Environment

Version 7.3.1 (7D1014), swiftlang-2.2, lldb-350.0.21.9

Additional Detail from JIRA
Votes 0
Component/s LLDB for Swift
Labels Bug
Assignee None
Priority Medium

md5: 38e2ee1eb1c8ecb53f5b08a8f0979004

duplicates:

  • SR-1007 Unsigned integer types have incorrect max values

Issue Description:

I've discovered that the debugger is presenting negative numbers in a `UInt8` array, which could not be possible.

I cannot share the data that made this issue come up, but this is what I'm doing:

                let count = data.length / sizeof(UInt8)
                
                // create an array of Uint8
                var array = [UInt8](count: count, repeatedValue: 0)
                
                // copy bytes into array
                data.getBytes(&array, length:count * sizeof(UInt8))

The `data` parameter is an NSData that contains a sequence of `UInt8` values in binary form, and this same code parses a similar file (but of type `Float`) without any issues.

I'm attaching a screenshot of the Xcode debugger showing the contents of the `data` array.

@belkadan
Copy link

granataenrico (JIRA User), this is fixed in Swift 3, right?

@belkadan
Copy link

Ah, found it.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 7, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working LLDB for Swift
Projects
None yet
Development

No branches or pull requests

2 participants