HomePhabricator

[lldb][test] Prevent \n in calls to lldb's expect() test helper.

Authored by rupprecht on Nov 19 2019, 3:06 PM.

Description

[lldb][test] Prevent \n in calls to lldb's expect() test helper.

Summary:
expect() forwards its command to sendline(). This can be problematic if the command already contains a newline: sendline() unconditionally adds a newline to the command, which causes the command to run twice (hitting enter in lldb runs the previous command). The expect() helper looks for the prompt and finds the first one, but because the command has run a second time, the buffer will contain the contents of the second time the command ran, causing potential erroneous matching.

Simplify the editline test, which was using different commands to workaround this misunderstanding.

Reviewers: labath

Reviewed By: labath

Subscribers: merge_guards_bot, lldb-commits

Tags: #lldb

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

Details

Committed
rupprechtNov 19 2019, 3:17 PM
Reviewer
labath
Differential Revision
D70324: [lldb][test] Prevent \n in calls to lldb's expect() test helper.
Parents
rG88f00aef684f: Introduce llvm-install-name-tool
Branches
Unknown
Tags
Unknown