In debug mode, assert when we fail to get the sequence mutex. We need to remove as many places where this can happen as possible.

llvm-svn: 155138
This commit is contained in:
Jim Ingham 2012-04-19 16:57:50 +00:00
parent 8c9d9579c4
commit c1c19a6f02
1 changed files with 25 additions and 2 deletions

View File

@ -245,6 +245,12 @@ GDBRemoteRegisterContext::ReadRegisterBytes (const RegisterInfo *reg_info, DataE
else
{
LogSP log (ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet (GDBR_LOG_THREAD | GDBR_LOG_PACKETS));
#if LLDB_CONFIGURATION_DEBUG
StreamString strm;
gdb_comm.DumpHistory(strm);
Host::SetCrashDescription (strm.GetData());
assert (!"Didn't get sequence mutex for read register.");
#else
if (log)
{
if (log->GetVerbose())
@ -258,6 +264,7 @@ GDBRemoteRegisterContext::ReadRegisterBytes (const RegisterInfo *reg_info, DataE
log->Printf("error: failed to get packet sequence mutex, not sending read register for \"%s\"", reg_info->name);
}
}
#endif
}
// Make sure we got a valid register value after reading it
@ -441,6 +448,12 @@ GDBRemoteRegisterContext::WriteRegisterBytes (const lldb_private::RegisterInfo *
else
{
LogSP log (ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet (GDBR_LOG_THREAD | GDBR_LOG_PACKETS));
#if LLDB_CONFIGURATION_DEBUG
StreamString strm;
gdb_comm.DumpHistory(strm);
Host::SetCrashDescription (strm.GetData());
assert (!"Didn't get sequence mutex.");
#else
if (log)
{
if (log->GetVerbose())
@ -452,6 +465,7 @@ GDBRemoteRegisterContext::WriteRegisterBytes (const lldb_private::RegisterInfo *
else
log->Printf("error: failed to get packet sequence mutex, not sending write register for \"%s\"", reg_info->name);
}
#endif
}
}
return false;
@ -511,6 +525,12 @@ GDBRemoteRegisterContext::ReadAllRegisterValues (lldb::DataBufferSP &data_sp)
else
{
LogSP log (ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet (GDBR_LOG_THREAD | GDBR_LOG_PACKETS));
#if LLDB_CONFIGURATION_DEBUG
StreamString strm;
gdb_comm.DumpHistory(strm);
Host::SetCrashDescription (strm.GetData());
assert (!"Didn't get sequence mutex.");
#else
if (log)
{
if (log->GetVerbose())
@ -522,6 +542,7 @@ GDBRemoteRegisterContext::ReadAllRegisterValues (lldb::DataBufferSP &data_sp)
else
log->Printf("error: failed to get packet sequence mutex, not sending read all registers");
}
#endif
}
data_sp.reset();
@ -644,12 +665,14 @@ GDBRemoteRegisterContext::WriteAllRegisterValues (const lldb::DataBufferSP &data
else
{
LogSP log (ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet (GDBR_LOG_THREAD | GDBR_LOG_PACKETS));
if (log)
if (1 /* log */)
{
if (log->GetVerbose())
if (1 /*log->GetVerbose() */)
{
StreamString strm;
gdb_comm.DumpHistory(strm);
Host::SetCrashDescription (strm.GetData());
assert (!"Didn't get sequence mutex.");
log->Printf("error: failed to get packet sequence mutex, not sending write all registers:\n%s", strm.GetData());
}
else