summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2017-02-05 00:44:54 +0000
committerPavel Labath <labath@google.com>2017-02-05 00:44:54 +0000
commit3b7e1981b2f66e0677f964a3e9cf30ce2d7d3f84 (patch)
tree235951d23167dfb1ee2385c906175011780ba1e7 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
parent978fdb75a4a21d8209b51c08d4bcd16a43e0779d (diff)
downloadbcm5719-llvm-3b7e1981b2f66e0677f964a3e9cf30ce2d7d3f84.tar.gz
bcm5719-llvm-3b7e1981b2f66e0677f964a3e9cf30ce2d7d3f84.zip
Remove LIBLLDB_LOG_VERBOSE category
Summary: Per discussion in D28616, having two ways two request logging (log enable lldb XXX verbose && log enable -v lldb XXX) is confusing. This removes the first option and standardizes all code to use the second one. I've added a LLDB_LOGV macro as a shorthand for if(log && log->GetVerbose()) and switched most of the affected log statements to use that (I've only left a couple of cases that were doing complex computations in an if(log) block). Reviewers: jingham, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D29510 llvm-svn: 294113
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp36
1 files changed, 12 insertions, 24 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index 357b48e53c4..56ddae14bcb 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -142,14 +142,9 @@ public:
~InitializePythonRAII() {
if (m_was_already_initialized) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_SCRIPT |
- LIBLLDB_LOG_VERBOSE));
-
- if (log) {
- log->Printf("Releasing PyGILState. Returning to state = %slocked\n",
- m_was_already_initialized == PyGILState_UNLOCKED ? "un"
- : "");
- }
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_SCRIPT));
+ LLDB_LOGV(log, "Releasing PyGILState. Returning to state = {0}locked",
+ m_was_already_initialized == PyGILState_UNLOCKED ? "un" : "");
PyGILState_Release(m_gil_state);
} else {
// We initialized the threads in this function, just unlock the GIL.
@@ -174,15 +169,12 @@ private:
void InitializeThreadsPrivate() {
if (PyEval_ThreadsInitialized()) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_SCRIPT |
- LIBLLDB_LOG_VERBOSE));
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_SCRIPT));
m_was_already_initialized = true;
m_gil_state = PyGILState_Ensure();
- if (log) {
- log->Printf("Ensured PyGILState. Previous state = %slocked\n",
- m_gil_state == PyGILState_UNLOCKED ? "un" : "");
- }
+ LLDB_LOGV(log, "Ensured PyGILState. Previous state = {0}locked\n",
+ m_gil_state == PyGILState_UNLOCKED ? "un" : "");
return;
}
@@ -212,12 +204,10 @@ ScriptInterpreterPython::Locker::Locker(ScriptInterpreterPython *py_interpreter,
}
bool ScriptInterpreterPython::Locker::DoAcquireLock() {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_SCRIPT |
- LIBLLDB_LOG_VERBOSE));
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_SCRIPT));
m_GILState = PyGILState_Ensure();
- if (log)
- log->Printf("Ensured PyGILState. Previous state = %slocked\n",
- m_GILState == PyGILState_UNLOCKED ? "un" : "");
+ LLDB_LOGV(log, "Ensured PyGILState. Previous state = {0}locked",
+ m_GILState == PyGILState_UNLOCKED ? "un" : "");
// we need to save the thread state when we first start the command
// because we might decide to interrupt it while some action is taking
@@ -239,11 +229,9 @@ bool ScriptInterpreterPython::Locker::DoInitSession(uint16_t on_entry_flags,
}
bool ScriptInterpreterPython::Locker::DoFreeLock() {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_SCRIPT |
- LIBLLDB_LOG_VERBOSE));
- if (log)
- log->Printf("Releasing PyGILState. Returning to state = %slocked\n",
- m_GILState == PyGILState_UNLOCKED ? "un" : "");
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_SCRIPT));
+ LLDB_LOGV(log, "Releasing PyGILState. Returning to state = {0}locked",
+ m_GILState == PyGILState_UNLOCKED ? "un" : "");
PyGILState_Release(m_GILState);
m_python_interpreter->DecrementLockCount();
return true;
OpenPOWER on IntegriCloud