diff options
author | dim <dim@FreeBSD.org> | 2015-09-06 18:37:19 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-09-06 18:37:19 +0000 |
commit | 23814158e5384f73c6fa951b66d5f807f9c24a2b (patch) | |
tree | 9d2de4884bec31a1e16bbf0b5a6bfb90d96e16af /source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | |
parent | 80b639cd40df427b9e325318efeec2d885a65f62 (diff) | |
download | FreeBSD-src-23814158e5384f73c6fa951b66d5f807f9c24a2b.zip FreeBSD-src-23814158e5384f73c6fa951b66d5f807f9c24a2b.tar.gz |
Import stripped lldb 3.7.0 release (r246257).
Diffstat (limited to 'source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp')
-rw-r--r-- | source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 2a253c5..b8c67c5 100644 --- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -1459,6 +1459,21 @@ GDBRemoteCommunicationClient::GetCurrentProcessID (bool allow_lazy) } } } + + // If we don't get a response for $qC, check if $qfThreadID gives us a result. + if (m_curr_pid == LLDB_INVALID_PROCESS_ID) + { + std::vector<lldb::tid_t> thread_ids; + bool sequence_mutex_unavailable; + size_t size; + size = GetCurrentThreadIDs (thread_ids, sequence_mutex_unavailable); + if (size && sequence_mutex_unavailable == false) + { + m_curr_pid = thread_ids.front(); + m_curr_pid_is_valid = eLazyBoolYes; + return m_curr_pid; + } + } } return LLDB_INVALID_PROCESS_ID; @@ -2472,26 +2487,45 @@ GDBRemoteCommunicationClient::GetWatchpointSupportInfo (uint32_t &num) } lldb_private::Error -GDBRemoteCommunicationClient::GetWatchpointSupportInfo (uint32_t &num, bool& after) +GDBRemoteCommunicationClient::GetWatchpointSupportInfo (uint32_t &num, bool& after, const ArchSpec &arch) { Error error(GetWatchpointSupportInfo(num)); if (error.Success()) - error = GetWatchpointsTriggerAfterInstruction(after); + error = GetWatchpointsTriggerAfterInstruction(after, arch); return error; } lldb_private::Error -GDBRemoteCommunicationClient::GetWatchpointsTriggerAfterInstruction (bool &after) +GDBRemoteCommunicationClient::GetWatchpointsTriggerAfterInstruction (bool &after, const ArchSpec &arch) { Error error; + llvm::Triple::ArchType atype = arch.GetMachine(); // we assume watchpoints will happen after running the relevant opcode // and we only want to override this behavior if we have explicitly // received a qHostInfo telling us otherwise if (m_qHostInfo_is_valid != eLazyBoolYes) - after = true; + { + // On targets like MIPS, watchpoint exceptions are always generated + // before the instruction is executed. The connected target may not + // support qHostInfo or qWatchpointSupportInfo packets. + if (atype == llvm::Triple::mips || atype == llvm::Triple::mipsel + || atype == llvm::Triple::mips64 || atype == llvm::Triple::mips64el) + after = false; + else + after = true; + } else + { + // For MIPS, set m_watchpoints_trigger_after_instruction to eLazyBoolNo + // if it is not calculated before. + if (m_watchpoints_trigger_after_instruction == eLazyBoolCalculate && + (atype == llvm::Triple::mips || atype == llvm::Triple::mipsel + || atype == llvm::Triple::mips64 || atype == llvm::Triple::mips64el)) + m_watchpoints_trigger_after_instruction = eLazyBoolNo; + after = (m_watchpoints_trigger_after_instruction != eLazyBoolNo); + } return error; } |