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-13499] LLDB does not cope well with breakpoints in dynamically loaded code. #4419

Open
johnno1962 opened this issue Sep 4, 2020 · 3 comments
Labels
bug Something isn't working LLDB for Swift

Comments

@johnno1962
Copy link

Previous ID SR-13499
Radar rdar://problem/68376686
Original Reporter @johnno1962
Type Bug
Environment

Xcode 12 betas up to 6, Catalina 10.15.6

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

md5: 27ce32cd3477f53797df0529fdb31f49

Issue Description:

Hi Apple,

I was going to raise a radar but I see there is a category here for "LLDB for Swift" and this very much fits that category. I have an App that allows developers to inject code into applications while they are running perhaps best summarised here and there is an open issue against the repo with problems accessing self when breakpointing code that has been injected. Breakpoints themselves actually work.

I've tried to investigate this and gone through the many steps to be able to work on lldb in an Xcode project and log information and I have to say I've met my match in terms of being able to find a solution. If this problem were a priority it would need to be looked at by someone more familiar with the code. As far as I can see the dynamically loaded code dylib which only contains the single file injected is treated as it's module rather than the app bundle and as a result lldb has problems looking up things like the class that owns the method being debugged and as a result can't resolve self, either in the console or the variable browser to the left hand side in Xcode.

If there was any chance someone could take a look at this I and no doubt a few others would appreciate it. Maybe someday this approach will find its way into being supported by Xcode and this would be one of the problems that would benefit from time invested at this stage.

Thanks!

@johnno1962
Copy link
Author

To replicate the problem, download this test project and the injection App and set a breakpoint in the ViewController.swift code and save the file to inject it. When the breakpoint triggers you won't be able to print or view self.

@typesanitizer
Copy link

@swift-ci create

@johnno1962
Copy link
Author

Thanks for syncing this. On reflection, a better example project to use is this one.

@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