diff options
author | Pavel Labath <pavel@labath.sk> | 2022-09-06 15:36:23 +0200 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2022-09-09 15:10:38 +0200 |
commit | 681d0d9e5f05405e4d0048e40796c5d08e85db93 (patch) | |
tree | f208dfc1a663f0c72e8947baf1fcd5d5844c1fb0 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp | |
parent | 89a3691b794cee20187e14a750ecde8b6d3f7e71 (diff) | |
download | llvm-681d0d9e5f05405e4d0048e40796c5d08e85db93.zip llvm-681d0d9e5f05405e4d0048e40796c5d08e85db93.tar.gz llvm-681d0d9e5f05405e4d0048e40796c5d08e85db93.tar.bz2 |
[lldb-server] Report launch error in vRun packets
Uses our existing "error string" extension to provide a better
indication of why the launch failed (the client does not make use of the
error yet).
Also, fix the way we obtain the launch error message (make sure we read
the whole message, and skip trailing garbage), and reduce the size of
TestLldbGdbServer by splitting some tests into a separate file.
Differential Revision: https://reviews.llvm.org/D133352
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp index 6ca5c41..089b6ee 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp @@ -3517,19 +3517,17 @@ GDBRemoteCommunicationServerLLGS::Handle_vRun( arg.c_str()); } - if (!argv.empty()) { - m_process_launch_info.GetExecutableFile().SetFile( - m_process_launch_info.GetArguments()[0].ref(), FileSpec::Style::native); - m_process_launch_error = LaunchProcess(); - if (m_process_launch_error.Success()) { - assert(m_current_process); - return SendStopReasonForState(*m_current_process, - m_current_process->GetState(), - /*force_synchronous=*/true); - } - LLDB_LOG(log, "failed to launch exe: {0}", m_process_launch_error); - } - return SendErrorResponse(8); + if (argv.empty()) + return SendErrorResponse(Status("No arguments")); + m_process_launch_info.GetExecutableFile().SetFile( + m_process_launch_info.GetArguments()[0].ref(), FileSpec::Style::native); + m_process_launch_error = LaunchProcess(); + if (m_process_launch_error.Fail()) + return SendErrorResponse(m_process_launch_error); + assert(m_current_process); + return SendStopReasonForState(*m_current_process, + m_current_process->GetState(), + /*force_synchronous=*/true); } GDBRemoteCommunication::PacketResult |