Skip to content

Cherry-pick [lldb] Fix missing characters when autocompleting LLDB commands in REPL #1428

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

Conversation

Teemperor
Copy link

LLDB change for #1421

Summary:

When tabbing to complete LLDB commands in REPL, characters would at best be
missing but at worst cause the REPL to crash due to out of range string access.
This patch appends the command character to the completion results to fulfill
the assumption that all matches are prefixed by the request's cursor argument
prefix.

Bug report for the Swift REPL
https://bugs.swift.org/browse/SR-12867

Reviewers: teemperor

Reviewed By: teemperor

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D82835

(cherry picked from commit 3faec83)

Summary:

When tabbing to complete LLDB commands in REPL, characters would at best be
missing but at worst cause the REPL to crash due to out of range string access.
This patch appends the command character to the completion results to fulfill
the assumption that all matches are prefixed by the request's cursor argument
prefix.

Bug report for the Swift REPL
https://bugs.swift.org/browse/SR-12867

Reviewers: teemperor

Reviewed By: teemperor

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D82835

(cherry picked from commit 3faec83)
@Teemperor
Copy link
Author

@swift-ci test

@fredriss
Copy link

fredriss commented Jul 8, 2020

Can we add a test on the Swift side?

@Teemperor
Copy link
Author

Yes #1421 is the test for Swift. It's kinda awkward because the REPL is 'generic' code but only Swift uses it, that's why this goes into stable as a backport and the other is the Swift-specific test (as there is no C++ REPL)

@fredriss
Copy link

fredriss commented Jul 8, 2020

Thanks!

@fredriss fredriss merged commit fcb37a1 into swiftlang:apple/stable/20200108 Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants