<rdar://problem/11752499>

Improve error messages when memory read/write fails.

llvm-svn: 164188
This commit is contained in:
Greg Clayton 2012-09-19 01:46:31 +00:00
parent 2b4896ff8e
commit 9944cd7f7a
1 changed files with 6 additions and 6 deletions

View File

@ -1904,11 +1904,11 @@ ProcessGDBRemote::DoReadMemory (addr_t addr, void *buf, size_t size, Error &erro
return response.GetHexBytes(buf, size, '\xdd');
}
else if (response.IsErrorResponse())
error.SetErrorStringWithFormat("gdb remote returned an error: %s", response.GetStringRef().c_str());
error.SetErrorString("memory read failed");
else if (response.IsUnsupportedResponse())
error.SetErrorStringWithFormat("'%s' packet unsupported", packet);
error.SetErrorStringWithFormat("GDB server does not support reading memory");
else
error.SetErrorStringWithFormat("unexpected response to '%s': '%s'", packet, response.GetStringRef().c_str());
error.SetErrorStringWithFormat("unexpected response to GDB server memory read packet '%s': '%s'", packet, response.GetStringRef().c_str());
}
else
{
@ -1940,11 +1940,11 @@ ProcessGDBRemote::DoWriteMemory (addr_t addr, const void *buf, size_t size, Erro
return size;
}
else if (response.IsErrorResponse())
error.SetErrorStringWithFormat("gdb remote returned an error: %s", response.GetStringRef().c_str());
error.SetErrorString("memory write failed");
else if (response.IsUnsupportedResponse())
error.SetErrorStringWithFormat("'%s' packet unsupported", packet.GetString().c_str());
error.SetErrorStringWithFormat("GDB server does not support writing memory");
else
error.SetErrorStringWithFormat("unexpected response to '%s': '%s'", packet.GetString().c_str(), response.GetStringRef().c_str());
error.SetErrorStringWithFormat("unexpected response to GDB server memory write packet '%s': '%s'", packet.GetString().c_str(), response.GetStringRef().c_str());
}
else
{