Added a new "lldb" log channel named "os" for the OperatingSystem plug-ins to use.
Added logging for the OS plug-in python objects in OperatingSystemPython so we can see the python dictionary returned from the plug-in when logging is enabled. llvm-svn: 182530
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "lldb/Core/Module.h"
|
||||
#include "lldb/Core/PluginManager.h"
|
||||
#include "lldb/Core/RegisterValue.h"
|
||||
#include "lldb/Core/StreamString.h"
|
||||
#include "lldb/Core/ValueObjectVariable.h"
|
||||
#include "lldb/Interpreter/CommandInterpreter.h"
|
||||
#include "lldb/Interpreter/PythonDataObjects.h"
|
||||
@@ -134,7 +135,7 @@ OperatingSystemPython::GetDynamicRegisterInfo ()
|
||||
{
|
||||
if (!m_interpreter || !m_python_object_sp)
|
||||
return NULL;
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OS));
|
||||
|
||||
if (log)
|
||||
log->Printf ("OperatingSystemPython::GetDynamicRegisterInfo() fetching thread register definitions from python for pid %" PRIu64, m_process->GetID());
|
||||
@@ -173,7 +174,7 @@ OperatingSystemPython::UpdateThreadList (ThreadList &old_thread_list,
|
||||
if (!m_interpreter || !m_python_object_sp)
|
||||
return false;
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OS));
|
||||
|
||||
// First thing we have to do is get the API lock, and the run lock. We're going to change the thread
|
||||
// content of the process, and we're going to use python, which requires the API lock to do it.
|
||||
@@ -191,6 +192,12 @@ OperatingSystemPython::UpdateThreadList (ThreadList &old_thread_list,
|
||||
PythonList threads_list(m_interpreter->OSPlugin_ThreadsInfo(m_python_object_sp));
|
||||
if (threads_list)
|
||||
{
|
||||
if (log)
|
||||
{
|
||||
StreamString strm;
|
||||
threads_list.Dump(strm);
|
||||
log->Printf("threads_list = %s", strm.GetString().c_str());
|
||||
}
|
||||
uint32_t i;
|
||||
const uint32_t num_threads = threads_list.GetSize();
|
||||
if (num_threads > 0)
|
||||
|
||||
Reference in New Issue
Block a user