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-4326] lldb prints strange numbers when interpreting optional unsigned values #4393

Closed
phausler opened this issue Mar 23, 2017 · 4 comments
Labels
bug Something isn't working LLDB for Swift

Comments

@phausler
Copy link
Member

Previous ID SR-4326
Radar None
Original Reporter @phausler
Type Bug
Status Resolved
Resolution Duplicate
Additional Detail from JIRA
Votes 0
Component/s LLDB for Swift
Labels Bug
Assignee jingham@apple.com (JIRA)
Priority Medium

md5: 4bf1f93b21119718ade2f1efa9d50ac5

duplicates:

  • SR-4091 Incorrect result shown in REPL for 'UInt8?'

Issue Description:

given the code `let v: UInt8? = 128`
issuing `p v` results in the following

(lldb) p v
(UInt8?) $R0 = -128

issuing `p v!` results in the following

(lldb) p v!
(UInt8) $R1 = 128

it seems that the top bit of the optional is being reinterpreted as memory of a Int16 instead?

@belkadan
Copy link

I thought this was fixed with SR-1007, but apparently not. cc jingham@apple.com (JIRA User)

@phausler
Copy link
Member Author

It is worth noting this only applies to optional values and I have reasonably proven to myself that it is a lldb issue and not actually a swift issue (which would be quite scary if it was).

@swift-ci
Copy link

Comment by Jim Ingham (JIRA)

I don't think this is related to SR-1007. That was the data formatter for UInt8 doing the wrong thing, this is the data formatter for optionals doing the wrong thing.

@swift-ci
Copy link

Comment by Jim Ingham (JIRA)

This is the same issue, printing an optional of an unsigned type.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 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

3 participants