diff options
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 2a253c5a99e82..b8c67c593b1f2 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;  } | 
