summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common/Host.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2010-12-03 06:02:24 +0000
committerGreg Clayton <gclayton@apple.com>2010-12-03 06:02:24 +0000
commite5219660542e7126c7de8f2bd945f05d238760a4 (patch)
treeecc0d3c75273eeba285fbcbbefde043e1eea6325 /lldb/source/Host/common/Host.cpp
parente0c4560b50b1b89649a8b06c1b138bf1d3bb8c99 (diff)
downloadbcm5719-llvm-e5219660542e7126c7de8f2bd945f05d238760a4.tar.gz
bcm5719-llvm-e5219660542e7126c7de8f2bd945f05d238760a4.zip
Fixed a race condition that could cause ProcessGDBRemote::DoResume() to return
an error saying the resume timed out. Previously the thread that was trying to resume the process would eventually call ProcessGDBRemote::DoResume() which would broadcast an event over to the async GDB remote thread which would sent the continue packet to the remote gdb server. Right after this was sent, it would set a predicate boolean value (protected by a mutex and condition) and then the thread that issued the ProcessGDBRemote::DoResume() would then wait for that condition variable to be set. If the async gdb thread was too quick though, the predicate boolean value could have been set to true and back to false by the time the thread that issued the ProcessGDBRemote::DoResume() checks the boolean value. So we can't use the predicate value as a handshake. I have changed the code over to using a Event by having the GDB remote communication object post an event: GDBRemoteCommunication::eBroadcastBitRunPacketSent This allows reliable handshaking between the two threads and avoids the erroneous ProcessGDBRemote::DoResume() errors. Added a host backtrace service to allow in process backtraces when trying to track down tricky issues. I need to see if LLVM has any backtracing abilities abstracted in it already, and if so, use that, but I needed something ASAP for the current issue I was working on. The static function is: void Host::Backtrace (Stream &strm, uint32_t max_frames); And it will backtrace at most "max_frames" frames for the current thread and can be used with any of the Stream subclasses for logging. llvm-svn: 120793
Diffstat (limited to 'lldb/source/Host/common/Host.cpp')
-rw-r--r--lldb/source/Host/common/Host.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp
index a51fa3d6def..c00c87f5ef7 100644
--- a/lldb/source/Host/common/Host.cpp
+++ b/lldb/source/Host/common/Host.cpp
@@ -402,6 +402,13 @@ void
Host::ThreadCreated (const char *thread_name)
{
}
+
+void
+Host::Backtrace (Stream &strm, uint32_t max_frames)
+{
+ // TODO: Is there a way to backtrace the current process on linux?
+}
+
#endif
struct HostThreadCreateInfo
OpenPOWER on IntegriCloud