aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp')
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp27
1 files changed, 12 insertions, 15 deletions
diff --git a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index 91b9151328a8..700e6ebdf84c 100644
--- a/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -24,6 +24,7 @@
#include "lldb/Utility/Args.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/LLDBAssert.h"
+#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/State.h"
#include "lldb/Utility/StreamString.h"
@@ -642,7 +643,7 @@ DataBufferSP GDBRemoteCommunicationClient::ReadMemoryTags(lldb::addr_t addr,
}
size_t expected_bytes = response.GetBytesLeft() / 2;
- DataBufferSP buffer_sp(new DataBufferHeap(expected_bytes, 0));
+ WritableDataBufferSP buffer_sp(new DataBufferHeap(expected_bytes, 0));
size_t got_bytes = response.GetHexBytesAvail(buffer_sp->GetData());
// Check both because in some situations chars are consumed even
// if the decoding fails.
@@ -2227,8 +2228,10 @@ bool GDBRemoteCommunicationClient::GetCurrentProcessInfo(bool allow_lazy) {
m_process_arch.SetArchitecture(eArchTypeCOFF, cpu, sub);
break;
case llvm::Triple::GOFF:
+ case llvm::Triple::SPIRV:
case llvm::Triple::Wasm:
case llvm::Triple::XCOFF:
+ case llvm::Triple::DXContainer:
LLDB_LOGF(log, "error: not supported target architecture");
return false;
case llvm::Triple::UnknownObjectFormat:
@@ -2245,9 +2248,6 @@ bool GDBRemoteCommunicationClient::GetCurrentProcessInfo(bool allow_lazy) {
m_process_arch.GetTriple().setVendorName(llvm::StringRef(vendor_name));
m_process_arch.GetTriple().setOSName(llvm::StringRef(os_name));
m_process_arch.GetTriple().setEnvironmentName(llvm::StringRef(environment));
- m_host_arch.GetTriple().setVendorName(llvm::StringRef(vendor_name));
- m_host_arch.GetTriple().setOSName(llvm::StringRef(os_name));
- m_host_arch.GetTriple().setEnvironmentName(llvm::StringRef(environment));
}
return true;
}
@@ -2697,8 +2697,8 @@ GDBRemoteCommunicationClient::SendSetCurrentThreadPacket(uint64_t tid,
packet.Printf("%" PRIx64, tid);
StringExtractorGDBRemote response;
- if (SendPacketAndWaitForResponse(packet.GetString(), response)
- == PacketResult::Success) {
+ if (SendPacketAndWaitForResponse(packet.GetString(), response) ==
+ PacketResult::Success) {
if (response.IsOKResponse())
return {{pid, tid}};
@@ -2722,7 +2722,7 @@ bool GDBRemoteCommunicationClient::SetCurrentThread(uint64_t tid,
return true;
llvm::Optional<PidTid> ret = SendSetCurrentThreadPacket(tid, pid, 'g');
- if (ret.hasValue()) {
+ if (ret) {
if (ret->pid != LLDB_INVALID_PROCESS_ID)
m_curr_pid = ret->pid;
m_curr_tid = ret->tid;
@@ -2737,7 +2737,7 @@ bool GDBRemoteCommunicationClient::SetCurrentThreadForRun(uint64_t tid,
return true;
llvm::Optional<PidTid> ret = SendSetCurrentThreadPacket(tid, pid, 'c');
- if (ret.hasValue()) {
+ if (ret) {
if (ret->pid != LLDB_INVALID_PROCESS_ID)
m_curr_pid_run = ret->pid;
m_curr_tid_run = ret->tid;
@@ -2778,7 +2778,7 @@ bool GDBRemoteCommunicationClient::GetThreadStopInfo(
uint8_t GDBRemoteCommunicationClient::SendGDBStoppointTypePacket(
GDBStoppointType type, bool insert, addr_t addr, uint32_t length,
std::chrono::seconds timeout) {
- Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_BREAKPOINTS));
+ Log *log = GetLog(LLDBLog::Breakpoints);
LLDB_LOGF(log, "GDBRemoteCommunicationClient::%s() %s at addr = 0x%" PRIx64,
__FUNCTION__, insert ? "add" : "remove", addr);
@@ -2865,7 +2865,7 @@ GDBRemoteCommunicationClient::GetCurrentProcessAndThreadIDs(
if (!pid_tid)
break;
- ids.push_back(pid_tid.getValue());
+ ids.push_back(*pid_tid);
ch = response.GetChar(); // Skip the command separator
} while (ch == ','); // Make sure we got a comma separator
}
@@ -3443,7 +3443,7 @@ DataBufferSP GDBRemoteCommunicationClient::ReadRegister(lldb::tid_t tid,
!response.IsNormalResponse())
return nullptr;
- DataBufferSP buffer_sp(
+ WritableDataBufferSP buffer_sp(
new DataBufferHeap(response.GetStringRef().size() / 2, 0));
response.GetHexBytes(buffer_sp->GetData(), '\xcc');
return buffer_sp;
@@ -3458,7 +3458,7 @@ DataBufferSP GDBRemoteCommunicationClient::ReadAllRegisters(lldb::tid_t tid) {
!response.IsNormalResponse())
return nullptr;
- DataBufferSP buffer_sp(
+ WritableDataBufferSP buffer_sp(
new DataBufferHeap(response.GetStringRef().size() / 2, 0));
response.GetHexBytes(buffer_sp->GetData(), '\xcc');
return buffer_sp;
@@ -3701,9 +3701,6 @@ GDBRemoteCommunicationClient::SendTraceGetBinaryData(
GDBRemoteCommunication::PacketResult::Success) {
if (response.IsErrorResponse())
return response.GetStatus().ToError();
- if (response.IsUnsupportedResponse())
- return llvm::createStringError(llvm::inconvertibleErrorCode(),
- "jLLDBTraceGetBinaryData is unsupported");
std::string data;
response.GetEscapedBinaryData(data);
return std::vector<uint8_t>(data.begin(), data.end());