Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lldb/source/Commands/CommandObjectExpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,9 +640,15 @@ void CommandObjectExpression::DoExecute(llvm::StringRef command,
repl_sp->SetValueObjectDisplayOptions(m_varobj_options);
}

if (!expr.empty()) {
result.GetOutputStream().Printf(
"Warning: trailing input is ignored in --repl mode\n");
}

IOHandlerSP io_handler_sp(repl_sp->GetIOHandler());
io_handler_sp->SetIsDone(false);
debugger.RunIOHandlerAsync(io_handler_sp);
return;
} else {
repl_error = Status::FromErrorStringWithFormat(
"Couldn't create a REPL for %s",
Expand Down
5 changes: 3 additions & 2 deletions lldb/test/API/repl/clang/TestClangREPL.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ def start_repl(self):
self.expect("b main", substrs=["Breakpoint 1", "address ="])
self.expect("run", substrs=["stop reason = breakpoint 1"])

# Start the REPL.
self.child.send("expression --repl -l c --\n")
# Start the REPL with a harmless trailing input to trigger the warning.
self.child.send("expression --repl -l c -- 3 + 3\n")
self.child.expect_exact("Warning: trailing input is ignored in --repl mode")
self.child.expect_exact("1>")

# PExpect uses many timeouts internally and doesn't play well
Expand Down
Loading