summaryrefslogtreecommitdiff
path: root/source/Core
diff options
context:
space:
mode:
Diffstat (limited to 'source/Core')
-rw-r--r--source/Core/Address.cpp12
-rw-r--r--source/Core/ConnectionFileDescriptor.cpp3
-rw-r--r--source/Core/Debugger.cpp53
-rw-r--r--source/Core/Mangled.cpp7
-rw-r--r--source/Core/Module.cpp2
-rw-r--r--source/Core/StreamFile.cpp2
-rw-r--r--source/Core/ValueObjectSyntheticFilter.cpp2
7 files changed, 39 insertions, 42 deletions
diff --git a/source/Core/Address.cpp b/source/Core/Address.cpp
index 1e79f332ffc8..de2165cff84e 100644
--- a/source/Core/Address.cpp
+++ b/source/Core/Address.cpp
@@ -280,7 +280,7 @@ Address::GetFileAddress () const
// address by adding the file base address to our offset
return sect_file_addr + m_offset;
}
- else if (SectionWasDeleted())
+ else if (SectionWasDeletedPrivate())
{
// Used to have a valid section but it got deleted so the
// offset doesn't mean anything without the section
@@ -308,7 +308,7 @@ Address::GetLoadAddress (Target *target) const
}
}
}
- else if (SectionWasDeleted())
+ else if (SectionWasDeletedPrivate())
{
// Used to have a valid section but it got deleted so the
// offset doesn't mean anything without the section
@@ -783,6 +783,14 @@ Address::Dump (Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, Dum
bool
Address::SectionWasDeleted() const
{
+ if (GetSection())
+ return false;
+ return SectionWasDeletedPrivate();
+}
+
+bool
+Address::SectionWasDeletedPrivate() const
+{
lldb::SectionWP empty_section_wp;
// If either call to "std::weak_ptr::owner_before(...) value returns true, this
diff --git a/source/Core/ConnectionFileDescriptor.cpp b/source/Core/ConnectionFileDescriptor.cpp
index 8e80543b857b..5764a212ab43 100644
--- a/source/Core/ConnectionFileDescriptor.cpp
+++ b/source/Core/ConnectionFileDescriptor.cpp
@@ -53,6 +53,8 @@
#include "lldb/Core/Log.h"
#include "lldb/Core/RegularExpression.h"
#include "lldb/Core/Timer.h"
+#include "lldb/Host/Host.h"
+
using namespace lldb;
using namespace lldb_private;
@@ -1209,6 +1211,7 @@ ConnectionFileDescriptor::NamedSocketAccept (const char *socket_name, Error *err
saddr_un.sun_len = SUN_LEN (&saddr_un);
#endif
+ Host::Unlink (socket_name);
if (::bind (listen_socket, (struct sockaddr *)&saddr_un, SUN_LEN (&saddr_un)) == 0)
{
if (::listen (listen_socket, 5) == 0)
diff --git a/source/Core/Debugger.cpp b/source/Core/Debugger.cpp
index 3941d82d47b0..b57c6051a961 100644
--- a/source/Core/Debugger.cpp
+++ b/source/Core/Debugger.cpp
@@ -9,8 +9,6 @@
#include "lldb/lldb-python.h"
-#include "lldb/API/SBDebugger.h"
-
#include "lldb/Core/Debugger.h"
#include <map>
@@ -46,6 +44,7 @@
#include "lldb/Target/TargetList.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/RegisterContext.h"
+#include "lldb/Target/SectionLoadList.h"
#include "lldb/Target/StopInfo.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
@@ -155,19 +154,7 @@ enum
ePropertyAutoOneLineSummaries
};
-//
-//const char *
-//Debugger::GetFrameFormat() const
-//{
-// return m_properties_sp->GetFrameFormat();
-//}
-//const char *
-//Debugger::GetThreadFormat() const
-//{
-// return m_properties_sp->GetThreadFormat();
-//}
-//
-
+Debugger::LoadPluginCallbackType Debugger::g_load_plugin_callback = NULL;
Error
Debugger::SetPropertyValue (const ExecutionContext *exe_ctx,
@@ -373,8 +360,9 @@ Debugger::TestDebuggerRefCount ()
}
void
-Debugger::Initialize ()
+Debugger::Initialize (LoadPluginCallbackType load_plugin_callback)
{
+ g_load_plugin_callback = load_plugin_callback;
if (g_shared_debugger_refcount++ == 0)
lldb_private::Initialize();
}
@@ -412,31 +400,22 @@ Debugger::SettingsTerminate ()
bool
Debugger::LoadPlugin (const FileSpec& spec, Error& error)
{
- lldb::DynamicLibrarySP dynlib_sp(new lldb_private::DynamicLibrary(spec));
- if (!dynlib_sp || dynlib_sp->IsValid() == false)
+ if (g_load_plugin_callback)
{
- if (spec.Exists())
- error.SetErrorString("this file does not represent a loadable dylib");
- else
- error.SetErrorString("no such file");
- return false;
- }
- lldb::DebuggerSP debugger_sp(shared_from_this());
- lldb::SBDebugger debugger_sb(debugger_sp);
- // This calls the bool lldb::PluginInitialize(lldb::SBDebugger debugger) function.
- // TODO: mangle this differently for your system - on OSX, the first underscore needs to be removed and the second one stays
- LLDBCommandPluginInit init_func = dynlib_sp->GetSymbol<LLDBCommandPluginInit>("_ZN4lldb16PluginInitializeENS_10SBDebuggerE");
- if (!init_func)
- {
- error.SetErrorString("cannot find the initialization function lldb::PluginInitialize(lldb::SBDebugger)");
- return false;
+ lldb::DynamicLibrarySP dynlib_sp = g_load_plugin_callback (shared_from_this(), spec, error);
+ if (dynlib_sp)
+ {
+ m_loaded_plugins.push_back(dynlib_sp);
+ return true;
+ }
}
- if (init_func(debugger_sb))
+ else
{
- m_loaded_plugins.push_back(dynlib_sp);
- return true;
+ // The g_load_plugin_callback is registered in SBDebugger::Initialize()
+ // and if the public API layer isn't available (code is linking against
+ // all of the internal LLDB static libraries), then we can't load plugins
+ error.SetErrorString("Public API layer is not available");
}
- error.SetErrorString("dylib refused to be loaded");
return false;
}
diff --git a/source/Core/Mangled.cpp b/source/Core/Mangled.cpp
index 189c3bc5531d..a41986de5143 100644
--- a/source/Core/Mangled.cpp
+++ b/source/Core/Mangled.cpp
@@ -10,7 +10,9 @@
// FreeBSD9-STABLE requires this to know about size_t in cxxabi.h
#include <cstddef>
-#if defined(_MSC_VER) || defined (__FreeBSD__)
+#if defined(_MSC_VER)
+// Cannot enable the builtin demangler on msvc as it does not support the cpp11 within the implementation.
+#elif defined (__FreeBSD__)
#define LLDB_USE_BUILTIN_DEMANGLER
#else
#include <cxxabi.h>
@@ -4890,6 +4892,9 @@ Mangled::GetDemangledName () const
// add it to our map.
#ifdef LLDB_USE_BUILTIN_DEMANGLER
char *demangled_name = __cxa_demangle (mangled_cstr, NULL, NULL, NULL);
+#elif defined(_MSC_VER)
+ // Cannot demangle on msvc.
+ char *demangled_name = nullptr;
#else
char *demangled_name = abi::__cxa_demangle (mangled_cstr, NULL, NULL, NULL);
#endif
diff --git a/source/Core/Module.cpp b/source/Core/Module.cpp
index 3f3be9360efa..f90a097416df 100644
--- a/source/Core/Module.cpp
+++ b/source/Core/Module.cpp
@@ -135,6 +135,7 @@ Module::Module (const ModuleSpec &module_spec) :
m_uuid (),
m_file (module_spec.GetFileSpec()),
m_platform_file(module_spec.GetPlatformFileSpec()),
+ m_remote_install_file(),
m_symfile_spec (module_spec.GetSymbolFileSpec()),
m_object_name (module_spec.GetObjectName()),
m_object_offset (module_spec.GetObjectOffset()),
@@ -179,6 +180,7 @@ Module::Module(const FileSpec& file_spec,
m_uuid (),
m_file (file_spec),
m_platform_file(),
+ m_remote_install_file (),
m_symfile_spec (),
m_object_name (),
m_object_offset (object_offset),
diff --git a/source/Core/StreamFile.cpp b/source/Core/StreamFile.cpp
index 9a4eb796dbea..2285ca954457 100644
--- a/source/Core/StreamFile.cpp
+++ b/source/Core/StreamFile.cpp
@@ -49,7 +49,7 @@ StreamFile::StreamFile (FILE *fh, bool transfer_ownership) :
StreamFile::StreamFile (const char *path) :
Stream (),
- m_file (path, File::eOpenOptionWrite | File::eOpenOptionCanCreate, File::ePermissionsDefault)
+ m_file (path, File::eOpenOptionWrite | File::eOpenOptionCanCreate, lldb::eFilePermissionsFileDefault)
{
}
diff --git a/source/Core/ValueObjectSyntheticFilter.cpp b/source/Core/ValueObjectSyntheticFilter.cpp
index 5767466f509d..a65b8f63e317 100644
--- a/source/Core/ValueObjectSyntheticFilter.cpp
+++ b/source/Core/ValueObjectSyntheticFilter.cpp
@@ -16,7 +16,7 @@
// Other libraries and framework includes
// Project includes
#include "lldb/Core/ValueObject.h"
-#include "lldb/DataFormatters/FormatClasses.h"
+#include "lldb/DataFormatters/TypeSynthetic.h"
using namespace lldb_private;