-
Notifications
You must be signed in to change notification settings - Fork 340
Swift call site breakpoints #9493
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
Swift call site breakpoints #9493
Conversation
This fixes the two test suite failures that I missed in the PR: llvm#112939 One was a poorly written test case - it assumed that on connect to a gdb-remote with a running process, lldb MUST have fetched all the frame 0 registers. In fact, there's no need for it to do so (as the CallSite patch showed...) and if we don't need to we shouldn't. So I fixed the test to only expect a `g` packet AFTER calling read_registers. The other was a place where some code had used 0 when it meant LLDB_INVALID_LINE_NUMBER, which I had fixed but missed one place where it was still compared to 0. (cherry picked from commit 7dbbd2b)
…l stack. (llvm#114337) The computation of 'Thread::IsVirtualStep" was wrong - it called being at the bottom of a virtual call stack a "virtual step" but that is actually when you've gotten to concrete code and need to step for real. I also added a test for this. (cherry picked from commit 3243e3d)
The test is currently passing everywhere but this 32-bit arm ubuntu bot. I don't have an easy way to debug this, so I'm skipping the test on that platform till we get a chance to figure this out. (cherry picked from commit a218f0f)
@swift-ci test |
When you set a "next branch breakpoint" and run to it while stepping, you have to claim the stop at that breakpoint to be the top of the inlined call stack, or you will seem to "step in" and then plans might try to step back out again. This records the PrefferedLineEntry for next branch breakpoints and adds a test to make sure this works. (cherry picked from commit 23a01a4)
I have to check for the sc list size being changed by the call-site search, not just that it had more than one element. Added a test for multiple CU's with the same name in a given module, which would have caught this mistake. We were also doing all the work to find call sites when the found decl and specified decl's only difference was a column, but the incoming specification hadn't specified a column (column number == 0). (cherry picked from commit 803f957)
@swift-ci please test |
@swift-ci please test |
self.assertIn("a.testStringify", thread.frames[0].name, "Step out back to origin") | ||
thread.StepInto() | ||
self.assertIn( | ||
"freestanding macro expansion #1 of no_return in module a file main.swift line 6 column 3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These demanglings may not be stable — but whoever changes them in the future can also update this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it was so handy that these names had the compiler's view of both the call site and the expansion order to confirm we hit the right one, and it serves as a check against our reading of the line table. So I do think it's worth tracking changes in the demangling.
The Linux bot failed because the "set a breakpoint on a REPL defined function then call it" timed out without so far as I can tell producing anything to match against. Sounds like the REPL just never came up? I'll try again. |
@swift-ci please test Linux |
Revert "Merge pull request #9493 from jimingham/swift-call-site-breakpoints"
…t-call-site-breakpoints"" This reverts commit c93fb6d.
Revert "Merge pull request #9493 from jimingham/swift-call-site-break…
…t-call-site-breakpoints"" This reverts commit c93fb6d.
Revert "Revert "Merge pull request #9493 from jimingham/swift-call-si…
This is a cherry-pick of the main patch to add the ability to set breakpoints on call-site file & line numbers, and to handle hitting breakpoints in a virtual inlined call stack correctly.