forked from OSchip/llvm-project
Any time ProcessGDBRemote tries to get the remote's ProcessArchitecture,
it needs to fall back to using the HostArchitecture if a valid one is not returned. When doing low-level system debugging we may not have a process (or the remote stub may not support the qProcessInfo packet) in which case we should fall back to the architecture we determined via qHostInfo. <rdar://problem/15713180> llvm-svn: 197857
This commit is contained in:
parent
bc043f27f4
commit
c62bd7bd24
|
@ -619,11 +619,18 @@ ProcessGDBRemote::DoConnectRemote (Stream *strm, const char *remote_url)
|
|||
GetThreadList();
|
||||
if (m_gdb_comm.SendPacketAndWaitForResponse("?", 1, m_last_stop_packet, false) == GDBRemoteCommunication::PacketResult::Success)
|
||||
{
|
||||
if (!m_target.GetArchitecture().IsValid()) { // Make sure we have an architecture
|
||||
m_target.SetArchitecture(m_gdb_comm.GetProcessArchitecture());
|
||||
if (!m_target.GetArchitecture().IsValid())
|
||||
{
|
||||
if (m_gdb_comm.GetProcessArchitecture().IsValid())
|
||||
{
|
||||
m_target.SetArchitecture(m_gdb_comm.GetProcessArchitecture());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_target.SetArchitecture(m_gdb_comm.GetHostArchitecture());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const StateType state = SetThreadStopInfo (m_last_stop_packet);
|
||||
if (state == eStateStopped)
|
||||
{
|
||||
|
@ -809,8 +816,16 @@ ProcessGDBRemote::DoLaunch (Module *exe_module, ProcessLaunchInfo &launch_info)
|
|||
|
||||
if (m_gdb_comm.SendPacketAndWaitForResponse("?", 1, m_last_stop_packet, false) == GDBRemoteCommunication::PacketResult::Success)
|
||||
{
|
||||
if (!m_target.GetArchitecture().IsValid()) { // Make sure we have an architecture
|
||||
m_target.SetArchitecture(m_gdb_comm.GetProcessArchitecture());
|
||||
if (!m_target.GetArchitecture().IsValid())
|
||||
{
|
||||
if (m_gdb_comm.GetProcessArchitecture().IsValid())
|
||||
{
|
||||
m_target.SetArchitecture(m_gdb_comm.GetProcessArchitecture());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_target.SetArchitecture(m_gdb_comm.GetHostArchitecture());
|
||||
}
|
||||
}
|
||||
|
||||
SetPrivateState (SetThreadStopInfo (m_last_stop_packet));
|
||||
|
|
Loading…
Reference in New Issue