summaryrefslogtreecommitdiff
path: root/source/Core/DynamicLoader.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-04-16 16:04:10 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-04-16 16:04:10 +0000
commit74a628f776edb588bff8f8f5cc16eac947c9d631 (patch)
treedc32e010ac4902621e5a279bfeb48628f7f0e166 /source/Core/DynamicLoader.cpp
parentafed7be32164a598f8172282c249af7266c48b46 (diff)
Notes
Diffstat (limited to 'source/Core/DynamicLoader.cpp')
-rw-r--r--source/Core/DynamicLoader.cpp28
1 files changed, 21 insertions, 7 deletions
diff --git a/source/Core/DynamicLoader.cpp b/source/Core/DynamicLoader.cpp
index 69c5ea30dad2f..03fad244acfc4 100644
--- a/source/Core/DynamicLoader.cpp
+++ b/source/Core/DynamicLoader.cpp
@@ -7,19 +7,25 @@
//
//===----------------------------------------------------------------------===//
-// C Includes
-// C++ Includes
-// Other libraries and framework includes
-// Project includes
#include "lldb/Target/DynamicLoader.h"
+
#include "lldb/Core/Module.h"
+#include "lldb/Core/ModuleList.h" // for ModuleList
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/Section.h"
+#include "lldb/Symbol/ObjectFile.h" // for ObjectFile
#include "lldb/Target/MemoryRegionInfo.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
-#include "lldb/lldb-private.h"
+#include "lldb/Utility/ConstString.h" // for ConstString
+#include "lldb/lldb-private-interfaces.h" // for DynamicLoaderCreateInstance
+
+#include "llvm/ADT/StringRef.h" // for StringRef
+
+#include <memory> // for shared_ptr, unique_ptr
+
+#include <assert.h> // for assert
using namespace lldb;
using namespace lldb_private;
@@ -78,7 +84,7 @@ ModuleSP DynamicLoader::GetTargetExecutable() {
if (executable->GetFileSpec().Exists()) {
ModuleSpec module_spec(executable->GetFileSpec(),
executable->GetArchitecture());
- ModuleSP module_sp(new Module(module_spec));
+ auto module_sp = std::make_shared<Module>(module_spec);
// Check if the executable has changed and set it to the target executable
// if they differ.
@@ -189,7 +195,8 @@ ModuleSP DynamicLoader::LoadModuleAtAddress(const FileSpec &file,
MemoryRegionInfo memory_info;
Error error = m_process->GetMemoryRegionInfo(base_addr, memory_info);
if (error.Success() && memory_info.GetMapped() &&
- memory_info.GetRange().GetRangeBase() == base_addr) {
+ memory_info.GetRange().GetRangeBase() == base_addr &&
+ !(memory_info.GetName().IsEmpty())) {
ModuleSpec new_module_spec(
FileSpec(memory_info.GetName().AsCString(), false),
target.GetArchitecture());
@@ -233,3 +240,10 @@ addr_t DynamicLoader::ReadPointer(addr_t addr) {
else
return value;
}
+
+void DynamicLoader::LoadOperatingSystemPlugin(bool flush)
+{
+ if (m_process)
+ m_process->LoadOperatingSystemPlugin(flush);
+}
+