Skip to content

Commit 31ead1b

Browse files
committed
Rebasing on lldb host changes.
1 parent 5475495 commit 31ead1b

File tree

3 files changed

+19
-23
lines changed

3 files changed

+19
-23
lines changed

lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1242,7 +1242,7 @@ def launch(
12421242
)
12431243

12441244
# If the listener expanded into multiple addresses, use the first.
1245-
connection = out.removeprefix(expected_prefix).rstrip("\r\n")
1245+
connection = out.removeprefix(expected_prefix).rstrip("\r\n").split(",", 1)[0]
12461246
return proc, connection
12471247

12481248
return proc, None
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# RUN: lldb-dap --help | FileCheck %s
2+
# CHECK: --connection
23
# CHECK: -g
34
# CHECK: --help
45
# CHECK: -h
5-
# CHECK: --port
6-
# CHECK: -p
6+
# CHECK: --repl-mode
77
# CHECK: --wait-for-debugger
88

lldb/tools/lldb-dap/lldb-dap.cpp

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5042,8 +5042,7 @@ int main(int argc, char *argv[]) {
50425042
if (log)
50435043
*log << "configureIO failed: " << llvm::toStringWithoutConsuming(Err)
50445044
<< "\n";
5045-
std::cerr << "failed to configureIO: " << llvm::toString(std::move(Err))
5046-
<< std::endl;
5045+
llvm::errs() << "failed to configureIO: " << Err << "\n";
50475046
return false;
50485047
}
50495048

@@ -5056,8 +5055,7 @@ int main(int argc, char *argv[]) {
50565055
*log << "Transport Error: " << llvm::toStringWithoutConsuming(Err)
50575056
<< "\n";
50585057

5059-
std::cerr << "Transpot Error: " << llvm::toString(std::move(Err))
5060-
<< std::endl;
5058+
llvm::errs() << "Transpot Error: " << Err << "\n";
50615059

50625060
return false;
50635061
}
@@ -5071,8 +5069,8 @@ int main(int argc, char *argv[]) {
50715069
if (!connection.empty()) {
50725070
auto maybeProtoclAndName = parseConnection(connection);
50735071
if (auto Err = maybeProtoclAndName.takeError()) {
5074-
std::cerr << "Invalid connection specification "
5075-
<< llvm::toString(std::move(Err)) << std::endl;
5072+
llvm::errs() << "Invalid connection specification "
5073+
<< Err << "\n";
50765074
return EXIT_FAILURE;
50775075
}
50785076

@@ -5081,31 +5079,30 @@ int main(int argc, char *argv[]) {
50815079
std::tie(protocol, name) = *maybeProtoclAndName;
50825080

50835081
Status error;
5084-
std::unique_ptr<Socket> listener = Socket::Create(protocol, false, error);
5082+
std::unique_ptr<Socket> listener = Socket::Create(protocol, error);
50855083
if (error.Fail()) {
5086-
std::cerr << "Failed to create listener for protocol "
5087-
<< Socket::FindSchemeByProtocol(protocol)
5088-
<< ", error: " << llvm::toString(error.takeError())
5089-
<< std::endl;
5084+
llvm::errs() << "Failed to create listener for protocol "
5085+
<< Socket::FindSchemeByProtocol(protocol)
5086+
<< ", error: " << error.takeError() << "\n";
50905087
return EXIT_FAILURE;
50915088
}
50925089

50935090
error = listener->Listen(name, /* backlog */ 5);
50945091
if (error.Fail()) {
5095-
std::cerr << "Failed to listen, error: "
5096-
<< llvm::toString(error.takeError()) << std::endl;
5092+
llvm::errs() << "Failed to listen, error: "
5093+
<< error.takeError() << "\n";
50975094
return EXIT_FAILURE;
50985095
}
50995096

5100-
std::string address = listener->GetListeningConnectionURI();
5097+
std::string address = llvm::join(listener->GetListeningConnectionURI(), ", ");
51015098

51025099
if (log)
51035100
*log << "started with connection listeners " << address << "\n";
51045101

5105-
std::cout << "Listening for: " << address << std::endl;
5102+
llvm::outs() << "Listening for: " << address << "\n";
51065103
// Ensure listening address are flushed for calles to retrieve the resolve
51075104
// address.
5108-
std::flush(std::cout);
5105+
llvm::outs().flush();
51095106

51105107
MainLoop mainloop;
51115108
mainloop.RegisterSignal(
@@ -5123,15 +5120,14 @@ int main(int argc, char *argv[]) {
51235120

51245121
auto handles = listener->Accept(mainloop, OnAccept);
51255122
if (auto Err = handles.takeError()) {
5126-
std::cerr << "failed to register accept() with the main loop: "
5127-
<< llvm::toString(std::move(Err)) << std::endl;
5123+
llvm::errs() << "failed to register accept() with the main loop: "
5124+
<< Err << "\n";
51285125
return EXIT_FAILURE;
51295126
}
51305127

51315128
error = mainloop.Run();
51325129
if (error.Fail()) {
5133-
std::cerr << "failed to accept()" << llvm::toString(error.takeError())
5134-
<< std::endl;
5130+
llvm::errs() << "failed to accept()" << error.takeError() << "\n";
51355131
return EXIT_FAILURE;
51365132
}
51375133

0 commit comments

Comments
 (0)