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-13044] LLDB function completion for breakpoints doesn't work #4425

Open
weissi opened this issue Jun 18, 2020 · 3 comments
Open

[SR-13044] LLDB function completion for breakpoints doesn't work #4425

weissi opened this issue Jun 18, 2020 · 3 comments
Labels
bug Something isn't working LLDB for Swift

Comments

@weissi
Copy link
Member

weissi commented Jun 18, 2020

Previous ID SR-13044
Radar rdar://problem/64517057
Original Reporter @weissi
Type Bug
Additional Detail from JIRA
Votes 0
Component/s LLDB for Swift
Labels Bug
Assignee None
Priority Medium

md5: 0663ec5bdfc7267ae76cc9e36be7f977

Issue Description:

Let's consider this program

public struct Foo<T> {
    func otherFunction(x: T, string: String) {}
}

Foo<String>().otherFunction(x: "", string: "")

and let's assume we want to break on otherFunction. Let's try to use completion in LLDB:

(lldb) break set -n some2.Foo.ot<TAB>

yields

(lldb) break set -n some2.Foo.otherFunction(x: A, string: Swift.String) -> () 

which looks great! However pressing Enter:

(lldb) break set -n some2.Foo.otherFunction(x: A, string: Swift.String) -> () 
error: unknown or ambiguous option

Sad times. I thought maybe some quotes are missing:

(lldb) break set -n 'some2.Foo.otherFunction(x: A, string: Swift.String) -> ()'
Breakpoint 1: no locations (pending).
WARNING:  Unable to resolve breakpoint to any actual locations.
(lldb) break set -n "some2.Foo.otherFunction(x: A, string: Swift.String) -> ()"
Breakpoint 2: no locations (pending).
WARNING:  Unable to resolve breakpoint to any actual locations.

but no luck.

@weissi
Copy link
Member Author

weissi commented Jun 18, 2020

@swift-ci create

@swift-ci
Copy link

Comment by Jim Ingham (JIRA)

Note that Johannes actually called his function:

some2.Foo.otherFunction(x: T, string: Swift.String) -> ()

But the completer typed it:

some2.Foo.otherFunction(x: A, string: Swift.String) -> ()

Note T->A. The problem here is that the demangled name just knows this is generic slot 1, and in the absence of more information calls that "A". Then later on, when lldb reads in the debug info for this function, it figures out the user-typed name. But somehow in-between those two points there isn't a good fixed name to match against.

@weissi
Copy link
Member Author

weissi commented Jun 18, 2020

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