summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/DynamicLoader
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/DynamicLoader')
-rw-r--r--lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp36
-rw-r--r--lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h6
-rw-r--r--lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h4
-rw-r--r--lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp22
-rw-r--r--lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h2
-rw-r--r--lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp17
-rw-r--r--lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h6
-rw-r--r--lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp28
-rw-r--r--lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h6
-rw-r--r--lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h4
-rw-r--r--lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp12
-rw-r--r--lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h6
12 files changed, 0 insertions, 149 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index 45f6d49577c..b377c23abb0 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -119,11 +119,9 @@ static const DynamicLoaderDarwinKernelPropertiesSP &GetGlobalProperties() {
return g_settings_sp;
}
-//----------------------------------------------------------------------
// Create an instance of this class. This function is filled into the plugin
// info class that gets handed out by the plugin factory and allows the lldb to
// instantiate an instance of this class.
-//----------------------------------------------------------------------
DynamicLoader *DynamicLoaderDarwinKernel::CreateInstance(Process *process,
bool force) {
if (!force) {
@@ -194,11 +192,9 @@ DynamicLoaderDarwinKernel::SearchForDarwinKernel(Process *process) {
return kernel_load_address;
}
-//----------------------------------------------------------------------
// Check if the kernel binary is loaded in memory without a slide. First verify
// that the ExecutableModule is a kernel before we proceed. Returns the address
// of the kernel if one was found, else LLDB_INVALID_ADDRESS.
-//----------------------------------------------------------------------
lldb::addr_t
DynamicLoaderDarwinKernel::SearchForKernelAtSameLoadAddr(Process *process) {
Module *exe_module = process->GetTarget().GetExecutableModulePointer();
@@ -224,11 +220,9 @@ DynamicLoaderDarwinKernel::SearchForKernelAtSameLoadAddr(Process *process) {
return LLDB_INVALID_ADDRESS;
}
-//----------------------------------------------------------------------
// If the debug flag is included in the boot-args nvram setting, the kernel's
// load address will be noted in the lowglo page at a fixed address Returns the
// address of the kernel if one was found, else LLDB_INVALID_ADDRESS.
-//----------------------------------------------------------------------
lldb::addr_t
DynamicLoaderDarwinKernel::SearchForKernelWithDebugHints(Process *process) {
if (GetGlobalProperties()->GetScanType() == eKASLRScanNone)
@@ -275,13 +269,11 @@ DynamicLoaderDarwinKernel::SearchForKernelWithDebugHints(Process *process) {
return LLDB_INVALID_ADDRESS;
}
-//----------------------------------------------------------------------
// If the kernel is currently executing when lldb attaches, and we don't have a
// better way of finding the kernel's load address, try searching backwards
// from the current pc value looking for the kernel's Mach header in memory.
// Returns the address of the kernel if one was found, else
// LLDB_INVALID_ADDRESS.
-//----------------------------------------------------------------------
lldb::addr_t
DynamicLoaderDarwinKernel::SearchForKernelNearPC(Process *process) {
if (GetGlobalProperties()->GetScanType() == eKASLRScanNone ||
@@ -336,12 +328,10 @@ DynamicLoaderDarwinKernel::SearchForKernelNearPC(Process *process) {
return LLDB_INVALID_ADDRESS;
}
-//----------------------------------------------------------------------
// Scan through the valid address range for a kernel binary. This is uselessly
// slow in 64-bit environments so we don't even try it. This scan is not
// enabled by default even for 32-bit targets. Returns the address of the
// kernel if one was found, else LLDB_INVALID_ADDRESS.
-//----------------------------------------------------------------------
lldb::addr_t DynamicLoaderDarwinKernel::SearchForKernelViaExhaustiveSearch(
Process *process) {
if (GetGlobalProperties()->GetScanType() != eKASLRScanExhaustiveScan) {
@@ -381,12 +371,10 @@ lldb::addr_t DynamicLoaderDarwinKernel::SearchForKernelViaExhaustiveSearch(
return LLDB_INVALID_ADDRESS;
}
-//----------------------------------------------------------------------
// Read the mach_header struct out of memory and return it.
// Returns true if the mach_header was successfully read,
// Returns false if there was a problem reading the header, or it was not
// a Mach-O header.
-//----------------------------------------------------------------------
bool
DynamicLoaderDarwinKernel::ReadMachHeader(addr_t addr, Process *process, llvm::MachO::mach_header &header,
@@ -427,12 +415,10 @@ DynamicLoaderDarwinKernel::ReadMachHeader(addr_t addr, Process *process, llvm::M
return true;
}
-//----------------------------------------------------------------------
// Given an address in memory, look to see if there is a kernel image at that
// address.
// Returns a UUID; if a kernel was not found at that address, UUID.IsValid()
// will be false.
-//----------------------------------------------------------------------
lldb_private::UUID
DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress(lldb::addr_t addr,
Process *process,
@@ -504,9 +490,7 @@ DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress(lldb::addr_t addr,
return UUID();
}
-//----------------------------------------------------------------------
// Constructor
-//----------------------------------------------------------------------
DynamicLoaderDarwinKernel::DynamicLoaderDarwinKernel(Process *process,
lldb::addr_t kernel_addr)
: DynamicLoader(process), m_kernel_load_address(kernel_addr), m_kernel(),
@@ -524,40 +508,32 @@ DynamicLoaderDarwinKernel::DynamicLoaderDarwinKernel(Process *process,
}
}
-//----------------------------------------------------------------------
// Destructor
-//----------------------------------------------------------------------
DynamicLoaderDarwinKernel::~DynamicLoaderDarwinKernel() { Clear(true); }
void DynamicLoaderDarwinKernel::UpdateIfNeeded() {
LoadKernelModuleIfNeeded();
SetNotificationBreakpointIfNeeded();
}
-//------------------------------------------------------------------
/// Called after attaching a process.
///
/// Allow DynamicLoader plug-ins to execute some code after
/// attaching to a process.
-//------------------------------------------------------------------
void DynamicLoaderDarwinKernel::DidAttach() {
PrivateInitialize(m_process);
UpdateIfNeeded();
}
-//------------------------------------------------------------------
/// Called after attaching a process.
///
/// Allow DynamicLoader plug-ins to execute some code after
/// attaching to a process.
-//------------------------------------------------------------------
void DynamicLoaderDarwinKernel::DidLaunch() {
PrivateInitialize(m_process);
UpdateIfNeeded();
}
-//----------------------------------------------------------------------
// Clear out the state of this class.
-//----------------------------------------------------------------------
void DynamicLoaderDarwinKernel::Clear(bool clear_process) {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
@@ -985,11 +961,9 @@ DynamicLoaderDarwinKernel::KextImageInfo::GetArchitecture() const {
return lldb_private::ArchSpec();
}
-//----------------------------------------------------------------------
// Load the kernel module and initialize the "m_kernel" member. Return true
// _only_ if the kernel is loaded the first time through (subsequent calls to
// this function should return false after the kernel has been already loaded).
-//----------------------------------------------------------------------
void DynamicLoaderDarwinKernel::LoadKernelModuleIfNeeded() {
if (!m_kext_summary_header_ptr_addr.IsValid()) {
m_kernel.Clear();
@@ -1064,12 +1038,10 @@ void DynamicLoaderDarwinKernel::LoadKernelModuleIfNeeded() {
}
}
-//----------------------------------------------------------------------
// Static callback function that gets called when our DYLD notification
// breakpoint gets hit. We update all of our image infos and then let our super
// class DynamicLoader class decide if we should stop or not (based on global
// preference).
-//----------------------------------------------------------------------
bool DynamicLoaderDarwinKernel::BreakpointHitCallback(
void *baton, StoppointCallbackContext *context, user_id_t break_id,
user_id_t break_loc_id) {
@@ -1439,9 +1411,7 @@ bool DynamicLoaderDarwinKernel::ReadAllKextSummaries() {
return false;
}
-//----------------------------------------------------------------------
// Dump an image info structure to the file handle provided.
-//----------------------------------------------------------------------
void DynamicLoaderDarwinKernel::KextImageInfo::PutToLog(Log *log) const {
if (m_load_address == LLDB_INVALID_ADDRESS) {
LLDB_LOG(log, "uuid={0} name=\"{1}\" (UNLOADED)", m_uuid.GetAsString(),
@@ -1452,10 +1422,8 @@ void DynamicLoaderDarwinKernel::KextImageInfo::PutToLog(Log *log) const {
}
}
-//----------------------------------------------------------------------
// Dump the _dyld_all_image_infos members and all current image infos that we
// have parsed to the file handle provided.
-//----------------------------------------------------------------------
void DynamicLoaderDarwinKernel::PutToLog(Log *log) const {
if (log == NULL)
return;
@@ -1507,9 +1475,7 @@ void DynamicLoaderDarwinKernel::SetNotificationBreakpointIfNeeded() {
}
}
-//----------------------------------------------------------------------
// Member function that gets called when the process state changes.
-//----------------------------------------------------------------------
void DynamicLoaderDarwinKernel::PrivateProcessStateChanged(Process *process,
StateType state) {
DEBUG_PRINTF("DynamicLoaderDarwinKernel::%s(%s)\n", __FUNCTION__,
@@ -1586,9 +1552,7 @@ const char *DynamicLoaderDarwinKernel::GetPluginDescriptionStatic() {
"in the MacOSX kernel.";
}
-//------------------------------------------------------------------
// PluginInterface protocol
-//------------------------------------------------------------------
lldb_private::ConstString DynamicLoaderDarwinKernel::GetPluginName() {
return GetPluginNameStatic();
}
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
index edcecd141d3..67734a3c3a5 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
@@ -28,9 +28,7 @@ public:
~DynamicLoaderDarwinKernel() override;
- //------------------------------------------------------------------
// Static Functions
- //------------------------------------------------------------------
static void Initialize();
static void Terminate();
@@ -46,12 +44,10 @@ public:
static lldb::addr_t SearchForDarwinKernel(lldb_private::Process *process);
- //------------------------------------------------------------------
/// Called after attaching a process.
///
/// Allow DynamicLoader plug-ins to execute some code after
/// attaching to a process.
- //------------------------------------------------------------------
void DidAttach() override;
void DidLaunch() override;
@@ -61,9 +57,7 @@ public:
lldb_private::Status CanLoadImage() override;
- //------------------------------------------------------------------
// PluginInterface protocol
- //------------------------------------------------------------------
lldb_private::ConstString GetPluginName() override;
uint32_t GetPluginVersion() override;
diff --git a/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h b/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h
index b9b0a93e495..c171513c549 100644
--- a/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h
+++ b/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h
@@ -31,9 +31,7 @@ public:
static lldb_private::DynamicLoader *
CreateInstance(lldb_private::Process *process, bool force);
- //------------------------------------------------------------------
// DynamicLoader protocol
- //------------------------------------------------------------------
void DidAttach() override;
@@ -48,9 +46,7 @@ public:
const lldb::ThreadSP thread,
lldb::addr_t tls_file_addr) override;
- //------------------------------------------------------------------
// PluginInterface protocol
- //------------------------------------------------------------------
lldb_private::ConstString GetPluginName() override;
uint32_t GetPluginVersion() override;
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
index 086169d1336..39440fdcb63 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
@@ -51,46 +51,36 @@
using namespace lldb;
using namespace lldb_private;
-//----------------------------------------------------------------------
// Constructor
-//----------------------------------------------------------------------
DynamicLoaderDarwin::DynamicLoaderDarwin(Process *process)
: DynamicLoader(process), m_dyld_module_wp(), m_libpthread_module_wp(),
m_pthread_getspecific_addr(), m_tid_to_tls_map(), m_dyld_image_infos(),
m_dyld_image_infos_stop_id(UINT32_MAX), m_dyld(), m_mutex() {}
-//----------------------------------------------------------------------
// Destructor
-//----------------------------------------------------------------------
DynamicLoaderDarwin::~DynamicLoaderDarwin() {}
-//------------------------------------------------------------------
/// Called after attaching a process.
///
/// Allow DynamicLoader plug-ins to execute some code after
/// attaching to a process.
-//------------------------------------------------------------------
void DynamicLoaderDarwin::DidAttach() {
PrivateInitialize(m_process);
DoInitialImageFetch();
SetNotificationBreakpoint();
}
-//------------------------------------------------------------------
/// Called after attaching a process.
///
/// Allow DynamicLoader plug-ins to execute some code after
/// attaching to a process.
-//------------------------------------------------------------------
void DynamicLoaderDarwin::DidLaunch() {
PrivateInitialize(m_process);
DoInitialImageFetch();
SetNotificationBreakpoint();
}
-//----------------------------------------------------------------------
// Clear out the state of this class.
-//----------------------------------------------------------------------
void DynamicLoaderDarwin::Clear(bool clear_process) {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
if (clear_process)
@@ -220,10 +210,8 @@ void DynamicLoaderDarwin::UnloadAllImages() {
}
}
-//----------------------------------------------------------------------
// Update the load addresses for all segments in MODULE using the updated INFO
// that is passed in.
-//----------------------------------------------------------------------
bool DynamicLoaderDarwin::UpdateImageLoadAddress(Module *module,
ImageInfo &info) {
bool changed = false;
@@ -300,9 +288,7 @@ bool DynamicLoaderDarwin::UpdateImageLoadAddress(Module *module,
return changed;
}
-//----------------------------------------------------------------------
// Unload the segments in MODULE using the INFO that is passed in.
-//----------------------------------------------------------------------
bool DynamicLoaderDarwin::UnloadModuleSections(Module *module,
ImageInfo &info) {
bool changed = false;
@@ -683,7 +669,6 @@ bool DynamicLoaderDarwin::AddModulesUsingImageInfos(
return true;
}
-//----------------------------------------------------------------------
// On Mac OS X libobjc (the Objective-C runtime) has several critical dispatch
// functions written in hand-written assembly, and also have hand-written
// unwind information in the eh_frame section. Normally we prefer analyzing
@@ -695,7 +680,6 @@ bool DynamicLoaderDarwin::AddModulesUsingImageInfos(
// extensible so they could have an Apple-specific flag) which indicates that
// the instructions are asynchronous -- accurate at every instruction, instead
// of our normal default assumption that they are not.
-//----------------------------------------------------------------------
bool DynamicLoaderDarwin::AlwaysRelyOnEHUnwindInfo(SymbolContext &sym_ctx) {
ModuleSP module_sp;
@@ -713,9 +697,7 @@ bool DynamicLoaderDarwin::AlwaysRelyOnEHUnwindInfo(SymbolContext &sym_ctx) {
return objc_runtime != NULL && objc_runtime->IsModuleObjCLibrary(module_sp);
}
-//----------------------------------------------------------------------
// Dump a Segment to the file handle provided.
-//----------------------------------------------------------------------
void DynamicLoaderDarwin::Segment::PutToLog(Log *log,
lldb::addr_t slide) const {
if (log) {
@@ -740,9 +722,7 @@ DynamicLoaderDarwin::ImageInfo::FindSegment(ConstString name) const {
return NULL;
}
-//----------------------------------------------------------------------
// Dump an image info structure to the file handle provided.
-//----------------------------------------------------------------------
void DynamicLoaderDarwin::ImageInfo::PutToLog(Log *log) const {
if (!log)
return;
@@ -765,9 +745,7 @@ void DynamicLoaderDarwin::PrivateInitialize(Process *process) {
m_process->GetTarget().ClearAllLoadedSections();
}
-//----------------------------------------------------------------------
// Member function that gets called when the process state changes.
-//----------------------------------------------------------------------
void DynamicLoaderDarwin::PrivateProcessStateChanged(Process *process,
StateType state) {
DEBUG_PRINTF("DynamicLoaderDarwin::%s(%s)\n", __FUNCTION__,
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h
index 298e75ca1a3..8f4c65da5d5 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h
@@ -30,12 +30,10 @@ public:
virtual ~DynamicLoaderDarwin() override;
- //------------------------------------------------------------------
/// Called after attaching a process.
///
/// Allow DynamicLoader plug-ins to execute some code after
/// attaching to a process.
- //------------------------------------------------------------------
void DidAttach() override;
void DidLaunch() override;
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
index 27ccb89f4be..53a9371696c 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
@@ -27,11 +27,9 @@
using namespace lldb;
using namespace lldb_private;
-//----------------------------------------------------------------------
// Create an instance of this class. This function is filled into the plugin
// info class that gets handed out by the plugin factory and allows the lldb to
// instantiate an instance of this class.
-//----------------------------------------------------------------------
DynamicLoader *DynamicLoaderMacOS::CreateInstance(Process *process,
bool force) {
bool create = force;
@@ -73,17 +71,13 @@ DynamicLoader *DynamicLoaderMacOS::CreateInstance(Process *process,
return NULL;
}
-//----------------------------------------------------------------------
// Constructor
-//----------------------------------------------------------------------
DynamicLoaderMacOS::DynamicLoaderMacOS(Process *process)
: DynamicLoaderDarwin(process), m_image_infos_stop_id(UINT32_MAX),
m_break_id(LLDB_INVALID_BREAK_ID), m_mutex(),
m_maybe_image_infos_address(LLDB_INVALID_ADDRESS) {}
-//----------------------------------------------------------------------
// Destructor
-//----------------------------------------------------------------------
DynamicLoaderMacOS::~DynamicLoaderMacOS() {
if (LLDB_BREAK_ID_IS_VALID(m_break_id))
m_process->GetTarget().RemoveBreakpointByID(m_break_id);
@@ -133,9 +127,7 @@ bool DynamicLoaderMacOS::ProcessDidExec() {
return did_exec;
}
-//----------------------------------------------------------------------
// Clear out the state of this class.
-//----------------------------------------------------------------------
void DynamicLoaderMacOS::DoClear() {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
@@ -145,9 +137,7 @@ void DynamicLoaderMacOS::DoClear() {
m_break_id = LLDB_INVALID_BREAK_ID;
}
-//----------------------------------------------------------------------
// Check if we have found DYLD yet
-//----------------------------------------------------------------------
bool DynamicLoaderMacOS::DidSetNotificationBreakpoint() {
return LLDB_BREAK_ID_IS_VALID(m_break_id);
}
@@ -159,12 +149,10 @@ void DynamicLoaderMacOS::ClearNotificationBreakpoint() {
}
}
-//----------------------------------------------------------------------
// Try and figure out where dyld is by first asking the Process if it knows
// (which currently calls down in the lldb::Process to get the DYLD info
// (available on SnowLeopard only). If that fails, then check in the default
// addresses.
-//----------------------------------------------------------------------
void DynamicLoaderMacOS::DoInitialImageFetch() {
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
@@ -200,12 +188,10 @@ void DynamicLoaderMacOS::DoInitialImageFetch() {
bool DynamicLoaderMacOS::NeedToDoInitialImageFetch() { return true; }
-//----------------------------------------------------------------------
// Static callback function that gets called when our DYLD notification
// breakpoint gets hit. We update all of our image infos and then let our super
// class DynamicLoader class decide if we should stop or not (based on global
// preference).
-//----------------------------------------------------------------------
bool DynamicLoaderMacOS::NotifyBreakpointHit(void *baton,
StoppointCallbackContext *context,
lldb::user_id_t break_id,
@@ -347,7 +333,6 @@ void DynamicLoaderMacOS::AddBinaries(
// Dump the _dyld_all_image_infos members and all current image infos that we
// have parsed to the file handle provided.
-//----------------------------------------------------------------------
void DynamicLoaderMacOS::PutToLog(Log *log) const {
if (log == NULL)
return;
@@ -537,9 +522,7 @@ const char *DynamicLoaderMacOS::GetPluginDescriptionStatic() {
"in MacOSX user processes.";
}
-//------------------------------------------------------------------
// PluginInterface protocol
-//------------------------------------------------------------------
lldb_private::ConstString DynamicLoaderMacOS::GetPluginName() {
return GetPluginNameStatic();
}
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h
index 77645e3c4e5..1e965a52ce6 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h
@@ -34,9 +34,7 @@ public:
virtual ~DynamicLoaderMacOS() override;
- //------------------------------------------------------------------
// Static Functions
- //------------------------------------------------------------------
static void Initialize();
static void Terminate();
@@ -48,12 +46,10 @@ public:
static lldb_private::DynamicLoader *
CreateInstance(lldb_private::Process *process, bool force);
- //------------------------------------------------------------------
/// Called after attaching a process.
///
/// Allow DynamicLoader plug-ins to execute some code after
/// attaching to a process.
- //------------------------------------------------------------------
bool ProcessDidExec() override;
lldb_private::Status CanLoadImage() override;
@@ -63,9 +59,7 @@ public:
lldb_private::LazyBool &using_shared_cache,
lldb_private::LazyBool &private_shared_cache) override;
- //------------------------------------------------------------------
// PluginInterface protocol
- //------------------------------------------------------------------
lldb_private::ConstString GetPluginName() override;
uint32_t GetPluginVersion() override;
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
index 58c46d850db..f4c50b888d4 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
@@ -47,11 +47,9 @@
using namespace lldb;
using namespace lldb_private;
-//----------------------------------------------------------------------
// Create an instance of this class. This function is filled into the plugin
// info class that gets handed out by the plugin factory and allows the lldb to
// instantiate an instance of this class.
-//----------------------------------------------------------------------
DynamicLoader *DynamicLoaderMacOSXDYLD::CreateInstance(Process *process,
bool force) {
bool create = force;
@@ -93,9 +91,7 @@ DynamicLoader *DynamicLoaderMacOSXDYLD::CreateInstance(Process *process,
return NULL;
}
-//----------------------------------------------------------------------
// Constructor
-//----------------------------------------------------------------------
DynamicLoaderMacOSXDYLD::DynamicLoaderMacOSXDYLD(Process *process)
: DynamicLoaderDarwin(process),
m_dyld_all_image_infos_addr(LLDB_INVALID_ADDRESS),
@@ -103,9 +99,7 @@ DynamicLoaderMacOSXDYLD::DynamicLoaderMacOSXDYLD(Process *process)
m_break_id(LLDB_INVALID_BREAK_ID), m_mutex(),
m_process_image_addr_is_all_images_infos(false) {}
-//----------------------------------------------------------------------
// Destructor
-//----------------------------------------------------------------------
DynamicLoaderMacOSXDYLD::~DynamicLoaderMacOSXDYLD() {
if (LLDB_BREAK_ID_IS_VALID(m_break_id))
m_process->GetTarget().RemoveBreakpointByID(m_break_id);
@@ -158,9 +152,7 @@ bool DynamicLoaderMacOSXDYLD::ProcessDidExec() {
return did_exec;
}
-//----------------------------------------------------------------------
// Clear out the state of this class.
-//----------------------------------------------------------------------
void DynamicLoaderMacOSXDYLD::DoClear() {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
@@ -172,9 +164,7 @@ void DynamicLoaderMacOSXDYLD::DoClear() {
m_break_id = LLDB_INVALID_BREAK_ID;
}
-//----------------------------------------------------------------------
// Check if we have found DYLD yet
-//----------------------------------------------------------------------
bool DynamicLoaderMacOSXDYLD::DidSetNotificationBreakpoint() {
return LLDB_BREAK_ID_IS_VALID(m_break_id);
}
@@ -185,12 +175,10 @@ void DynamicLoaderMacOSXDYLD::ClearNotificationBreakpoint() {
}
}
-//----------------------------------------------------------------------
// Try and figure out where dyld is by first asking the Process if it knows
// (which currently calls down in the lldb::Process to get the DYLD info
// (available on SnowLeopard only). If that fails, then check in the default
// addresses.
-//----------------------------------------------------------------------
void DynamicLoaderMacOSXDYLD::DoInitialImageFetch() {
if (m_dyld_all_image_infos_addr == LLDB_INVALID_ADDRESS) {
// Check the image info addr as it might point to the mach header for dyld,
@@ -254,9 +242,7 @@ void DynamicLoaderMacOSXDYLD::DoInitialImageFetch() {
return;
}
-//----------------------------------------------------------------------
// Assume that dyld is in memory at ADDR and try to parse it's load commands
-//----------------------------------------------------------------------
bool DynamicLoaderMacOSXDYLD::ReadDYLDInfoFromMemoryAndSetNotificationCallback(
lldb::addr_t addr) {
std::lock_guard<std::recursive_mutex> baseclass_guard(GetMutex());
@@ -312,12 +298,10 @@ bool DynamicLoaderMacOSXDYLD::NeedToDoInitialImageFetch() {
return m_dyld_all_image_infos_addr == LLDB_INVALID_ADDRESS;
}
-//----------------------------------------------------------------------
// Static callback function that gets called when our DYLD notification
// breakpoint gets hit. We update all of our image infos and then let our super
// class DynamicLoader class decide if we should stop or not (based on global
// preference).
-//----------------------------------------------------------------------
bool DynamicLoaderMacOSXDYLD::NotifyBreakpointHit(
void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id,
lldb::user_id_t break_loc_id) {
@@ -701,12 +685,10 @@ bool DynamicLoaderMacOSXDYLD::ReadImageInfos(
}
}
-//----------------------------------------------------------------------
// If we have found where the "_dyld_all_image_infos" lives in memory, read the
// current info from it, and then update all image load addresses (or lack
// thereof). Only do this if this is the first time we're reading the dyld
// infos. Return true if we actually read anything, and false otherwise.
-//----------------------------------------------------------------------
bool DynamicLoaderMacOSXDYLD::InitializeFromAllImageInfos() {
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
@@ -768,12 +750,10 @@ bool DynamicLoaderMacOSXDYLD::InitializeFromAllImageInfos() {
return false;
}
-//----------------------------------------------------------------------
// Read a mach_header at ADDR into HEADER, and also fill in the load command
// data into LOAD_COMMAND_DATA if it is non-NULL.
//
// Returns true if we succeed, false if we fail for any reason.
-//----------------------------------------------------------------------
bool DynamicLoaderMacOSXDYLD::ReadMachHeader(lldb::addr_t addr,
llvm::MachO::mach_header *header,
DataExtractor *load_command_data) {
@@ -840,9 +820,7 @@ bool DynamicLoaderMacOSXDYLD::ReadMachHeader(lldb::addr_t addr,
return false; // We failed the read the mach_header
}
-//----------------------------------------------------------------------
// Parse the load commands for an image
-//----------------------------------------------------------------------
uint32_t DynamicLoaderMacOSXDYLD::ParseLoadCommands(const DataExtractor &data,
ImageInfo &dylib_info,
FileSpec *lc_id_dylinker) {
@@ -929,10 +907,8 @@ uint32_t DynamicLoaderMacOSXDYLD::ParseLoadCommands(const DataExtractor &data,
return cmd_idx;
}
-//----------------------------------------------------------------------
// Read the mach_header and load commands for each image that the
// _dyld_all_image_infos structure points to and cache the results.
-//----------------------------------------------------------------------
void DynamicLoaderMacOSXDYLD::UpdateImageInfosHeaderAndLoadCommands(
ImageInfo::collection &image_infos, uint32_t infos_count,
@@ -990,10 +966,8 @@ void DynamicLoaderMacOSXDYLD::UpdateImageInfosHeaderAndLoadCommands(
}
}
-//----------------------------------------------------------------------
// Dump the _dyld_all_image_infos members and all current image infos that we
// have parsed to the file handle provided.
-//----------------------------------------------------------------------
void DynamicLoaderMacOSXDYLD::PutToLog(Log *log) const {
if (log == NULL)
return;
@@ -1159,9 +1133,7 @@ const char *DynamicLoaderMacOSXDYLD::GetPluginDescriptionStatic() {
"in MacOSX user processes.";
}
-//------------------------------------------------------------------
// PluginInterface protocol
-//------------------------------------------------------------------
lldb_private::ConstString DynamicLoaderMacOSXDYLD::GetPluginName() {
return GetPluginNameStatic();
}
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
index 10a3f31cd4b..656a2044c02 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
@@ -38,9 +38,7 @@ public:
virtual ~DynamicLoaderMacOSXDYLD() override;
- //------------------------------------------------------------------
// Static Functions
- //------------------------------------------------------------------
static void Initialize();
static void Terminate();
@@ -52,12 +50,10 @@ public:
static lldb_private::DynamicLoader *
CreateInstance(lldb_private::Process *process, bool force);
- //------------------------------------------------------------------
/// Called after attaching a process.
///
/// Allow DynamicLoader plug-ins to execute some code after
/// attaching to a process.
- //------------------------------------------------------------------
bool ProcessDidExec() override;
lldb_private::Status CanLoadImage() override;
@@ -67,9 +63,7 @@ public:
lldb_private::LazyBool &using_shared_cache,
lldb_private::LazyBool &private_shared_cache) override;
- //------------------------------------------------------------------
// PluginInterface protocol
- //------------------------------------------------------------------
lldb_private::ConstString GetPluginName() override;
uint32_t GetPluginVersion() override;
diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h
index 1a2d40042c1..d61f1563497 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h
@@ -36,9 +36,7 @@ public:
static lldb_private::DynamicLoader *
CreateInstance(lldb_private::Process *process, bool force);
- //------------------------------------------------------------------
// DynamicLoader protocol
- //------------------------------------------------------------------
void DidAttach() override;
@@ -53,9 +51,7 @@ public:
const lldb::ThreadSP thread,
lldb::addr_t tls_file_addr) override;
- //------------------------------------------------------------------
// PluginInterface protocol
- //------------------------------------------------------------------
lldb_private::ConstString GetPluginName() override;
uint32_t GetPluginVersion() override;
diff --git a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
index 2d3d7ea5c13..88ca2e2de01 100644
--- a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
@@ -17,11 +17,9 @@
using namespace lldb;
using namespace lldb_private;
-//----------------------------------------------------------------------
// Create an instance of this class. This function is filled into the plugin
// info class that gets handed out by the plugin factory and allows the lldb to
// instantiate an instance of this class.
-//----------------------------------------------------------------------
DynamicLoader *DynamicLoaderStatic::CreateInstance(Process *process,
bool force) {
bool create = force;
@@ -48,31 +46,23 @@ DynamicLoader *DynamicLoaderStatic::CreateInstance(Process *process,
return NULL;
}
-//----------------------------------------------------------------------
// Constructor
-//----------------------------------------------------------------------
DynamicLoaderStatic::DynamicLoaderStatic(Process *process)
: DynamicLoader(process) {}
-//----------------------------------------------------------------------
// Destructor
-//----------------------------------------------------------------------
DynamicLoaderStatic::~DynamicLoaderStatic() {}
-//------------------------------------------------------------------
/// Called after attaching a process.
///
/// Allow DynamicLoader plug-ins to execute some code after
/// attaching to a process.
-//------------------------------------------------------------------
void DynamicLoaderStatic::DidAttach() { LoadAllImagesAtFileAddresses(); }
-//------------------------------------------------------------------
/// Called after attaching a process.
///
/// Allow DynamicLoader plug-ins to execute some code after
/// attaching to a process.
-//------------------------------------------------------------------
void DynamicLoaderStatic::DidLaunch() { LoadAllImagesAtFileAddresses(); }
void DynamicLoaderStatic::LoadAllImagesAtFileAddresses() {
@@ -156,9 +146,7 @@ const char *DynamicLoaderStatic::GetPluginDescriptionStatic() {
"addresses contained in each image.";
}
-//------------------------------------------------------------------
// PluginInterface protocol
-//------------------------------------------------------------------
lldb_private::ConstString DynamicLoaderStatic::GetPluginName() {
return GetPluginNameStatic();
}
diff --git a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h
index 9075df6832c..fa9aded7286 100644
--- a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h
+++ b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h
@@ -20,9 +20,7 @@ public:
~DynamicLoaderStatic() override;
- //------------------------------------------------------------------
// Static Functions
- //------------------------------------------------------------------
static void Initialize();
static void Terminate();
@@ -34,12 +32,10 @@ public:
static lldb_private::DynamicLoader *
CreateInstance(lldb_private::Process *process, bool force);
- //------------------------------------------------------------------
/// Called after attaching a process.
///
/// Allow DynamicLoader plug-ins to execute some code after
/// attaching to a process.
- //------------------------------------------------------------------
void DidAttach() override;
void DidLaunch() override;
@@ -49,9 +45,7 @@ public:
lldb_private::Status CanLoadImage() override;
- //------------------------------------------------------------------
// PluginInterface protocol
- //------------------------------------------------------------------
lldb_private::ConstString GetPluginName() override;
uint32_t GetPluginVersion() override;
OpenPOWER on IntegriCloud