Adding Support for Error Strings in Remote Packets
Summary:
This patch adds support for sending strings along with
error codes in the reply packets. The implementation is
based on the feedback recieved in the lldb-dev mailing
list. The patch also adds an extra packet for the client
to query if the server has the capability to provide
strings along with error replys.
Reviewers: labath, jingham, sas, lldb-commits, clayborg
Reviewed By: labath, clayborg
Differential Revision: https://reviews.llvm.org/D34945
llvm-svn: 307768
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
index c2aa261..a7fe4ee 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
@@ -1123,7 +1123,7 @@
uid = m_debugged_process_sp->StartTrace(options, error);
LLDB_LOG(log, "uid is {0} , error is {1}", uid, error.GetError());
if (error.Fail())
- return SendErrorResponse(error.GetError());
+ return SendErrorResponse(error);
StreamGDBRemote response;
response.Printf("%" PRIx64, uid);
@@ -1160,7 +1160,7 @@
Status error = m_debugged_process_sp->StopTrace(uid, tid);
if (error.Fail())
- return SendErrorResponse(error.GetError());
+ return SendErrorResponse(error);
return SendOKResponse();
}
@@ -1203,7 +1203,7 @@
Status error = m_debugged_process_sp->GetTraceConfig(uid, options);
if (error.Fail())
- return SendErrorResponse(error.GetError());
+ return SendErrorResponse(error);
StreamGDBRemote escaped_response;
StructuredData::Dictionary json_packet;
@@ -1279,7 +1279,7 @@
error = m_debugged_process_sp->GetMetaData(uid, tid, buf, offset);
if (error.Fail())
- return SendErrorResponse(error.GetError());
+ return SendErrorResponse(error);
for (auto i : buf)
response.PutHex8(i);