mirror of
https://github.com/intel/llvm.git
synced 2026-01-21 04:14:03 +08:00
Fixed internal code to not link against and code from "lldb/API/*".
lldb_private::Debugger was #including some "lldb/API" header files which causes tools (lldb-platform and lldb-gdbserver) that link against the internals only (no API layer) to fail to link depending on which calls were being used. Also fixed the current working directory so that it gets set correctly for remote test suite runs. Now the remote working directory is set to: "ARCH/TESTNUM/..." where ARCH is the current architecture name and "TESTNUM" is the current test number. Fixed the "lldb-platform" and "lldb-gdbserver" to not warn about mismatched visibility settings by having each have their own exports file which contains nothing. This forces all symbols to not be exported, and also quiets the linker warnings. llvm-svn: 196141
This commit is contained in:
@@ -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::DynamicLibrarySP dynlib_sp = g_load_plugin_callback (shared_from_this(), spec, error);
|
||||
if (dynlib_sp)
|
||||
{
|
||||
m_loaded_plugins.push_back(dynlib_sp);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
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)
|
||||
else
|
||||
{
|
||||
error.SetErrorString("cannot find the initialization function lldb::PluginInitialize(lldb::SBDebugger)");
|
||||
return false;
|
||||
// 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");
|
||||
}
|
||||
if (init_func(debugger_sb))
|
||||
{
|
||||
m_loaded_plugins.push_back(dynlib_sp);
|
||||
return true;
|
||||
}
|
||||
error.SetErrorString("dylib refused to be loaded");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user