Revert "[lldb] Only send "posix" error codes through the gdb-remote protocol"
This reverts commit a7c174502aef45b2d33291129cce10c085fef944.
This commit is contained in:
parent
cb6d53198e
commit
6dcde731eb
@ -103,14 +103,13 @@ GDBRemoteCommunicationServer::SendErrorResponse(uint8_t err) {
|
||||
|
||||
GDBRemoteCommunication::PacketResult
|
||||
GDBRemoteCommunicationServer::SendErrorResponse(const Status &error) {
|
||||
uint8_t code = error.GetType() == eErrorTypePOSIX ? error.GetError() : 0xff;
|
||||
if (m_send_error_strings) {
|
||||
lldb_private::StreamString packet;
|
||||
packet.Printf("E%2.2x;", code);
|
||||
packet.Printf("E%2.2x;", static_cast<uint8_t>(error.GetError()));
|
||||
packet.PutStringAsRawHex8(error.AsCString());
|
||||
return SendPacketNoLock(packet.GetString());
|
||||
}
|
||||
return SendErrorResponse(code);
|
||||
} else
|
||||
return SendErrorResponse(error.GetError());
|
||||
}
|
||||
|
||||
GDBRemoteCommunication::PacketResult
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h"
|
||||
#include "lldb/Utility/Connection.h"
|
||||
#include "lldb/Utility/UnimplementedError.h"
|
||||
#include "lldb/lldb-enumerations.h"
|
||||
|
||||
namespace lldb_private {
|
||||
namespace process_gdb_remote {
|
||||
@ -26,7 +25,7 @@ TEST(GDBRemoteCommunicationServerTest, SendErrorResponse_ErrorNumber) {
|
||||
|
||||
TEST(GDBRemoteCommunicationServerTest, SendErrorResponse_Status) {
|
||||
MockServerWithMockConnection server;
|
||||
Status status(0x42, lldb::eErrorTypePOSIX, "Test error message");
|
||||
Status status(0x42, lldb::eErrorTypeGeneric, "Test error message");
|
||||
server.SendErrorResponse(status);
|
||||
|
||||
EXPECT_THAT(
|
||||
|
Loading…
x
Reference in New Issue
Block a user