From 1a76930ec58c9367e47fe6c70b1a1844e715b011 Mon Sep 17 00:00:00 2001 From: Nathan Beckmann Date: Thu, 10 Sep 2009 13:34:09 -0400 Subject: [PATCH] [pin/thread][pin/tls] Add error checking for PIN TLS. Still broken, PIN_RegisterNewThread does not exist. --- pin/pin_thread.cc | 1 + pin/pin_tls.cc | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pin/pin_thread.cc b/pin/pin_thread.cc index 2fd79d34..7f8047a7 100644 --- a/pin/pin_thread.cc +++ b/pin/pin_thread.cc @@ -9,6 +9,7 @@ PinThreadRunner::PinThreadRunner(Thread::ThreadFunc func, void *param) void PinThreadRunner::RunThread(OS_SERVICES::ITHREAD *) { +// PIN_RegisterNewThread(); m_func(m_param); } diff --git a/pin/pin_tls.cc b/pin/pin_tls.cc index 7da73fb5..09eb4eb4 100644 --- a/pin/pin_tls.cc +++ b/pin/pin_tls.cc @@ -1,4 +1,5 @@ #include "tls.h" +#include "log.h" #include class PinTLS : public TLS @@ -26,7 +27,11 @@ class PinTLS : public TLS void set(void *vp) { - PIN_SetThreadData(m_key, vp); + LOG_PRINT("%p->set(%p)", this, vp); + LOG_ASSERT_ERROR( + PIN_SetThreadData(m_key, vp), + "Error setting TLS -- pin tid = %d", + PIN_ThreadId()); } private: