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-13567] po String.Index should print something human readable in lldb #4459

Open
swift-ci opened this issue Sep 18, 2020 · 1 comment
Open
Labels
bug Something isn't working LLDB for Swift

Comments

@swift-ci
Copy link

Previous ID SR-13567
Radar rdar://problem/69168795
Original Reporter benpious (JIRA User)
Type Bug
Environment

Xcode 11.6

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

md5: 4d30133c5fc61e9a0c3490e66212c606

Issue Description:

If you `po` or `p` a String.Index today, you get something like "_rawBits : 131072". This is very annoying when debugging code that manipulates strings. I think simply printing the `position` from those raw bits would be enough; ideally both the code-unit offset and the grapheme position, if those are available to String.Index.

I realize that I can use `encodedOffset` today to get the UTF-16 code unit offset, but that isn't ideal for non-ascii cases, or for when I'm printing the data type containing them, like Range<String.Index>.

@typesanitizer
Copy link

@swift-ci create

@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
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