summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2012-04-19 16:57:50 +0000
committerJim Ingham <jingham@apple.com>2012-04-19 16:57:50 +0000
commitc1c19a6f0266f77c6177f5f54c9955be5abc93d8 (patch)
tree02f71c62b971bf7b6ddc6533e8ca6d0707b7ba87 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
parent8c9d9579c456012df59a352da2c37a5cb8ef65ba (diff)
downloadbcm5719-llvm-c1c19a6f0266f77c6177f5f54c9955be5abc93d8.tar.gz
bcm5719-llvm-c1c19a6f0266f77c6177f5f54c9955be5abc93d8.zip
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
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
index 7ace1ebe477..70ffacbcc4e 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
@@ -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
OpenPOWER on IntegriCloud