summaryrefslogtreecommitdiff
path: root/source/API
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-01-06 20:12:03 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-01-06 20:12:03 +0000
commit9e6d35490a6542f9c97607f93c2ef8ca8e03cbcc (patch)
treedd2a1ddf0476664c2b823409c36cbccd52662ca7 /source/API
parent3bd2e91faeb9eeec1aae82c64a3253afff551cfd (diff)
Notes
Diffstat (limited to 'source/API')
-rw-r--r--source/API/CMakeLists.txt119
-rw-r--r--source/API/Makefile18
-rw-r--r--source/API/SBProcess.cpp9
-rw-r--r--source/API/SystemInitializerFull.cpp6
4 files changed, 148 insertions, 4 deletions
diff --git a/source/API/CMakeLists.txt b/source/API/CMakeLists.txt
new file mode 100644
index 0000000000000..06a26e17c9298
--- /dev/null
+++ b/source/API/CMakeLists.txt
@@ -0,0 +1,119 @@
+if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
+ add_definitions( -DEXPORT_LIBLLDB )
+endif()
+
+# Include this so that add_lldb_library() has the list of dependencies
+# for liblldb to link against
+include(${LLDB_PROJECT_ROOT}/cmake/LLDBDependencies.cmake)
+
+add_lldb_library(liblldb SHARED
+ SBAddress.cpp
+ SBAttachInfo.cpp
+ SBBlock.cpp
+ SBBreakpoint.cpp
+ SBBreakpointLocation.cpp
+ SBBroadcaster.cpp
+ SBCommandInterpreter.cpp
+ SBCommandReturnObject.cpp
+ SBCommunication.cpp
+ SBCompileUnit.cpp
+ SBData.cpp
+ SBDebugger.cpp
+ SBDeclaration.cpp
+ SBError.cpp
+ SBEvent.cpp
+ SBExecutionContext.cpp
+ SBExpressionOptions.cpp
+ SBFileSpec.cpp
+ SBFileSpecList.cpp
+ SBFrame.cpp
+ SBFunction.cpp
+ SBHostOS.cpp
+ SBInstruction.cpp
+ SBInstructionList.cpp
+ SBLanguageRuntime.cpp
+ SBLaunchInfo.cpp
+ SBLineEntry.cpp
+ SBListener.cpp
+ SBModule.cpp
+ SBModuleSpec.cpp
+ SBPlatform.cpp
+ SBProcess.cpp
+ SBQueue.cpp
+ SBQueueItem.cpp
+ SBSection.cpp
+ SBSourceManager.cpp
+ SBStream.cpp
+ SBStringList.cpp
+ SBSymbol.cpp
+ SBSymbolContext.cpp
+ SBSymbolContextList.cpp
+ SBTarget.cpp
+ SBThread.cpp
+ SBThreadCollection.cpp
+ SBThreadPlan.cpp
+ SBType.cpp
+ SBTypeCategory.cpp
+ SBTypeEnumMember.cpp
+ SBTypeFilter.cpp
+ SBTypeFormat.cpp
+ SBTypeNameSpecifier.cpp
+ SBTypeSummary.cpp
+ SBTypeSynthetic.cpp
+ SBValue.cpp
+ SBValueList.cpp
+ SBVariablesOptions.cpp
+ SBWatchpoint.cpp
+ SBUnixSignals.cpp
+ SystemInitializerFull.cpp
+ ${LLDB_WRAP_PYTHON}
+ )
+
+# This should not be part of LLDBDependencies.cmake, because we don't
+# want every single library taking a dependency on the script interpreters.
+target_link_libraries(liblldb PRIVATE
+ lldbPluginScriptInterpreterNone
+ lldbPluginScriptInterpreterPython
+ )
+
+set_target_properties(liblldb
+ PROPERTIES
+ VERSION ${LLDB_VERSION}
+ )
+
+if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
+ if (NOT LLDB_EXPORT_ALL_SYMBOLS)
+ # If we're not exporting all symbols, we'll want to explicitly set
+ # the exported symbols here. This prevents 'log enable --stack ...'
+ # from working on some systems but limits the liblldb size.
+ MESSAGE("-- Symbols (liblldb): only exporting liblldb.exports symbols")
+ add_llvm_symbol_exports(liblldb ${CMAKE_CURRENT_SOURCE_DIR}/liblldb.exports)
+ else()
+ # Don't use an explicit export. Instead, tell the linker to
+ # export all symbols.
+ MESSAGE("-- Symbols (liblldb): exporting all symbols")
+ # Darwin linker doesn't need this extra step.
+ if (NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ lldb_append_link_flags(liblldb "-Wl,--export-dynamic")
+ endif()
+ endif()
+endif()
+
+if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
+ # Only MSVC has the ABI compatibility problem and avoids using FindPythonLibs,
+ # so only it needs to explicitly link against ${PYTHON_LIBRARY}
+ if (MSVC AND NOT LLDB_DISABLE_PYTHON)
+ target_link_libraries(liblldb PRIVATE ${PYTHON_LIBRARY})
+ endif()
+else()
+ set_target_properties(liblldb
+ PROPERTIES
+ OUTPUT_NAME lldb
+ )
+endif()
+
+if (LLDB_WRAP_PYTHON)
+ add_dependencies(liblldb swig_wrapper)
+endif()
+target_link_libraries(liblldb ${cmake_2_8_12_PRIVATE} ${LLDB_SYSTEM_LIBS})
+
diff --git a/source/API/Makefile b/source/API/Makefile
new file mode 100644
index 0000000000000..e35b2c37735e5
--- /dev/null
+++ b/source/API/Makefile
@@ -0,0 +1,18 @@
+##===- source/API/Makefile ---------------------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LLDB_LEVEL := ../..
+LIBRARYNAME := lldbAPI
+BUILD_ARCHIVE = 1
+
+include $(LLDB_LEVEL)/Makefile
+
+ifeq ($(HOST_OS),MingW)
+CXXFLAGS += -DEXPORT_LIBLLDB
+endif
diff --git a/source/API/SBProcess.cpp b/source/API/SBProcess.cpp
index dceadeca69e50..42554726c0186 100644
--- a/source/API/SBProcess.cpp
+++ b/source/API/SBProcess.cpp
@@ -995,7 +995,14 @@ SBProcess::GetStateFromEvent (const SBEvent &event)
bool
SBProcess::GetRestartedFromEvent (const SBEvent &event)
{
- return Process::ProcessEventData::GetRestartedFromEvent (event.get());
+ Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+
+ bool ret_val = Process::ProcessEventData::GetRestartedFromEvent (event.get());
+
+ if (log)
+ log->Printf ("SBProcess::%s (event.sp=%p) => %d", __FUNCTION__, event.get(), ret_val);
+
+ return ret_val;
}
size_t
diff --git a/source/API/SystemInitializerFull.cpp b/source/API/SystemInitializerFull.cpp
index f223357824e82..cbc01a6cff9ac 100644
--- a/source/API/SystemInitializerFull.cpp
+++ b/source/API/SystemInitializerFull.cpp
@@ -102,7 +102,7 @@ PyInit__lldb(void);
#define LLDBSwigPyInit PyInit__lldb
#else
-extern "C" void
+extern "C" void
init_lldb(void);
#define LLDBSwigPyInit init_lldb
@@ -308,7 +308,7 @@ SystemInitializerFull::Initialize()
SystemRuntimeMacOSX::Initialize();
RenderScriptRuntime::Initialize();
GoLanguageRuntime::Initialize();
-
+
CPlusPlusLanguage::Initialize();
GoLanguage::Initialize();
ObjCLanguage::Initialize();
@@ -430,7 +430,7 @@ SystemInitializerFull::Terminate()
GoLanguage::Terminate();
ObjCLanguage::Terminate();
ObjCPlusPlusLanguage::Terminate();
-
+
#if defined(__APPLE__)
ProcessMachCore::Terminate();
ProcessKDP::Terminate();