This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Fix missing characters when autocompleting LLDB commands in REPL
ClosedPublic

Authored by poya on Jun 29 2020, 8:50 PM.

Details

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

Diff Detail

Event Timeline

poya created this revision.Jun 29 2020, 8:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 29 2020, 8:50 PM
teemperor accepted this revision.Jun 30 2020, 2:46 AM

LGTM, thanks!

lldb/source/Expression/REPL.cpp
460

Nit: Missing . at the end of the comment, but I'll fix that when landing.

This revision is now accepted and ready to land.Jun 30 2020, 2:46 AM
poya marked an inline comment as done.Jun 30 2020, 6:17 PM
poya added inline comments.
lldb/source/Expression/REPL.cpp
460

Thanks, I wasn't sure about the convention since other comments in the same file had it both ways

poya added a comment.Jul 2 2020, 4:33 PM

Don't believe I have the necessary permissions to land this myself, so would need some help to get this committed to the repo. Thanks.

This revision was automatically updated to reflect the committed changes.