From a63d08c9ff246e83ea61f1ae7eafe41d37035d45 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Tue, 19 Jul 2011 03:57:15 +0000 Subject: Modified the LocateMacOSXFilesUsingDebugSymbols(...) function to locate an executable file if it is right next to a dSYM file that is found using DebugSymbols. The code also looks into a bundle if the dSYM file is right next to a bundle. Modified the MacOSX kernel dynamic loader plug-in to correctly set the load address for kext sections. This is a tad tricky because of how LLDB chooses to treat mach-o segments with no name. Also modified the loader to properly handle the older version 1 kext summary info. Fixed a crasher in the Mach-o object file parser when it is trying to set the section size correctly for dSYM sections. Added packet dumpers to the CommunicationKDP class. We now also properly detect address byte sizes based on the cpu type and subtype that is provided. Added a read memory and read register support to CommunicationKDP. Added a ThreadKDP class that now uses subclasses of the RegisterContextDarwin_XXX for arm, i386 and x86_64. Fixed some register numbering issues in the RegisterContextDarwin_arm class and added ARM GDB numbers to the ARM_GCC_Registers.h file. Change the RegisterContextMach_XXX classes over to subclassing their RegisterContextDarwin_XXX counterparts so we can share the mach register contexts between the user and kernel plug-ins. llvm-svn: 135466 --- .../Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp | 54 ++++++++++------------ 1 file changed, 25 insertions(+), 29 deletions(-) (limited to 'lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp') diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp index 77d3d1ced2b..6d33ea28634 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp @@ -18,11 +18,12 @@ #include "lldb/Core/State.h" #include "lldb/Host/Host.h" #include "lldb/Target/Target.h" +#include "lldb/Target/Thread.h" // Project includes #include "ProcessKDP.h" #include "ProcessKDPLog.h" -//#include "ThreadKDP.h" +#include "ThreadKDP.h" #include "StopInfoMachException.h" using namespace lldb; @@ -182,7 +183,10 @@ ProcessKDP::DoConnectRemote (const char *remote_url) ArchSpec kernel_arch; kernel_arch.SetArchitecture(eArchTypeMachO, cpu, sub); m_target.SetArchitecture(kernel_arch); - // TODO: thread registers based off of architecture... + + SetID (1); + UpdateThreadListIfNeeded (); + SetPrivateState (eStateStopped); } } else @@ -295,34 +299,24 @@ ProcessKDP::UpdateThreadListIfNeeded () log->Printf ("ProcessKDP::%s (pid = %i)", __FUNCTION__, GetID()); Mutex::Locker locker (m_thread_list.GetMutex ()); - // TODO: get the thread list here! const uint32_t stop_id = GetStopID(); - if (m_thread_list.GetSize(false) == 0 || stop_id != m_thread_list.GetStopID()) + if (m_thread_list.GetSize(false) == 0) { - // Update the thread list's stop id immediately so we don't recurse into this function. -// ThreadList curr_thread_list (this); -// curr_thread_list.SetStopID(stop_id); -// -// std::vector thread_ids; -// bool sequence_mutex_unavailable = false; -// const size_t num_thread_ids = m_comm.GetCurrentThreadIDs (thread_ids, sequence_mutex_unavailable); -// if (num_thread_ids > 0) -// { -// for (size_t i=0; i