aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp32
1 files changed, 15 insertions, 17 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index 7442f48..6e47e5b 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -956,7 +956,7 @@ llvm::VersionTuple GDBRemoteCommunicationClient::GetMacCatalystVersion() {
return m_maccatalyst_version;
}
-llvm::Optional<std::string> GDBRemoteCommunicationClient::GetOSBuildString() {
+std::optional<std::string> GDBRemoteCommunicationClient::GetOSBuildString() {
if (GetHostInfo()) {
if (!m_os_build.empty())
return m_os_build;
@@ -964,7 +964,7 @@ llvm::Optional<std::string> GDBRemoteCommunicationClient::GetOSBuildString() {
return std::nullopt;
}
-llvm::Optional<std::string>
+std::optional<std::string>
GDBRemoteCommunicationClient::GetOSKernelDescription() {
if (GetHostInfo()) {
if (!m_os_kernel.empty())
@@ -2688,10 +2688,8 @@ bool GDBRemoteCommunicationClient::KillSpawnedProcess(lldb::pid_t pid) {
return false;
}
-llvm::Optional<PidTid>
-GDBRemoteCommunicationClient::SendSetCurrentThreadPacket(uint64_t tid,
- uint64_t pid,
- char op) {
+std::optional<PidTid> GDBRemoteCommunicationClient::SendSetCurrentThreadPacket(
+ uint64_t tid, uint64_t pid, char op) {
lldb_private::StreamString packet;
packet.PutChar('H');
packet.PutChar(op);
@@ -2729,7 +2727,7 @@ bool GDBRemoteCommunicationClient::SetCurrentThread(uint64_t tid,
(m_curr_pid == pid || LLDB_INVALID_PROCESS_ID == pid))
return true;
- llvm::Optional<PidTid> ret = SendSetCurrentThreadPacket(tid, pid, 'g');
+ std::optional<PidTid> ret = SendSetCurrentThreadPacket(tid, pid, 'g');
if (ret) {
if (ret->pid != LLDB_INVALID_PROCESS_ID)
m_curr_pid = ret->pid;
@@ -2744,7 +2742,7 @@ bool GDBRemoteCommunicationClient::SetCurrentThreadForRun(uint64_t tid,
(m_curr_pid_run == pid || LLDB_INVALID_PROCESS_ID == pid))
return true;
- llvm::Optional<PidTid> ret = SendSetCurrentThreadPacket(tid, pid, 'c');
+ std::optional<PidTid> ret = SendSetCurrentThreadPacket(tid, pid, 'c');
if (ret) {
if (ret->pid != LLDB_INVALID_PROCESS_ID)
m_curr_pid_run = ret->pid;
@@ -3088,7 +3086,7 @@ bool GDBRemoteCommunicationClient::CloseFile(lldb::user_id_t fd,
return false;
}
-llvm::Optional<GDBRemoteFStatData>
+std::optional<GDBRemoteFStatData>
GDBRemoteCommunicationClient::FStat(lldb::user_id_t fd) {
lldb_private::StreamString stream;
stream.Printf("vFile:fstat:%" PRIx64, fd);
@@ -3112,13 +3110,13 @@ GDBRemoteCommunicationClient::FStat(lldb::user_id_t fd) {
return std::nullopt;
}
-llvm::Optional<GDBRemoteFStatData>
+std::optional<GDBRemoteFStatData>
GDBRemoteCommunicationClient::Stat(const lldb_private::FileSpec &file_spec) {
Status error;
lldb::user_id_t fd = OpenFile(file_spec, File::eOpenOptionReadOnly, 0, error);
if (fd == UINT64_MAX)
return std::nullopt;
- llvm::Optional<GDBRemoteFStatData> st = FStat(fd);
+ std::optional<GDBRemoteFStatData> st = FStat(fd);
CloseFile(fd, error);
return st;
}
@@ -3146,7 +3144,7 @@ lldb::user_id_t GDBRemoteCommunicationClient::GetFileSize(
}
// Fallback to fstat.
- llvm::Optional<GDBRemoteFStatData> st = Stat(file_spec);
+ std::optional<GDBRemoteFStatData> st = Stat(file_spec);
return st ? st->gdb_st_size : UINT64_MAX;
}
@@ -3217,7 +3215,7 @@ GDBRemoteCommunicationClient::GetFilePermissions(const FileSpec &file_spec,
}
// Fallback to fstat.
- if (llvm::Optional<GDBRemoteFStatData> st = Stat(file_spec)) {
+ if (std::optional<GDBRemoteFStatData> st = Stat(file_spec)) {
file_permissions = st->gdb_st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
return Status();
}
@@ -3720,7 +3718,7 @@ GDBRemoteCommunicationClient::SendTraceGetBinaryData(
escaped_packet.GetData());
}
-llvm::Optional<QOffsets> GDBRemoteCommunicationClient::GetQOffsets() {
+std::optional<QOffsets> GDBRemoteCommunicationClient::GetQOffsets() {
StringExtractorGDBRemote response;
if (SendPacketAndWaitForResponse("qOffsets", response) !=
PacketResult::Success)
@@ -3826,7 +3824,7 @@ bool GDBRemoteCommunicationClient::GetModuleInfo(
return true;
}
-static llvm::Optional<ModuleSpec>
+static std::optional<ModuleSpec>
ParseModuleSpec(StructuredData::Dictionary *dict) {
ModuleSpec result;
if (!dict)
@@ -3859,7 +3857,7 @@ ParseModuleSpec(StructuredData::Dictionary *dict) {
return result;
}
-llvm::Optional<std::vector<ModuleSpec>>
+std::optional<std::vector<ModuleSpec>>
GDBRemoteCommunicationClient::GetModulesInfo(
llvm::ArrayRef<FileSpec> module_file_specs, const llvm::Triple &triple) {
namespace json = llvm::json;
@@ -3906,7 +3904,7 @@ GDBRemoteCommunicationClient::GetModulesInfo(
std::vector<ModuleSpec> result;
for (size_t i = 0; i < response_array->GetSize(); ++i) {
- if (llvm::Optional<ModuleSpec> module_spec = ParseModuleSpec(
+ if (std::optional<ModuleSpec> module_spec = ParseModuleSpec(
response_array->GetItemAtIndex(i)->GetAsDictionary()))
result.push_back(*module_spec);
}