mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
Merge remote-tracking branch 'origin/Ghidra_10.1'
Conflicts: Ghidra/Debug/Debugger/src/main/java/ghidra/app/services/DebuggerStaticMappingService.java Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/assembler/sleigh/SleighAssembler.java
This commit is contained in:
commit
ad1af902bd
251 changed files with 5550 additions and 7982 deletions
|
@ -26,6 +26,7 @@ dependencies {
|
|||
api project(':Framework-AsyncComm')
|
||||
api project(':Framework-Debugging')
|
||||
api project(':Debugger-gadp')
|
||||
api project(':Debugger-swig-lldb')
|
||||
|
||||
testImplementation project(path: ':Framework-AsyncComm', configuration: 'testArtifacts')
|
||||
testImplementation project(path: ':Framework-Debugging', configuration: 'testArtifacts')
|
||||
|
@ -72,14 +73,6 @@ task nodepJar(type: Jar) {
|
|||
from(zipTree(jar.archivePath))
|
||||
}
|
||||
|
||||
// Include llvm patch and SWIG files
|
||||
rootProject.assembleDistribution {
|
||||
from (this.project.projectDir.toString()) {
|
||||
include "src/llvm/**"
|
||||
into {getZipPath(this.project) + "/data/"}
|
||||
}
|
||||
}
|
||||
|
||||
task executableJar {
|
||||
ext.execsh = file("src/main/sh/execjar.sh")
|
||||
ext.jarfile = file(nodepJar.archivePath)
|
||||
|
|
|
@ -5,18 +5,7 @@
|
|||
.project||NONE||reviewed||END|
|
||||
Module.manifest||GHIDRA||||END|
|
||||
build.gradle||GHIDRA||||END|
|
||||
data/InstructionsForPatchingLLDB.txt||GHIDRA||||END|
|
||||
src/llvm/lldb/CMakeLists.txt||Apache License 2.0 with LLVM Exceptions||||END|
|
||||
src/llvm/lldb/bindings/CMakeLists.txt||Apache License 2.0 with LLVM Exceptions||||END|
|
||||
src/llvm/lldb/bindings/java/CMakeLists.txt||Apache License 2.0 with LLVM Exceptions||||END|
|
||||
src/llvm/lldb/bindings/java/java-typemaps.swig||Apache License 2.0 with LLVM Exceptions||||END|
|
||||
src/llvm/lldb/bindings/java/java.swig||Apache License 2.0 with LLVM Exceptions||||END|
|
||||
src/llvm/lldb/cmake/modules/FindJavaAndSwig.cmake||Apache License 2.0 with LLVM Exceptions||||END|
|
||||
src/llvm/lldb/cmake/modules/LLDBConfig.cmake||Apache License 2.0 with LLVM Exceptions||||END|
|
||||
src/llvm/lldb/include/lldb/Host/Config.h.cmake||Apache License 2.0 with LLVM Exceptions||||END|
|
||||
src/llvm/lldb/source/API/CMakeLists.txt||Apache License 2.0 with LLVM Exceptions||||END|
|
||||
src/llvm/lldb/source/API/liblldb-private.exports||Apache License 2.0 with LLVM Exceptions||||END|
|
||||
src/llvm/lldb/source/API/liblldb.exports||Apache License 2.0 with LLVM Exceptions||||END|
|
||||
src/llvm/lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt||Apache License 2.0 with LLVM Exceptions||||END|
|
||||
src/llvm/lldb/source/Plugins/ScriptInterpreter/Java/CMakeLists.txt||Apache License 2.0 with LLVM Exceptions||||END|
|
||||
src/llvm/lldb/tools/debugserver/source/CMakeLists.txt||Apache License 2.0 with LLVM Exceptions||||END|
|
||||
data/InstructionsForBuildingLLDBInterface.txt||GHIDRA||||END|
|
||||
src/llvm-project/lldb/bindings/java/java-typemaps.swig||Apache License 2.0 with LLVM Exceptions||||END|
|
||||
src/llvm-project/lldb/bindings/java/java.swig||Apache License 2.0 with LLVM Exceptions||||END|
|
||||
src/llvm-project/lldb/build_script||GHIDRA||||END|
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
This directory include a fragment of the LLVM lldb source tree with modifications to generate Java JNI wrappers for the Scripting Bridge API via SWIG. Some of these are source modifications, some compilation instructions, some add exports. To use lldb with Ghidra, you will need to:
|
||||
|
||||
(A) Download and build lldb following the standard guidelines from https://lldb.llvm.org
|
||||
(B) Modify the lldb code along the lines of the included code and rebuild
|
||||
(C) Copy the resulting liblldb.dylib (for macOS) or liblldb.so (for Linux) into the system directory
|
||||
|
||||
The SWIG-generated Java files that form the JNI interface have already been included as class files in the Ghidra jars. That said, if the exported API has changed and caused a mismatch, they may need to be replaced and recompiled. The Ghidra versions live in Ghidra/Debug/Debugger-agent-lldb/src/main/java/SWIG.
|
||||
|
||||
The CMake changes live in:
|
||||
- lldb/CMakeLists.txt
|
||||
- lldb/bindings/CMakeLists.txt
|
||||
- lldb/bindings/java/CMakeLists.txt (new)
|
||||
- lldb/source/API/CMakeLists.txt
|
||||
Most of the changes involve adding LLDB_ENABLE_JAVA, in line with LLDB_ENABLE_LUA and LLDB_ENABLE_PYTHON. The same templates are used for all three.
|
||||
|
||||
A minor change to lldb/source/API/SBDebugger.cpp adds LLDB_ENABLE_JAVA to the config options.
|
||||
|
||||
Extra export patterns have been added to:
|
||||
- lldb/source/API/liblldb.exports
|
||||
- lldb/source/API/liblldb.private-exports
|
||||
to accommodate the Java patterns.
|
||||
|
||||
Two new .swig files have been added, which may be copied over as is:
|
||||
- lldb/bindings/java/java.swig
|
||||
- lldb/bindings/java/java-typemaps.swig
|
||||
The latter adds access for ByteArrays.
|
||||
|
||||
Finally, lldb/cmake/modules/FindJavaAndSwig.cmake has been added as the generator.
|
||||
|
||||
|
|
@ -1,6 +1,3 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
%include <typemaps.i>
|
||||
%include <carrays.i>
|
||||
%include <various.i>
|
|
@ -1,6 +1,3 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
/*
|
||||
lldb.swig
|
||||
|
||||
|
@ -22,4 +19,4 @@ using namespace lldb;
|
|||
%}
|
||||
|
||||
%include "interfaces.swig"
|
||||
//%include "lua-wrapper.swig"
|
||||
|
|
@ -1,109 +0,0 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
|
||||
# Add path for custom modules.
|
||||
set(CMAKE_MODULE_PATH
|
||||
${CMAKE_MODULE_PATH}
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
|
||||
)
|
||||
|
||||
# If we are not building as part of LLVM, build LLDB as a standalone project,
|
||||
# using LLVM as an external library.
|
||||
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||
project(lldb)
|
||||
include(LLDBStandalone)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard to conform to")
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED YES)
|
||||
set(CMAKE_CXX_EXTENSIONS NO)
|
||||
endif()
|
||||
|
||||
include(LLDBConfig)
|
||||
include(AddLLDB)
|
||||
|
||||
# Define the LLDB_CONFIGURATION_xxx matching the build type.
|
||||
if(uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" )
|
||||
add_definitions(-DLLDB_CONFIGURATION_DEBUG)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
add_definitions(-D_ENABLE_EXTENDED_ALIGNED_STORAGE)
|
||||
endif()
|
||||
|
||||
if (LLDB_ENABLE_PYTHON)
|
||||
if (NOT CMAKE_CROSSCOMPILING)
|
||||
execute_process(
|
||||
COMMAND ${Python3_EXECUTABLE}
|
||||
-c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(True, False, ''))"
|
||||
OUTPUT_VARIABLE LLDB_PYTHON_DEFAULT_RELATIVE_PATH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
file(TO_CMAKE_PATH ${LLDB_PYTHON_DEFAULT_RELATIVE_PATH} LLDB_PYTHON_DEFAULT_RELATIVE_PATH)
|
||||
else ()
|
||||
if ("${LLDB_PYTHON_RELATIVE_PATH}" STREQUAL "")
|
||||
message(FATAL_ERROR
|
||||
"Crosscompiling LLDB with Python requires manually setting
|
||||
LLDB_PYTHON_RELATIVE_PATH.")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
set(LLDB_PYTHON_RELATIVE_PATH ${LLDB_PYTHON_DEFAULT_RELATIVE_PATH}
|
||||
CACHE STRING "Path where Python modules are installed, relative to install prefix")
|
||||
endif ()
|
||||
|
||||
if (LLDB_ENABLE_PYTHON OR LLDB_ENABLE_LUA OR LLDB_ENABLE_JAVA)
|
||||
add_subdirectory(bindings)
|
||||
endif ()
|
||||
|
||||
# We need the headers generated by instrinsics_gen before we can compile
|
||||
# any source file in LLDB as the imported Clang modules might include
|
||||
# some of these generated headers. This approach is copied from Clang's main
|
||||
# CMakeLists.txt, so it should kept in sync the code in Clang which was added
|
||||
# in llvm-svn 308844.
|
||||
if(LLVM_ENABLE_MODULES)
|
||||
list(APPEND LLVM_COMMON_DEPENDS intrinsics_gen)
|
||||
endif()
|
||||
|
||||
if(CMAKE_CROSSCOMPILING AND LLDB_BUILT_STANDALONE)
|
||||
set(LLVM_USE_HOST_TOOLS ON)
|
||||
include(CrossCompile)
|
||||
if (NOT NATIVE_LLVM_DIR OR NOT NATIVE_Clang_DIR)
|
||||
message(FATAL_ERROR
|
||||
"Crosscompiling standalone requires the variables NATIVE_{CLANG,LLVM}_DIR
|
||||
for building the native lldb-tblgen used during the build process.")
|
||||
endif()
|
||||
llvm_create_cross_target(lldb NATIVE "" Release
|
||||
-DLLVM_DIR=${NATIVE_LLVM_DIR}
|
||||
-DClang_DIR=${NATIVE_Clang_DIR})
|
||||
endif()
|
||||
|
||||
# TableGen
|
||||
add_subdirectory(utils/TableGen)
|
||||
|
||||
add_subdirectory(source)
|
||||
add_subdirectory(tools)
|
||||
add_subdirectory(docs)
|
||||
|
||||
if (LLDB_ENABLE_PYTHON)
|
||||
if(LLDB_BUILD_FRAMEWORK)
|
||||
set(lldb_python_target_dir "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/Resources/Python/lldb")
|
||||
else()
|
||||
set(lldb_python_target_dir "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_PYTHON_RELATIVE_PATH}/lldb")
|
||||
endif()
|
||||
get_target_property(lldb_python_bindings_dir swig_wrapper_python BINARY_DIR)
|
||||
finish_swig_python("lldb-python" "${lldb_python_bindings_dir}" "${lldb_python_target_dir}")
|
||||
endif()
|
||||
|
||||
option(LLDB_INCLUDE_TESTS "Generate build targets for the LLDB unit tests." ${LLVM_INCLUDE_TESTS})
|
||||
if(LLDB_INCLUDE_TESTS)
|
||||
add_subdirectory(test)
|
||||
add_subdirectory(unittests)
|
||||
add_subdirectory(utils)
|
||||
endif()
|
||||
|
||||
if(LLDB_BUILT_STANDALONE AND NOT LLVM_ENABLE_IDE)
|
||||
llvm_distribution_add_targets()
|
||||
endif()
|
|
@ -1,48 +0,0 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
file(GLOB SWIG_INTERFACES interface/*.i)
|
||||
file(GLOB_RECURSE SWIG_SOURCES *.swig)
|
||||
file(GLOB SWIG_HEADERS
|
||||
${LLDB_SOURCE_DIR}/include/lldb/API/*.h
|
||||
${LLDB_SOURCE_DIR}/include/lldb/*.h
|
||||
)
|
||||
file(GLOB SWIG_PRIVATE_HEADERS
|
||||
${LLDB_SOURCE_DIR}/include/lldb/lldb-private*.h
|
||||
)
|
||||
foreach(private_header ${SWIG_PRIVATE_HEADERS})
|
||||
list(REMOVE_ITEM SWIG_HEADERS ${private_header})
|
||||
endforeach()
|
||||
|
||||
if(LLDB_BUILD_FRAMEWORK)
|
||||
set(framework_arg --framework --target-platform Darwin)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
set(DARWIN_EXTRAS "-D__APPLE__")
|
||||
else()
|
||||
set(DARWIN_EXTRAS "")
|
||||
endif()
|
||||
|
||||
set(SWIG_COMMON_FLAGS
|
||||
-c++
|
||||
-features autodoc
|
||||
-I${LLDB_SOURCE_DIR}/include
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}
|
||||
-D__STDC_LIMIT_MACROS
|
||||
-D__STDC_CONSTANT_MACROS
|
||||
${DARWIN_EXTRAS}
|
||||
)
|
||||
|
||||
if (LLDB_ENABLE_PYTHON)
|
||||
add_subdirectory(python)
|
||||
endif()
|
||||
|
||||
if (LLDB_ENABLE_LUA)
|
||||
add_subdirectory(lua)
|
||||
endif()
|
||||
|
||||
if (LLDB_ENABLE_JAVA)
|
||||
add_subdirectory(java)
|
||||
endif()
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapJava.cpp
|
||||
DEPENDS ${SWIG_SOURCES}
|
||||
DEPENDS ${SWIG_INTERFACES}
|
||||
DEPENDS ${SWIG_HEADERS}
|
||||
COMMAND ${SWIG_EXECUTABLE}
|
||||
${SWIG_COMMON_FLAGS}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}
|
||||
-java
|
||||
-package SWIG
|
||||
-c++
|
||||
-outdir ${CMAKE_CURRENT_BINARY_DIR}
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapJava.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/java.swig
|
||||
VERBATIM
|
||||
COMMENT "Building LLDB Java wrapper")
|
||||
|
||||
add_custom_target(swig_wrapper_java ALL DEPENDS
|
||||
${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapJava.cpp
|
||||
)
|
|
@ -1,32 +0,0 @@
|
|||
#.rst:
|
||||
# FindJavaAndSwig
|
||||
# --------------
|
||||
#
|
||||
# Find Java and SWIG as a whole.
|
||||
|
||||
#if(JAVA_LIBRARIES AND JAVA_INCLUDE_DIR AND SWIG_EXECUTABLE)
|
||||
if(SWIG_EXECUTABLE)
|
||||
set(JAVAANDSWIG_FOUND TRUE)
|
||||
else()
|
||||
find_package(SWIG 2.0)
|
||||
if (SWIG_FOUND)
|
||||
find_package(Java 11.0)
|
||||
if(JAVA_FOUND AND SWIG_FOUND)
|
||||
mark_as_advanced(
|
||||
JAVA_LIBRARIES
|
||||
JAVA_INCLUDE_DIR
|
||||
SWIG_EXECUTABLE)
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "SWIG 2 or later is required for Java support in LLDB but could not be found")
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(JavaAndSwig
|
||||
FOUND_VAR
|
||||
JAVAANDSWIG_FOUND
|
||||
REQUIRED_VARS
|
||||
JAVA_LIBRARIES
|
||||
JAVA_INCLUDE_DIR
|
||||
SWIG_EXECUTABLE)
|
||||
endif()
|
|
@ -1,319 +0,0 @@
|
|||
include(CheckCXXSymbolExists)
|
||||
include(CheckTypeSize)
|
||||
|
||||
set(LLDB_PROJECT_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(LLDB_SOURCE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/source")
|
||||
set(LLDB_INCLUDE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
||||
|
||||
set(LLDB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(LLDB_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
|
||||
message(FATAL_ERROR
|
||||
"In-source builds are not allowed. CMake would overwrite the makefiles "
|
||||
"distributed with LLDB. Please create a directory and run cmake from "
|
||||
"there, passing the path to this source directory as the last argument. "
|
||||
"This process created the file `CMakeCache.txt' and the directory "
|
||||
"`CMakeFiles'. Please delete them.")
|
||||
endif()
|
||||
|
||||
set(LLDB_LINKER_SUPPORTS_GROUPS OFF)
|
||||
if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
|
||||
# The Darwin linker doesn't understand --start-group/--end-group.
|
||||
set(LLDB_LINKER_SUPPORTS_GROUPS ON)
|
||||
endif()
|
||||
|
||||
macro(add_optional_dependency variable description package found)
|
||||
cmake_parse_arguments(ARG
|
||||
""
|
||||
"VERSION"
|
||||
""
|
||||
${ARGN})
|
||||
|
||||
set(${variable} "Auto" CACHE STRING "${description} On, Off or Auto (default)")
|
||||
string(TOUPPER "${${variable}}" ${variable})
|
||||
|
||||
if("${${variable}}" STREQUAL "AUTO")
|
||||
set(find_package TRUE)
|
||||
set(maybe_required)
|
||||
elseif(${${variable}})
|
||||
set(find_package TRUE)
|
||||
set(maybe_required REQUIRED)
|
||||
else()
|
||||
set(find_package FALSE)
|
||||
set(${variable} FALSE)
|
||||
endif()
|
||||
|
||||
if(${find_package})
|
||||
find_package(${package} ${ARG_VERSION} ${maybe_required})
|
||||
set(${variable} "${${found}}")
|
||||
endif()
|
||||
|
||||
message(STATUS "${description}: ${${variable}}")
|
||||
endmacro()
|
||||
|
||||
add_optional_dependency(LLDB_ENABLE_LIBEDIT "Enable editline support in LLDB" LibEdit LibEdit_FOUND)
|
||||
add_optional_dependency(LLDB_ENABLE_CURSES "Enable curses support in LLDB" CursesAndPanel CURSESANDPANEL_FOUND)
|
||||
add_optional_dependency(LLDB_ENABLE_LZMA "Enable LZMA compression support in LLDB" LibLZMA LIBLZMA_FOUND)
|
||||
add_optional_dependency(LLDB_ENABLE_LUA "Enable Lua scripting support in LLDB" LuaAndSwig LUAANDSWIG_FOUND)
|
||||
add_optional_dependency(LLDB_ENABLE_JAVA "Enable Java scripting support in LLDB" JavaAndSwig JAVAANDSWIG_FOUND)
|
||||
add_optional_dependency(LLDB_ENABLE_PYTHON "Enable Python scripting support in LLDB" PythonAndSwig PYTHONANDSWIG_FOUND)
|
||||
add_optional_dependency(LLDB_ENABLE_LIBXML2 "Enable Libxml 2 support in LLDB" LibXml2 LIBXML2_FOUND VERSION 2.8)
|
||||
|
||||
option(LLDB_USE_SYSTEM_SIX "Use six.py shipped with system and do not install a copy of it" OFF)
|
||||
option(LLDB_USE_ENTITLEMENTS "When codesigning, use entitlements if available" ON)
|
||||
option(LLDB_BUILD_FRAMEWORK "Build LLDB.framework (Darwin only)" OFF)
|
||||
option(LLDB_NO_INSTALL_DEFAULT_RPATH "Disable default RPATH settings in binaries" OFF)
|
||||
option(LLDB_USE_SYSTEM_DEBUGSERVER "Use the system's debugserver for testing (Darwin only)." OFF)
|
||||
option(LLDB_SKIP_STRIP "Whether to skip stripping of binaries when installing lldb." OFF)
|
||||
option(LLDB_SKIP_DSYM "Whether to skip generating a dSYM when installing lldb." OFF)
|
||||
|
||||
if (LLDB_USE_SYSTEM_DEBUGSERVER)
|
||||
# The custom target for the system debugserver has no install target, so we
|
||||
# need to remove it from the LLVM_DISTRIBUTION_COMPONENTS list.
|
||||
if (LLVM_DISTRIBUTION_COMPONENTS)
|
||||
list(REMOVE_ITEM LLVM_DISTRIBUTION_COMPONENTS debugserver)
|
||||
set(LLVM_DISTRIBUTION_COMPONENTS ${LLVM_DISTRIBUTION_COMPONENTS} CACHE STRING "" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(LLDB_BUILD_FRAMEWORK)
|
||||
if(NOT APPLE)
|
||||
message(FATAL_ERROR "LLDB.framework can only be generated when targeting Apple platforms")
|
||||
endif()
|
||||
|
||||
set(LLDB_FRAMEWORK_VERSION A CACHE STRING "LLDB.framework version (default is A)")
|
||||
set(LLDB_FRAMEWORK_BUILD_DIR bin CACHE STRING "Output directory for LLDB.framework")
|
||||
set(LLDB_FRAMEWORK_INSTALL_DIR Library/Frameworks CACHE STRING "Install directory for LLDB.framework")
|
||||
|
||||
get_filename_component(LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR ${LLDB_FRAMEWORK_BUILD_DIR} ABSOLUTE
|
||||
BASE_DIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR})
|
||||
|
||||
# Essentially, emit the framework's dSYM outside of the framework directory.
|
||||
set(LLDB_DEBUGINFO_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin CACHE STRING
|
||||
"Directory to emit dSYM files stripped from executables and libraries (Darwin Only)")
|
||||
endif()
|
||||
|
||||
if(APPLE AND CMAKE_GENERATOR STREQUAL Xcode)
|
||||
if(NOT LLDB_EXPLICIT_XCODE_CACHE_USED)
|
||||
message(WARNING
|
||||
"When building with Xcode, we recommend using the corresponding cache script. "
|
||||
"If this was a mistake, clean your build directory and re-run CMake with:\n"
|
||||
" -C ${CMAKE_SOURCE_DIR}/cmake/caches/Apple-lldb-Xcode.cmake\n"
|
||||
"See: https://lldb.llvm.org/resources/build.html#cmakegeneratedxcodeproject\n")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
set(LLDB_EXPORT_ALL_SYMBOLS 0 CACHE BOOL
|
||||
"Causes lldb to export all symbols when building liblldb.")
|
||||
else()
|
||||
# Windows doesn't support toggling this, so don't bother making it a
|
||||
# cache variable.
|
||||
set(LLDB_EXPORT_ALL_SYMBOLS 0)
|
||||
endif()
|
||||
|
||||
if ((NOT MSVC) OR MSVC12)
|
||||
add_definitions( -DHAVE_ROUND )
|
||||
endif()
|
||||
|
||||
# Check if we libedit capable of handling wide characters (built with
|
||||
# '--enable-widec').
|
||||
if (LLDB_ENABLE_LIBEDIT)
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${LibEdit_LIBRARIES})
|
||||
set(CMAKE_REQUIRED_INCLUDES ${LibEdit_INCLUDE_DIRS})
|
||||
check_symbol_exists(el_winsertstr histedit.h LLDB_EDITLINE_USE_WCHAR)
|
||||
set(CMAKE_EXTRA_INCLUDE_FILES histedit.h)
|
||||
check_type_size(el_rfunc_t LLDB_EL_RFUNC_T_SIZE)
|
||||
if (LLDB_EL_RFUNC_T_SIZE STREQUAL "")
|
||||
set(LLDB_HAVE_EL_RFUNC_T 0)
|
||||
else()
|
||||
set(LLDB_HAVE_EL_RFUNC_T 1)
|
||||
endif()
|
||||
set(CMAKE_REQUIRED_LIBRARIES)
|
||||
set(CMAKE_REQUIRED_INCLUDES)
|
||||
set(CMAKE_EXTRA_INCLUDE_FILES)
|
||||
endif()
|
||||
|
||||
if (LLDB_ENABLE_PYTHON)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
set(default_embed_python_home ON)
|
||||
else()
|
||||
set(default_embed_python_home OFF)
|
||||
endif()
|
||||
option(LLDB_EMBED_PYTHON_HOME
|
||||
"Embed PYTHONHOME in the binary. If set to OFF, PYTHONHOME environment variable will be used to to locate Python."
|
||||
${default_embed_python_home})
|
||||
|
||||
include_directories(${Python3_INCLUDE_DIRS})
|
||||
if (LLDB_EMBED_PYTHON_HOME)
|
||||
get_filename_component(PYTHON_HOME "${Python3_EXECUTABLE}" DIRECTORY)
|
||||
set(LLDB_PYTHON_HOME "${PYTHON_HOME}" CACHE STRING
|
||||
"Path to use as PYTHONHOME in lldb. If a relative path is specified, it will be resolved at runtime relative to liblldb directory.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (LLVM_EXTERNAL_CLANG_SOURCE_DIR)
|
||||
include_directories(${LLVM_EXTERNAL_CLANG_SOURCE_DIR}/include)
|
||||
else ()
|
||||
include_directories(${CMAKE_SOURCE_DIR}/tools/clang/include)
|
||||
endif ()
|
||||
include_directories("${CMAKE_CURRENT_BINARY_DIR}/../clang/include")
|
||||
|
||||
# Disable GCC warnings
|
||||
check_cxx_compiler_flag("-Wno-deprecated-declarations" CXX_SUPPORTS_NO_DEPRECATED_DECLARATIONS)
|
||||
append_if(CXX_SUPPORTS_NO_DEPRECATED_DECLARATIONS "-Wno-deprecated-declarations" CMAKE_CXX_FLAGS)
|
||||
|
||||
check_cxx_compiler_flag("-Wno-unknown-pragmas" CXX_SUPPORTS_NO_UNKNOWN_PRAGMAS)
|
||||
append_if(CXX_SUPPORTS_NO_UNKNOWN_PRAGMAS "-Wno-unknown-pragmas" CMAKE_CXX_FLAGS)
|
||||
|
||||
check_cxx_compiler_flag("-Wno-strict-aliasing" CXX_SUPPORTS_NO_STRICT_ALIASING)
|
||||
append_if(CXX_SUPPORTS_NO_STRICT_ALIASING "-Wno-strict-aliasing" CMAKE_CXX_FLAGS)
|
||||
|
||||
# Disable Clang warnings
|
||||
check_cxx_compiler_flag("-Wno-deprecated-register" CXX_SUPPORTS_NO_DEPRECATED_REGISTER)
|
||||
append_if(CXX_SUPPORTS_NO_DEPRECATED_REGISTER "-Wno-deprecated-register" CMAKE_CXX_FLAGS)
|
||||
|
||||
check_cxx_compiler_flag("-Wno-vla-extension" CXX_SUPPORTS_NO_VLA_EXTENSION)
|
||||
append_if(CXX_SUPPORTS_NO_VLA_EXTENSION "-Wno-vla-extension" CMAKE_CXX_FLAGS)
|
||||
|
||||
# Disable MSVC warnings
|
||||
if( MSVC )
|
||||
add_definitions(
|
||||
-wd4018 # Suppress 'warning C4018: '>=' : signed/unsigned mismatch'
|
||||
-wd4068 # Suppress 'warning C4068: unknown pragma'
|
||||
-wd4150 # Suppress 'warning C4150: deletion of pointer to incomplete type'
|
||||
-wd4201 # Suppress 'warning C4201: nonstandard extension used: nameless struct/union'
|
||||
-wd4251 # Suppress 'warning C4251: T must have dll-interface to be used by clients of class U.'
|
||||
-wd4521 # Suppress 'warning C4521: 'type' : multiple copy constructors specified'
|
||||
-wd4530 # Suppress 'warning C4530: C++ exception handler used, but unwind semantics are not enabled.'
|
||||
)
|
||||
endif()
|
||||
|
||||
# Use the Unicode (UTF-16) APIs by default on Win32
|
||||
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
add_definitions( -D_UNICODE -DUNICODE )
|
||||
endif()
|
||||
|
||||
# If LLDB_VERSION_* is specified, use it, if not use LLVM_VERSION_*.
|
||||
if(NOT DEFINED LLDB_VERSION_MAJOR)
|
||||
set(LLDB_VERSION_MAJOR ${LLVM_VERSION_MAJOR})
|
||||
endif()
|
||||
if(NOT DEFINED LLDB_VERSION_MINOR)
|
||||
set(LLDB_VERSION_MINOR ${LLVM_VERSION_MINOR})
|
||||
endif()
|
||||
if(NOT DEFINED LLDB_VERSION_PATCH)
|
||||
set(LLDB_VERSION_PATCH ${LLVM_VERSION_PATCH})
|
||||
endif()
|
||||
if(NOT DEFINED LLDB_VERSION_SUFFIX)
|
||||
set(LLDB_VERSION_SUFFIX ${LLVM_VERSION_SUFFIX})
|
||||
endif()
|
||||
set(LLDB_VERSION "${LLDB_VERSION_MAJOR}.${LLDB_VERSION_MINOR}.${LLDB_VERSION_PATCH}${LLDB_VERSION_SUFFIX}")
|
||||
message(STATUS "LLDB version: ${LLDB_VERSION}")
|
||||
|
||||
if (LLDB_ENABLE_LZMA)
|
||||
include_directories(${LIBLZMA_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
if (LLDB_ENABLE_LIBXML2)
|
||||
include_directories(${LIBXML2_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
include_directories(BEFORE
|
||||
${CMAKE_CURRENT_BINARY_DIR}/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||
)
|
||||
|
||||
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
|
||||
install(DIRECTORY include/
|
||||
COMPONENT lldb-headers
|
||||
DESTINATION include
|
||||
FILES_MATCHING
|
||||
PATTERN "*.h"
|
||||
PATTERN ".cmake" EXCLUDE
|
||||
)
|
||||
|
||||
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/
|
||||
COMPONENT lldb-headers
|
||||
DESTINATION include
|
||||
FILES_MATCHING
|
||||
PATTERN "*.h"
|
||||
PATTERN ".cmake" EXCLUDE
|
||||
)
|
||||
|
||||
add_custom_target(lldb-headers)
|
||||
set_target_properties(lldb-headers PROPERTIES FOLDER "lldb misc")
|
||||
|
||||
if (NOT CMAKE_CONFIGURATION_TYPES)
|
||||
add_llvm_install_targets(install-lldb-headers
|
||||
COMPONENT lldb-headers)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
# If LLDB is building against a prebuilt Clang, then the Clang resource
|
||||
# directory that LLDB is using for its embedded Clang instance needs to point
|
||||
# to the resource directory of the used Clang installation.
|
||||
if (NOT TARGET clang-resource-headers)
|
||||
set(LLDB_CLANG_RESOURCE_DIR_NAME "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}")
|
||||
# Iterate over the possible places where the external resource directory
|
||||
# could be and pick the first that exists.
|
||||
foreach(CANDIDATE "${Clang_DIR}/../.." "${LLVM_DIR}" "${LLVM_LIBRARY_DIRS}"
|
||||
"${LLVM_BUILD_LIBRARY_DIR}"
|
||||
"${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}")
|
||||
# Build the resource directory path by appending 'clang/<version number>'.
|
||||
set(CANDIDATE_RESOURCE_DIR "${CANDIDATE}/clang/${LLDB_CLANG_RESOURCE_DIR_NAME}")
|
||||
if (IS_DIRECTORY "${CANDIDATE_RESOURCE_DIR}")
|
||||
set(LLDB_EXTERNAL_CLANG_RESOURCE_DIR "${CANDIDATE_RESOURCE_DIR}")
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if (NOT LLDB_EXTERNAL_CLANG_RESOURCE_DIR)
|
||||
message(FATAL_ERROR "Expected directory for clang-resource headers not found: ${LLDB_EXTERNAL_CLANG_RESOURCE_DIR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Find Apple-specific libraries or frameworks that may be needed.
|
||||
if (APPLE)
|
||||
if(NOT APPLE_EMBEDDED)
|
||||
find_library(CARBON_LIBRARY Carbon)
|
||||
find_library(CORE_SERVICES_LIBRARY CoreServices)
|
||||
endif()
|
||||
find_library(FOUNDATION_LIBRARY Foundation)
|
||||
find_library(CORE_FOUNDATION_LIBRARY CoreFoundation)
|
||||
find_library(SECURITY_LIBRARY Security)
|
||||
include_directories(${LIBXML2_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
if( WIN32 AND NOT CYGWIN )
|
||||
set(PURE_WINDOWS 1)
|
||||
endif()
|
||||
|
||||
if(NOT PURE_WINDOWS)
|
||||
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
||||
find_package(Threads REQUIRED)
|
||||
endif()
|
||||
|
||||
# Figure out if lldb could use lldb-server. If so, then we'll
|
||||
# ensure we build lldb-server when an lldb target is being built.
|
||||
if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD|Windows")
|
||||
set(LLDB_CAN_USE_LLDB_SERVER ON)
|
||||
else()
|
||||
set(LLDB_CAN_USE_LLDB_SERVER OFF)
|
||||
endif()
|
||||
|
||||
# Figure out if lldb could use debugserver. If so, then we'll
|
||||
# ensure we build debugserver when we build lldb.
|
||||
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
set(LLDB_CAN_USE_DEBUGSERVER ON)
|
||||
else()
|
||||
set(LLDB_CAN_USE_DEBUGSERVER OFF)
|
||||
endif()
|
||||
|
||||
if ((CMAKE_SYSTEM_NAME MATCHES "Android") AND LLVM_BUILD_STATIC AND
|
||||
((ANDROID_ABI MATCHES "armeabi") OR (ANDROID_ABI MATCHES "mips")))
|
||||
add_definitions(-DANDROID_USE_ACCEPT_WORKAROUND)
|
||||
endif()
|
||||
|
||||
include(LLDBGenerateConfig)
|
File diff suppressed because it is too large
Load diff
|
@ -1,26 +0,0 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
/*
|
||||
* @(#)jni_md.h 1.19 05/11/17
|
||||
*
|
||||
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
|
||||
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#ifndef _JAVASOFT_JNI_MD_H_
|
||||
#define _JAVASOFT_JNI_MD_H_
|
||||
|
||||
#define JNIEXPORT __attribute__((visibility("default")))
|
||||
#define JNIIMPORT
|
||||
#define JNICALL
|
||||
|
||||
#if defined(__LP64__) && __LP64__ /* for -Wundef */
|
||||
typedef int jint;
|
||||
#else
|
||||
typedef long jint;
|
||||
#endif
|
||||
typedef long long jlong;
|
||||
typedef signed char jbyte;
|
||||
|
||||
#endif /* !_JAVASOFT_JNI_MD_H_ */
|
|
@ -1,64 +0,0 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
//===-- Config.h -----------------------------------------------*- C++ -*-===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLDB_HOST_CONFIG_H
|
||||
#define LLDB_HOST_CONFIG_H
|
||||
|
||||
#cmakedefine01 LLDB_EDITLINE_USE_WCHAR
|
||||
|
||||
#cmakedefine01 LLDB_HAVE_EL_RFUNC_T
|
||||
|
||||
|
||||
#cmakedefine01 HAVE_SYS_TYPES_H
|
||||
|
||||
#cmakedefine01 HAVE_SYS_EVENT_H
|
||||
|
||||
#cmakedefine01 HAVE_PPOLL
|
||||
|
||||
#cmakedefine01 HAVE_PTSNAME_R
|
||||
|
||||
#cmakedefine01 HAVE_SIGACTION
|
||||
|
||||
#cmakedefine01 HAVE_PROCESS_VM_READV
|
||||
|
||||
#cmakedefine01 HAVE_NR_PROCESS_VM_READV
|
||||
|
||||
#ifndef HAVE_LIBCOMPRESSION
|
||||
#cmakedefine HAVE_LIBCOMPRESSION
|
||||
#endif
|
||||
|
||||
#cmakedefine01 LLDB_ENABLE_POSIX
|
||||
|
||||
#cmakedefine01 LLDB_ENABLE_TERMIOS
|
||||
|
||||
#cmakedefine01 LLDB_ENABLE_LZMA
|
||||
|
||||
#cmakedefine01 LLDB_ENABLE_CURSES
|
||||
|
||||
#cmakedefine01 CURSES_HAVE_NCURSES_CURSES_H
|
||||
|
||||
#cmakedefine01 LLDB_ENABLE_LIBEDIT
|
||||
|
||||
#cmakedefine01 LLDB_ENABLE_LIBXML2
|
||||
|
||||
#cmakedefine01 LLDB_ENABLE_LUA
|
||||
|
||||
#cmakedefine01 LLDB_ENABLE_PYTHON
|
||||
|
||||
#cmakedefine01 LLDB_ENABLE_JAVA
|
||||
|
||||
#cmakedefine01 LLDB_EMBED_PYTHON_HOME
|
||||
|
||||
#cmakedefine LLDB_PYTHON_HOME R"(${LLDB_PYTHON_HOME})"
|
||||
|
||||
#define LLDB_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}"
|
||||
|
||||
#endif // #ifndef LLDB_HOST_CONFIG_H
|
|
@ -1,247 +0,0 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
|
||||
add_definitions( -DEXPORT_LIBLLDB )
|
||||
endif()
|
||||
|
||||
get_property(LLDB_ALL_PLUGINS GLOBAL PROPERTY LLDB_PLUGINS)
|
||||
|
||||
if(LLDB_BUILD_FRAMEWORK)
|
||||
set(option_install_prefix INSTALL_PREFIX ${LLDB_FRAMEWORK_INSTALL_DIR})
|
||||
set(option_framework FRAMEWORK)
|
||||
endif()
|
||||
|
||||
if(LLDB_ENABLE_PYTHON)
|
||||
get_target_property(python_bindings_dir swig_wrapper_python BINARY_DIR)
|
||||
set(lldb_python_wrapper ${python_bindings_dir}/LLDBWrapPython.cpp)
|
||||
endif()
|
||||
|
||||
if(LLDB_ENABLE_LUA)
|
||||
get_target_property(lua_bindings_dir swig_wrapper_lua BINARY_DIR)
|
||||
set(lldb_lua_wrapper ${lua_bindings_dir}/LLDBWrapLua.cpp)
|
||||
endif()
|
||||
|
||||
if(LLDB_ENABLE_JAVA)
|
||||
get_target_property(java_bindings_dir swig_wrapper_java BINARY_DIR)
|
||||
set(lldb_java_wrapper ${java_bindings_dir}/LLDBWrapJava.cpp)
|
||||
endif()
|
||||
|
||||
add_lldb_library(liblldb SHARED ${option_framework}
|
||||
SBAddress.cpp
|
||||
SBAttachInfo.cpp
|
||||
SBBlock.cpp
|
||||
SBBreakpoint.cpp
|
||||
SBBreakpointLocation.cpp
|
||||
SBBreakpointName.cpp
|
||||
SBBreakpointOptionCommon.cpp
|
||||
SBBroadcaster.cpp
|
||||
SBCommandInterpreter.cpp
|
||||
SBCommandInterpreterRunOptions.cpp
|
||||
SBCommandReturnObject.cpp
|
||||
SBCommunication.cpp
|
||||
SBCompileUnit.cpp
|
||||
SBData.cpp
|
||||
SBDebugger.cpp
|
||||
SBDeclaration.cpp
|
||||
SBEnvironment.cpp
|
||||
SBError.cpp
|
||||
SBEvent.cpp
|
||||
SBExecutionContext.cpp
|
||||
SBExpressionOptions.cpp
|
||||
SBFileSpec.cpp
|
||||
SBFile.cpp
|
||||
SBFileSpecList.cpp
|
||||
SBFrame.cpp
|
||||
SBFunction.cpp
|
||||
SBHostOS.cpp
|
||||
SBInstruction.cpp
|
||||
SBInstructionList.cpp
|
||||
SBLanguageRuntime.cpp
|
||||
SBLaunchInfo.cpp
|
||||
SBLineEntry.cpp
|
||||
SBListener.cpp
|
||||
SBMemoryRegionInfo.cpp
|
||||
SBMemoryRegionInfoList.cpp
|
||||
SBModule.cpp
|
||||
SBModuleSpec.cpp
|
||||
SBPlatform.cpp
|
||||
SBProcess.cpp
|
||||
SBProcessInfo.cpp
|
||||
SBQueue.cpp
|
||||
SBQueueItem.cpp
|
||||
SBReproducer.cpp
|
||||
SBSection.cpp
|
||||
SBSourceManager.cpp
|
||||
SBStream.cpp
|
||||
SBStringList.cpp
|
||||
SBStructuredData.cpp
|
||||
SBSymbol.cpp
|
||||
SBSymbolContext.cpp
|
||||
SBSymbolContextList.cpp
|
||||
SBTarget.cpp
|
||||
SBThread.cpp
|
||||
SBThreadCollection.cpp
|
||||
SBThreadPlan.cpp
|
||||
SBTrace.cpp
|
||||
SBTraceOptions.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_python_wrapper}
|
||||
${lldb_lua_wrapper}
|
||||
${lldb_java_wrapper}
|
||||
|
||||
LINK_LIBS
|
||||
lldbBase
|
||||
lldbBreakpoint
|
||||
lldbCore
|
||||
lldbDataFormatters
|
||||
lldbExpression
|
||||
lldbHost
|
||||
lldbInitialization
|
||||
lldbInterpreter
|
||||
lldbSymbol
|
||||
lldbTarget
|
||||
lldbUtility
|
||||
${LLDB_ALL_PLUGINS}
|
||||
LINK_COMPONENTS
|
||||
Support
|
||||
|
||||
${option_install_prefix}
|
||||
)
|
||||
|
||||
# lib/pythonX.Y/dist-packages/lldb/_lldb.so is a symlink to lib/liblldb.so,
|
||||
# which depends on lib/libLLVM*.so (BUILD_SHARED_LIBS) or lib/libLLVM-10git.so
|
||||
# (LLVM_LINK_LLVM_DYLIB). Add an additional rpath $ORIGIN/../../../../lib so
|
||||
# that _lldb.so can be loaded from Python.
|
||||
if(LLDB_ENABLE_PYTHON AND (BUILD_SHARED_LIBS OR LLVM_LINK_LLVM_DYLIB) AND UNIX AND NOT APPLE)
|
||||
set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH "\$ORIGIN/../../../../lib${LLVM_LIBDIR_SUFFIX}")
|
||||
endif()
|
||||
|
||||
if(Python3_RPATH)
|
||||
set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH "${Python3_RPATH}")
|
||||
set_property(TARGET liblldb APPEND PROPERTY BUILD_RPATH "${Python3_RPATH}")
|
||||
endif()
|
||||
|
||||
|
||||
if(LLDB_ENABLE_PYTHON)
|
||||
add_dependencies(liblldb swig_wrapper_python)
|
||||
|
||||
if (MSVC)
|
||||
set_property(SOURCE ${lldb_python_wrapper} APPEND_STRING PROPERTY COMPILE_FLAGS " /W0")
|
||||
else()
|
||||
set_property(SOURCE ${lldb_python_wrapper} APPEND_STRING PROPERTY COMPILE_FLAGS " -w")
|
||||
endif()
|
||||
|
||||
set_source_files_properties(${lldb_python_wrapper} PROPERTIES GENERATED ON)
|
||||
if (CLANG_CL)
|
||||
set_property(SOURCE ${lldb_python_wrapper} APPEND_STRING
|
||||
PROPERTY COMPILE_FLAGS " -Wno-unused-function")
|
||||
endif()
|
||||
if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND
|
||||
NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
|
||||
set_property(SOURCE ${lldb_python_wrapper} APPEND_STRING
|
||||
PROPERTY COMPILE_FLAGS " -Wno-sequence-point -Wno-cast-qual")
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
if(LLDB_ENABLE_LUA)
|
||||
add_dependencies(liblldb swig_wrapper_lua)
|
||||
target_include_directories(liblldb PRIVATE ${LUA_INCLUDE_DIR})
|
||||
|
||||
if (MSVC)
|
||||
set_property(SOURCE ${lldb_lua_wrapper} APPEND_STRING PROPERTY COMPILE_FLAGS " /W0")
|
||||
else()
|
||||
set_property(SOURCE ${lldb_lua_wrapper} APPEND_STRING PROPERTY COMPILE_FLAGS " -w")
|
||||
endif()
|
||||
|
||||
set_source_files_properties(${lldb_lua_wrapper} PROPERTIES GENERATED ON)
|
||||
endif()
|
||||
|
||||
if(LLDB_ENABLE_JAVA)
|
||||
add_dependencies(liblldb swig_wrapper_java)
|
||||
target_include_directories(liblldb PRIVATE ${JAVA_INCLUDE_DIR})
|
||||
target_include_directories(liblldb PRIVATE ${JAVA_INCLUDE_DIR}/darwin)
|
||||
|
||||
if (MSVC)
|
||||
set_property(SOURCE ${lldb_java_wrapper} APPEND_STRING PROPERTY COMPILE_FLAGS " /W0")
|
||||
else()
|
||||
set_property(SOURCE ${lldb_java_wrapper} APPEND_STRING PROPERTY COMPILE_FLAGS " ")
|
||||
endif()
|
||||
|
||||
set_source_files_properties(${lldb_java_wrapper} PROPERTIES GENERATED ON)
|
||||
endif()
|
||||
|
||||
|
||||
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): exporting all symbols from the lldb namespace")
|
||||
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 from the lldb and lldb_private namespaces")
|
||||
add_llvm_symbol_exports(liblldb ${CMAKE_CURRENT_SOURCE_DIR}/liblldb-private.exports)
|
||||
endif()
|
||||
set_target_properties(liblldb_exports PROPERTIES FOLDER "lldb misc")
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
# Only MSVC has the ABI compatibility problem and avoids using FindPythonLibs,
|
||||
# so only it needs to explicitly link against ${Python3_LIBRARIES}
|
||||
if (LLDB_ENABLE_PYTHON)
|
||||
target_link_libraries(liblldb PRIVATE ${Python3_LIBRARIES})
|
||||
endif()
|
||||
else()
|
||||
set_target_properties(liblldb
|
||||
PROPERTIES
|
||||
OUTPUT_NAME lldb
|
||||
)
|
||||
endif()
|
||||
|
||||
# The Clang expression parser in LLDB requires the Clang resource directory to function.
|
||||
if (TARGET clang-resource-headers)
|
||||
# If building alongside Clang, just add a dependency to ensure it is build together with liblldb.
|
||||
add_dependencies(liblldb clang-resource-headers)
|
||||
else()
|
||||
# In a standalone build create a symlink from the LLDB library directory that points to the
|
||||
# resource directory in the Clang library directory. LLDB searches relative to its install path,
|
||||
# and the symlink is created in the same relative path as the resource directory of Clang when
|
||||
# building alongside Clang.
|
||||
# When building the LLDB framework, this isn't necessary as there we copy everything we need into
|
||||
# the framework (including the Clang resourece directory).
|
||||
if(NOT LLDB_BUILD_FRAMEWORK)
|
||||
set(LLDB_CLANG_RESOURCE_DIR_PARENT "$<TARGET_FILE_DIR:liblldb>/clang")
|
||||
file(MAKE_DIRECTORY "${LLDB_CLANG_RESOURCE_DIR_PARENT}")
|
||||
add_custom_command(TARGET liblldb POST_BUILD
|
||||
COMMENT "Linking Clang resource dir into LLDB build directory: ${LLDB_CLANG_RESOURCE_DIR_PARENT}"
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${LLDB_CLANG_RESOURCE_DIR_PARENT}"
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink "${LLDB_EXTERNAL_CLANG_RESOURCE_DIR}"
|
||||
"${LLDB_CLANG_RESOURCE_DIR_PARENT}/${LLDB_CLANG_RESOURCE_DIR_NAME}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(LLDB_BUILD_FRAMEWORK)
|
||||
include(LLDBFramework)
|
||||
endif()
|
File diff suppressed because it is too large
Load diff
|
@ -1,8 +0,0 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
_ZN4lldb*
|
||||
_ZNK4lldb*
|
||||
_ZN12lldb_private*
|
||||
_ZNK12lldb_private*
|
||||
Java*
|
|
@ -1,8 +0,0 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
_ZN4lldb*
|
||||
_ZNK4lldb*
|
||||
_ZN12lldb_private*
|
||||
_ZNK12lldb_private*
|
||||
Java*
|
|
@ -1,17 +0,0 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
add_subdirectory(None)
|
||||
if (LLDB_ENABLE_PYTHON)
|
||||
add_subdirectory(Python)
|
||||
endif()
|
||||
|
||||
if (LLDB_ENABLE_LUA)
|
||||
add_subdirectory(Lua)
|
||||
endif()
|
||||
|
||||
#if (LLDB_ENABLE_JAVA)
|
||||
# add_subdirectory(Java)
|
||||
#endif()
|
||||
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
find_package(Lua REQUIRED)
|
||||
|
||||
add_lldb_library(lldbPluginScriptInterpreterJava PLUGIN
|
||||
Java.cpp
|
||||
ScriptInterpreterJava.cpp
|
||||
|
||||
LINK_LIBS
|
||||
lldbCore
|
||||
lldbInterpreter
|
||||
)
|
||||
|
||||
target_include_directories(lldbPluginScriptInterpreterJava PUBLIC ${JAVA_INCLUDE_DIR})
|
||||
target_link_libraries(lldbPluginScriptInterpreterJava INTERFACE ${JAVA_LIBRARIES})
|
|
@ -1,170 +0,0 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
//===-- Java.cpp -----------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "Java.h"
|
||||
#include "lldb/Host/FileSystem.h"
|
||||
#include "lldb/Utility/FileSpec.h"
|
||||
#include "llvm/Support/Error.h"
|
||||
#include "llvm/Support/FormatVariadic.h"
|
||||
|
||||
using namespace lldb_private;
|
||||
using namespace lldb;
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
|
||||
|
||||
// Disable warning C4190: 'LLDBSwigPythonBreakpointCallbackFunction' has
|
||||
// C-linkage specified, but returns UDT 'llvm::Expected<bool>' which is
|
||||
// incompatible with C
|
||||
#if _MSC_VER
|
||||
#pragma warning (push)
|
||||
#pragma warning (disable : 4190)
|
||||
#endif
|
||||
|
||||
extern "C" llvm::Expected<bool>
|
||||
LLDBSwigJavaBreakpointCallbackFunction(java_State *L,
|
||||
lldb::StackFrameSP stop_frame_sp,
|
||||
lldb::BreakpointLocationSP bp_loc_sp);
|
||||
|
||||
#if _MSC_VER
|
||||
#pragma warning (pop)
|
||||
#endif
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
static int lldb_print(java_State *L) {
|
||||
int n = java_gettop(L);
|
||||
java_getglobal(L, "io");
|
||||
java_getfield(L, -1, "stdout");
|
||||
java_getfield(L, -1, "write");
|
||||
for (int i = 1; i <= n; i++) {
|
||||
java_pushvalue(L, -1); // write()
|
||||
java_pushvalue(L, -3); // io.stdout
|
||||
javaL_tolstring(L, i, nullptr);
|
||||
java_pushstring(L, i != n ? "\t" : "\n");
|
||||
java_call(L, 3, 0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Java::Java() : m_java_state(javaL_newstate()) {
|
||||
assert(m_java_state);
|
||||
javaL_openlibs(m_java_state);
|
||||
javaopen_lldb(m_java_state);
|
||||
java_pushcfunction(m_java_state, lldb_print);
|
||||
java_setglobal(m_java_state, "print");
|
||||
}
|
||||
|
||||
Java::~Java() {
|
||||
assert(m_java_state);
|
||||
java_close(m_java_state);
|
||||
}
|
||||
|
||||
llvm::Error Java::Run(llvm::StringRef buffer) {
|
||||
int error =
|
||||
javaL_loadbuffer(m_java_state, buffer.data(), buffer.size(), "buffer") ||
|
||||
java_pcall(m_java_state, 0, 0, 0);
|
||||
if (error == JAVA_OK)
|
||||
return llvm::Error::success();
|
||||
|
||||
llvm::Error e = llvm::make_error<llvm::StringError>(
|
||||
llvm::formatv("{0}\n", java_tostring(m_java_state, -1)),
|
||||
llvm::inconvertibleErrorCode());
|
||||
// Pop error message from the stack.
|
||||
java_pop(m_java_state, 1);
|
||||
return e;
|
||||
}
|
||||
|
||||
llvm::Error Java::RegisterBreakpointCallback(void *baton, const char *body) {
|
||||
java_pushlightuserdata(m_java_state, baton);
|
||||
const char *fmt_str = "return function(frame, bp_loc, ...) {0} end";
|
||||
std::string func_str = llvm::formatv(fmt_str, body).str();
|
||||
if (javaL_dostring(m_java_state, func_str.c_str()) != JAVA_OK) {
|
||||
llvm::Error e = llvm::make_error<llvm::StringError>(
|
||||
llvm::formatv("{0}", java_tostring(m_java_state, -1)),
|
||||
llvm::inconvertibleErrorCode());
|
||||
// Pop error message from the stack.
|
||||
java_pop(m_java_state, 2);
|
||||
return e;
|
||||
}
|
||||
java_settable(m_java_state, JAVA_REGISTRYINDEX);
|
||||
return llvm::Error::success();
|
||||
}
|
||||
|
||||
llvm::Expected<bool>
|
||||
Java::CallBreakpointCallback(void *baton, lldb::StackFrameSP stop_frame_sp,
|
||||
lldb::BreakpointLocationSP bp_loc_sp) {
|
||||
java_pushlightuserdata(m_java_state, baton);
|
||||
java_gettable(m_java_state, JAVA_REGISTRYINDEX);
|
||||
return LLDBSwigJavaBreakpointCallbackFunction(m_java_state, stop_frame_sp,
|
||||
bp_loc_sp);
|
||||
}
|
||||
|
||||
llvm::Error Java::LoadModule(llvm::StringRef filename) {
|
||||
FileSpec file(filename);
|
||||
if (!FileSystem::Instance().Exists(file)) {
|
||||
return llvm::make_error<llvm::StringError>("invalid path",
|
||||
llvm::inconvertibleErrorCode());
|
||||
}
|
||||
|
||||
ConstString module_extension = file.GetFileNameExtension();
|
||||
if (module_extension != ".java") {
|
||||
return llvm::make_error<llvm::StringError>("invalid extension",
|
||||
llvm::inconvertibleErrorCode());
|
||||
}
|
||||
|
||||
int error = javaL_loadfile(m_java_state, filename.data()) ||
|
||||
java_pcall(m_java_state, 0, 1, 0);
|
||||
if (error != JAVA_OK) {
|
||||
llvm::Error e = llvm::make_error<llvm::StringError>(
|
||||
llvm::formatv("{0}\n", java_tostring(m_java_state, -1)),
|
||||
llvm::inconvertibleErrorCode());
|
||||
// Pop error message from the stack.
|
||||
java_pop(m_java_state, 1);
|
||||
return e;
|
||||
}
|
||||
|
||||
ConstString module_name = file.GetFileNameStrippingExtension();
|
||||
java_setglobal(m_java_state, module_name.GetCString());
|
||||
return llvm::Error::success();
|
||||
}
|
||||
|
||||
llvm::Error Java::ChangeIO(FILE *out, FILE *err) {
|
||||
assert(out != nullptr);
|
||||
assert(err != nullptr);
|
||||
|
||||
java_getglobal(m_java_state, "io");
|
||||
|
||||
java_getfield(m_java_state, -1, "stdout");
|
||||
if (javaL_Stream *s = static_cast<javaL_Stream *>(
|
||||
javaL_testudata(m_java_state, -1, JAVA_FILEHANDLE))) {
|
||||
s->f = out;
|
||||
java_pop(m_java_state, 1);
|
||||
} else {
|
||||
java_pop(m_java_state, 2);
|
||||
return llvm::make_error<llvm::StringError>("could not get stdout",
|
||||
llvm::inconvertibleErrorCode());
|
||||
}
|
||||
|
||||
java_getfield(m_java_state, -1, "stderr");
|
||||
if (javaL_Stream *s = static_cast<javaL_Stream *>(
|
||||
javaL_testudata(m_java_state, -1, JAVA_FILEHANDLE))) {
|
||||
s->f = out;
|
||||
java_pop(m_java_state, 1);
|
||||
} else {
|
||||
java_pop(m_java_state, 2);
|
||||
return llvm::make_error<llvm::StringError>("could not get stderr",
|
||||
llvm::inconvertibleErrorCode());
|
||||
}
|
||||
|
||||
java_pop(m_java_state, 1);
|
||||
return llvm::Error::success();
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
//===-- ScriptInterpreterJava.h ----------------------------------*- C++ -*-===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef liblldb_Java_h_
|
||||
#define liblldb_Java_h_
|
||||
|
||||
#include "lldb/API/SBBreakpointLocation.h"
|
||||
#include "lldb/API/SBFrame.h"
|
||||
#include "lldb/lldb-types.h"
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
#include "llvm/Support/Error.h"
|
||||
|
||||
//#include "java.hpp"
|
||||
|
||||
#include <mutex>
|
||||
|
||||
namespace lldb_private {
|
||||
|
||||
extern "C" {
|
||||
int javaopen_lldb(java_State *L);
|
||||
}
|
||||
|
||||
class Java {
|
||||
public:
|
||||
Java();
|
||||
~Java();
|
||||
|
||||
llvm::Error Run(llvm::StringRef buffer);
|
||||
llvm::Error RegisterBreakpointCallback(void *baton, const char *body);
|
||||
llvm::Expected<bool>
|
||||
CallBreakpointCallback(void *baton, lldb::StackFrameSP stop_frame_sp,
|
||||
lldb::BreakpointLocationSP bp_loc_sp);
|
||||
llvm::Error LoadModule(llvm::StringRef filename);
|
||||
llvm::Error ChangeIO(FILE *out, FILE *err);
|
||||
|
||||
private:
|
||||
java_State *m_java_state;
|
||||
};
|
||||
|
||||
} // namespace lldb_private
|
||||
|
||||
#endif // liblldb_Java_h_
|
|
@ -1,246 +0,0 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
//===-- ScriptInterpreterJava.cpp ------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "ScriptInterpreterJava.h"
|
||||
#include "Java.h"
|
||||
#include "lldb/Breakpoint/StoppointCallbackContext.h"
|
||||
#include "lldb/Core/Debugger.h"
|
||||
#include "lldb/Core/PluginManager.h"
|
||||
#include "lldb/Core/StreamFile.h"
|
||||
#include "lldb/Interpreter/CommandReturnObject.h"
|
||||
#include "lldb/Target/ExecutionContext.h"
|
||||
#include "lldb/Utility/Stream.h"
|
||||
#include "lldb/Utility/StringList.h"
|
||||
#include "lldb/Utility/Timer.h"
|
||||
#include "llvm/Support/FormatAdapters.h"
|
||||
#include <memory>
|
||||
|
||||
using namespace lldb;
|
||||
using namespace lldb_private;
|
||||
|
||||
LLDB_PLUGIN_DEFINE(ScriptInterpreterJava)
|
||||
|
||||
class IOHandlerJavaInterpreter : public IOHandlerDelegate,
|
||||
public IOHandlerEditline {
|
||||
public:
|
||||
IOHandlerJavaInterpreter(Debugger &debugger,
|
||||
ScriptInterpreterJava &script_interpreter)
|
||||
: IOHandlerEditline(debugger, IOHandler::Type::JavaInterpreter, "java",
|
||||
">>> ", "..> ", true, debugger.GetUseColor(), 0,
|
||||
*this, nullptr),
|
||||
m_script_interpreter(script_interpreter) {
|
||||
llvm::cantFail(m_script_interpreter.GetJava().ChangeIO(
|
||||
debugger.GetOutputFile().GetStream(),
|
||||
debugger.GetErrorFile().GetStream()));
|
||||
llvm::cantFail(m_script_interpreter.EnterSession(debugger.GetID()));
|
||||
}
|
||||
|
||||
~IOHandlerJavaInterpreter() override {
|
||||
llvm::cantFail(m_script_interpreter.LeaveSession());
|
||||
}
|
||||
|
||||
void IOHandlerInputComplete(IOHandler &io_handler,
|
||||
std::string &data) override {
|
||||
if (llvm::StringRef(data).rtrim() == "quit") {
|
||||
io_handler.SetIsDone(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (llvm::Error error = m_script_interpreter.GetJava().Run(data)) {
|
||||
*GetOutputStreamFileSP() << llvm::toString(std::move(error));
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
ScriptInterpreterJava &m_script_interpreter;
|
||||
};
|
||||
|
||||
ScriptInterpreterJava::ScriptInterpreterJava(Debugger &debugger)
|
||||
: ScriptInterpreter(debugger, eScriptLanguageJava),
|
||||
m_java(std::make_unique<Java>()) {}
|
||||
|
||||
ScriptInterpreterJava::~ScriptInterpreterJava() {}
|
||||
|
||||
bool ScriptInterpreterJava::ExecuteOneLine(llvm::StringRef command,
|
||||
CommandReturnObject *result,
|
||||
const ExecuteScriptOptions &options) {
|
||||
if (command.empty()) {
|
||||
if (result)
|
||||
result->AppendError("empty command passed to java\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
llvm::Expected<std::unique_ptr<ScriptInterpreterIORedirect>>
|
||||
io_redirect_or_error = ScriptInterpreterIORedirect::Create(
|
||||
options.GetEnableIO(), m_debugger, result);
|
||||
if (!io_redirect_or_error) {
|
||||
if (result)
|
||||
result->AppendErrorWithFormatv(
|
||||
"failed to redirect I/O: {0}\n",
|
||||
llvm::fmt_consume(io_redirect_or_error.takeError()));
|
||||
else
|
||||
llvm::consumeError(io_redirect_or_error.takeError());
|
||||
return false;
|
||||
}
|
||||
|
||||
ScriptInterpreterIORedirect &io_redirect = **io_redirect_or_error;
|
||||
|
||||
if (llvm::Error e =
|
||||
m_java->ChangeIO(io_redirect.GetOutputFile()->GetStream(),
|
||||
io_redirect.GetErrorFile()->GetStream())) {
|
||||
result->AppendErrorWithFormatv("java failed to redirect I/O: {0}\n",
|
||||
llvm::toString(std::move(e)));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (llvm::Error e = m_java->Run(command)) {
|
||||
result->AppendErrorWithFormatv(
|
||||
"java failed attempting to evaluate '{0}': {1}\n", command,
|
||||
llvm::toString(std::move(e)));
|
||||
return false;
|
||||
}
|
||||
|
||||
io_redirect.Flush();
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScriptInterpreterJava::ExecuteInterpreterLoop() {
|
||||
static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
|
||||
Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
|
||||
|
||||
// At the moment, the only time the debugger does not have an input file
|
||||
// handle is when this is called directly from java, in which case it is
|
||||
// both dangerous and unnecessary (not to mention confusing) to try to embed
|
||||
// a running interpreter loop inside the already running java interpreter
|
||||
// loop, so we won't do it.
|
||||
if (!m_debugger.GetInputFile().IsValid())
|
||||
return;
|
||||
|
||||
IOHandlerSP io_handler_sp(new IOHandlerJavaInterpreter(m_debugger, *this));
|
||||
m_debugger.RunIOHandlerAsync(io_handler_sp);
|
||||
}
|
||||
|
||||
bool ScriptInterpreterJava::LoadScriptingModule(
|
||||
const char *filename, bool init_session, lldb_private::Status &error,
|
||||
StructuredData::ObjectSP *module_sp, FileSpec extra_search_dir) {
|
||||
|
||||
FileSystem::Instance().Collect(filename);
|
||||
if (llvm::Error e = m_java->LoadModule(filename)) {
|
||||
error.SetErrorStringWithFormatv("java failed to import '{0}': {1}\n",
|
||||
filename, llvm::toString(std::move(e)));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScriptInterpreterJava::Initialize() {
|
||||
static llvm::once_flag g_once_flag;
|
||||
|
||||
llvm::call_once(g_once_flag, []() {
|
||||
PluginManager::RegisterPlugin(GetPluginNameStatic(),
|
||||
GetPluginDescriptionStatic(),
|
||||
lldb::eScriptLanguageJava, CreateInstance);
|
||||
});
|
||||
}
|
||||
|
||||
void ScriptInterpreterJava::Terminate() {}
|
||||
|
||||
llvm::Error ScriptInterpreterJava::EnterSession(user_id_t debugger_id) {
|
||||
if (m_session_is_active)
|
||||
return llvm::Error::success();
|
||||
|
||||
const char *fmt_str =
|
||||
"lldb.debugger = lldb.SBDebugger.FindDebuggerWithID({0}); "
|
||||
"lldb.target = lldb.debugger:GetSelectedTarget(); "
|
||||
"lldb.process = lldb.target:GetProcess(); "
|
||||
"lldb.thread = lldb.process:GetSelectedThread(); "
|
||||
"lldb.frame = lldb.thread:GetSelectedFrame()";
|
||||
return m_java->Run(llvm::formatv(fmt_str, debugger_id).str());
|
||||
}
|
||||
|
||||
llvm::Error ScriptInterpreterJava::LeaveSession() {
|
||||
if (!m_session_is_active)
|
||||
return llvm::Error::success();
|
||||
|
||||
m_session_is_active = false;
|
||||
|
||||
llvm::StringRef str = "lldb.debugger = nil; "
|
||||
"lldb.target = nil; "
|
||||
"lldb.process = nil; "
|
||||
"lldb.thread = nil; "
|
||||
"lldb.frame = nil";
|
||||
return m_java->Run(str);
|
||||
}
|
||||
|
||||
bool ScriptInterpreterJava::BreakpointCallbackFunction(
|
||||
void *baton, StoppointCallbackContext *context, user_id_t break_id,
|
||||
user_id_t break_loc_id) {
|
||||
assert(context);
|
||||
|
||||
ExecutionContext exe_ctx(context->exe_ctx_ref);
|
||||
Target *target = exe_ctx.GetTargetPtr();
|
||||
if (target == nullptr)
|
||||
return true;
|
||||
|
||||
StackFrameSP stop_frame_sp(exe_ctx.GetFrameSP());
|
||||
BreakpointSP breakpoint_sp = target->GetBreakpointByID(break_id);
|
||||
BreakpointLocationSP bp_loc_sp(breakpoint_sp->FindLocationByID(break_loc_id));
|
||||
|
||||
Debugger &debugger = target->GetDebugger();
|
||||
ScriptInterpreterJava *java_interpreter = static_cast<ScriptInterpreterJava *>(
|
||||
debugger.GetScriptInterpreter(true, eScriptLanguageJava));
|
||||
Java &java = java_interpreter->GetJava();
|
||||
|
||||
llvm::Expected<bool> BoolOrErr =
|
||||
java.CallBreakpointCallback(baton, stop_frame_sp, bp_loc_sp);
|
||||
if (llvm::Error E = BoolOrErr.takeError()) {
|
||||
debugger.GetErrorStream() << toString(std::move(E));
|
||||
return true;
|
||||
}
|
||||
|
||||
return *BoolOrErr;
|
||||
}
|
||||
|
||||
Status ScriptInterpreterJava::SetBreakpointCommandCallback(
|
||||
BreakpointOptions *bp_options, const char *command_body_text) {
|
||||
Status error;
|
||||
auto data_up = std::make_unique<CommandDataJava>();
|
||||
error = m_java->RegisterBreakpointCallback(data_up.get(), command_body_text);
|
||||
if (error.Fail())
|
||||
return error;
|
||||
auto baton_sp =
|
||||
std::make_shared<BreakpointOptions::CommandBaton>(std::move(data_up));
|
||||
bp_options->SetCallback(ScriptInterpreterJava::BreakpointCallbackFunction,
|
||||
baton_sp);
|
||||
return error;
|
||||
}
|
||||
|
||||
lldb::ScriptInterpreterSP
|
||||
ScriptInterpreterJava::CreateInstance(Debugger &debugger) {
|
||||
return std::make_shared<ScriptInterpreterJava>(debugger);
|
||||
}
|
||||
|
||||
lldb_private::ConstString ScriptInterpreterJava::GetPluginNameStatic() {
|
||||
static ConstString g_name("script-java");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *ScriptInterpreterJava::GetPluginDescriptionStatic() {
|
||||
return "Java script interpreter";
|
||||
}
|
||||
|
||||
lldb_private::ConstString ScriptInterpreterJava::GetPluginName() {
|
||||
return GetPluginNameStatic();
|
||||
}
|
||||
|
||||
uint32_t ScriptInterpreterJava::GetPluginVersion() { return 1; }
|
||||
|
||||
Java &ScriptInterpreterJava::GetJava() { return *m_java; }
|
|
@ -1,81 +0,0 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
//===-- ScriptInterpreterJava.h ----------------------------------*- C++ -*-===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef liblldb_ScriptInterpreterJava_h_
|
||||
#define liblldb_ScriptInterpreterJava_h_
|
||||
|
||||
#include "lldb/Interpreter/ScriptInterpreter.h"
|
||||
#include "lldb/Utility/Status.h"
|
||||
#include "lldb/lldb-enumerations.h"
|
||||
|
||||
namespace lldb_private {
|
||||
class Java;
|
||||
class ScriptInterpreterJava : public ScriptInterpreter {
|
||||
public:
|
||||
class CommandDataJava : public BreakpointOptions::CommandData {
|
||||
public:
|
||||
CommandDataJava() : BreakpointOptions::CommandData() {
|
||||
interpreter = lldb::eScriptLanguageJava;
|
||||
}
|
||||
};
|
||||
|
||||
ScriptInterpreterJava(Debugger &debugger);
|
||||
|
||||
~ScriptInterpreterJava() override;
|
||||
|
||||
bool ExecuteOneLine(
|
||||
llvm::StringRef command, CommandReturnObject *result,
|
||||
const ExecuteScriptOptions &options = ExecuteScriptOptions()) override;
|
||||
|
||||
void ExecuteInterpreterLoop() override;
|
||||
|
||||
bool LoadScriptingModule(const char *filename, bool init_session,
|
||||
lldb_private::Status &error,
|
||||
StructuredData::ObjectSP *module_sp = nullptr,
|
||||
FileSpec extra_search_dir = {}) override;
|
||||
|
||||
// Static Functions
|
||||
static void Initialize();
|
||||
|
||||
static void Terminate();
|
||||
|
||||
static lldb::ScriptInterpreterSP CreateInstance(Debugger &debugger);
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
|
||||
static bool BreakpointCallbackFunction(void *baton,
|
||||
StoppointCallbackContext *context,
|
||||
lldb::user_id_t break_id,
|
||||
lldb::user_id_t break_loc_id);
|
||||
|
||||
// PluginInterface protocol
|
||||
lldb_private::ConstString GetPluginName() override;
|
||||
|
||||
uint32_t GetPluginVersion() override;
|
||||
|
||||
Java &GetJava();
|
||||
|
||||
llvm::Error EnterSession(lldb::user_id_t debugger_id);
|
||||
llvm::Error LeaveSession();
|
||||
|
||||
Status SetBreakpointCommandCallback(BreakpointOptions *bp_options,
|
||||
const char *command_body_text) override;
|
||||
|
||||
private:
|
||||
std::unique_ptr<Java> m_java;
|
||||
bool m_session_is_active = false;
|
||||
};
|
||||
|
||||
} // namespace lldb_private
|
||||
|
||||
#endif // liblldb_ScriptInterpreterJava_h_
|
|
@ -1,348 +0,0 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
include(CheckCXXCompilerFlag)
|
||||
include(CheckLibraryExists)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR}/..)
|
||||
include_directories(${LLDB_SOURCE_DIR}/source)
|
||||
include_directories(MacOSX/DarwinLog)
|
||||
|
||||
include_directories(MacOSX)
|
||||
|
||||
function(check_certificate identity result_valid)
|
||||
execute_process(
|
||||
COMMAND security find-certificate -Z -p -c ${identity} /Library/Keychains/System.keychain
|
||||
RESULT_VARIABLE exit_code OUTPUT_QUIET ERROR_QUIET)
|
||||
if(exit_code)
|
||||
set(${result_valid} FALSE PARENT_SCOPE)
|
||||
else()
|
||||
set(${result_valid} TRUE PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(get_debugserver_codesign_identity result)
|
||||
string(CONCAT not_found_help
|
||||
"This will cause failures in the test suite."
|
||||
"Pass '-DLLDB_USE_SYSTEM_DEBUGSERVER=ON' to use the system one instead."
|
||||
"See 'Code Signing on macOS' in the documentation."
|
||||
)
|
||||
|
||||
# Explicit override: warn if unavailable
|
||||
if(LLDB_CODESIGN_IDENTITY)
|
||||
set(${result} ${LLDB_CODESIGN_IDENTITY} PARENT_SCOPE)
|
||||
check_certificate(${LLDB_CODESIGN_IDENTITY} available)
|
||||
if(NOT available)
|
||||
message(WARNING "LLDB_CODESIGN_IDENTITY not found: '${LLDB_CODESIGN_IDENTITY}' ${not_found_help}")
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Development signing identity: use if available
|
||||
check_certificate(gdbcert available)
|
||||
if(available)
|
||||
set(${result} gdbcert PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
message(WARNING "Development code sign identity not found: 'gdbcert' ${not_found_help}")
|
||||
|
||||
# LLVM pendant: fallback if available
|
||||
if(LLVM_CODESIGNING_IDENTITY)
|
||||
check_certificate(${LLVM_CODESIGNING_IDENTITY} available)
|
||||
if(available)
|
||||
set(${result} ${LLVM_CODESIGNING_IDENTITY} PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Ad-hoc signing: last resort
|
||||
set(${result} "-" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# debugserver does not depend on intrinsics_gen, or on llvm. Set the common
|
||||
# llvm dependencies in the current scope to the empty set.
|
||||
set(LLVM_COMMON_DEPENDS)
|
||||
|
||||
set(DEBUGSERVER_RESOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../resources")
|
||||
set(DEBUGSERVER_INFO_PLIST "${DEBUGSERVER_RESOURCE_DIR}/lldb-debugserver-Info.plist")
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -Wl,-sectcreate,__TEXT,__info_plist,${DEBUGSERVER_INFO_PLIST}")
|
||||
|
||||
check_cxx_compiler_flag("-Wno-gnu-zero-variadic-macro-arguments"
|
||||
CXX_SUPPORTS_NO_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS)
|
||||
if (CXX_SUPPORTS_NO_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-zero-variadic-macro-arguments")
|
||||
endif ()
|
||||
|
||||
check_cxx_compiler_flag("-Wno-zero-length-array"
|
||||
CXX_SUPPORTS_NO_ZERO_LENGTH_ARRAY)
|
||||
if (CXX_SUPPORTS_NO_ZERO_LENGTH_ARRAY)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-zero-length-array")
|
||||
endif ()
|
||||
|
||||
check_cxx_compiler_flag("-Wno-extended-offsetof"
|
||||
CXX_SUPPORTS_NO_EXTENDED_OFFSETOF)
|
||||
if (CXX_SUPPORTS_NO_EXTENDED_OFFSETOF)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-extended-offsetof")
|
||||
endif ()
|
||||
|
||||
# When compiling for arm, build debugserver 2 way fat with an arm64 and arm64e
|
||||
# slice. You can only debug arm64e processes using an arm64e debugserver.
|
||||
include(CheckCSourceCompiles)
|
||||
check_c_source_compiles(
|
||||
"
|
||||
#include <TargetConditionals.h>
|
||||
#if TARGET_CPU_ARM
|
||||
#if TARGET_OS_OSX
|
||||
#warning Building for macOS
|
||||
#else
|
||||
#error Not building for macOS
|
||||
#endif
|
||||
#else
|
||||
#error Not building for ARM
|
||||
#endif
|
||||
int main() { return 0; }
|
||||
"
|
||||
BUILDING_FOR_ARM_OSX
|
||||
)
|
||||
|
||||
if (BUILDING_FOR_ARM_OSX)
|
||||
set(CMAKE_OSX_ARCHITECTURES "arm64;arm64e")
|
||||
endif ()
|
||||
|
||||
check_library_exists(compression compression_encode_buffer "" HAVE_LIBCOMPRESSION)
|
||||
|
||||
find_library(SECURITY_LIBRARY Security)
|
||||
|
||||
add_subdirectory(MacOSX)
|
||||
|
||||
set(LLDB_CODESIGN_IDENTITY "" CACHE STRING
|
||||
"Identity override for debugserver; see 'Code Signing on macOS' in the documentation (Darwin only)")
|
||||
|
||||
get_debugserver_codesign_identity(debugserver_codesign_identity)
|
||||
|
||||
# Override locally, so the identity is used for targets created in this scope.
|
||||
set(LLVM_CODESIGNING_IDENTITY ${debugserver_codesign_identity})
|
||||
|
||||
# Use the same identity later in the test suite.
|
||||
set_property(GLOBAL PROPERTY
|
||||
LLDB_DEBUGSERVER_CODESIGN_IDENTITY ${debugserver_codesign_identity})
|
||||
|
||||
if(APPLE)
|
||||
if(APPLE_EMBEDDED)
|
||||
find_library(BACKBOARD_LIBRARY BackBoardServices
|
||||
PATHS ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks)
|
||||
find_library(FRONTBOARD_LIBRARY FrontBoardServices
|
||||
PATHS ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks)
|
||||
find_library(SPRINGBOARD_LIBRARY SpringBoardServices
|
||||
PATHS ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks)
|
||||
find_library(MOBILESERVICES_LIBRARY MobileCoreServices
|
||||
PATHS ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks)
|
||||
find_library(LOCKDOWN_LIBRARY lockdown)
|
||||
if (APPLE_EMBEDDED STREQUAL "watchos")
|
||||
find_library(CAROUSELSERVICES_LIBRARY CarouselServices
|
||||
PATHS ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks)
|
||||
endif()
|
||||
|
||||
if(NOT BACKBOARD_LIBRARY)
|
||||
set(SKIP_TEST_DEBUGSERVER ON CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(HAVE_LIBCOMPRESSION)
|
||||
set(LIBCOMPRESSION compression)
|
||||
endif()
|
||||
|
||||
if(LLDB_USE_ENTITLEMENTS)
|
||||
if(APPLE_EMBEDDED)
|
||||
set(entitlements ${DEBUGSERVER_RESOURCE_DIR}/debugserver-entitlements.plist)
|
||||
else()
|
||||
if (LLDB_USE_PRIVATE_ENTITLEMENTS)
|
||||
set(entitlements ${DEBUGSERVER_RESOURCE_DIR}/debugserver-macosx-private-entitlements.plist)
|
||||
else()
|
||||
set(entitlements ${DEBUGSERVER_RESOURCE_DIR}/debugserver-macosx-entitlements.plist)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_definitions(-DLLDB_USE_OS_LOG)
|
||||
|
||||
if(${CMAKE_OSX_SYSROOT} MATCHES ".Internal.sdk$")
|
||||
message(STATUS "LLDB debugserver energy support is enabled")
|
||||
add_definitions(-DLLDB_ENERGY)
|
||||
set(ENERGY_LIBRARY -lpmenergy -lpmsample)
|
||||
else()
|
||||
message(STATUS "LLDB debugserver energy support is disabled")
|
||||
endif()
|
||||
|
||||
set(generated_mach_interfaces
|
||||
${CMAKE_CURRENT_BINARY_DIR}/mach_exc.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/mach_excServer.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/mach_excUser.c
|
||||
)
|
||||
|
||||
set(MIG_ARCH_FLAGS "")
|
||||
if (DEFINED MIG_ARCHS)
|
||||
foreach(ARCH ${MIG_ARCHS})
|
||||
set(MIG_ARCH_FLAGS "${MIG_ARCH_FLAGS} -arch ${ARCH}")
|
||||
endforeach()
|
||||
endif()
|
||||
separate_arguments(MIG_ARCH_FLAGS_SEPARTED NATIVE_COMMAND "${MIG_ARCH_FLAGS}")
|
||||
|
||||
add_custom_command(OUTPUT ${generated_mach_interfaces}
|
||||
VERBATIM COMMAND mig ${MIG_ARCH_FLAGS_SEPARTED} -isysroot ${CMAKE_OSX_SYSROOT} ${CMAKE_CURRENT_SOURCE_DIR}/MacOSX/dbgnub-mig.defs
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/MacOSX/dbgnub-mig.defs
|
||||
)
|
||||
|
||||
set(DEBUGSERVER_VERS_GENERATED_FILE ${CMAKE_CURRENT_BINARY_DIR}/debugserver_vers.c)
|
||||
configure_file(debugserver_vers.c.in
|
||||
${DEBUGSERVER_VERS_GENERATED_FILE} @ONLY)
|
||||
|
||||
set(lldbDebugserverCommonSources
|
||||
DNBArch.cpp
|
||||
DNBBreakpoint.cpp
|
||||
DNB.cpp
|
||||
DNBDataRef.cpp
|
||||
DNBError.cpp
|
||||
DNBLog.cpp
|
||||
DNBRegisterInfo.cpp
|
||||
DNBThreadResumeActions.cpp
|
||||
JSON.cpp
|
||||
StdStringExtractor.cpp
|
||||
# JSON reader depends on the following LLDB-common files
|
||||
${LLDB_SOURCE_DIR}/source/Host/common/StringConvert.cpp
|
||||
${LLDB_SOURCE_DIR}/source/Host/common/SocketAddress.cpp
|
||||
# end JSON reader dependencies
|
||||
libdebugserver.cpp
|
||||
PseudoTerminal.cpp
|
||||
PThreadEvent.cpp
|
||||
PThreadMutex.cpp
|
||||
RNBContext.cpp
|
||||
RNBRemote.cpp
|
||||
RNBServices.cpp
|
||||
RNBSocket.cpp
|
||||
SysSignal.cpp
|
||||
TTYState.cpp
|
||||
|
||||
MacOSX/CFBundle.cpp
|
||||
MacOSX/CFString.cpp
|
||||
MacOSX/Genealogy.cpp
|
||||
MacOSX/MachException.cpp
|
||||
MacOSX/MachProcess.mm
|
||||
MacOSX/MachTask.mm
|
||||
MacOSX/MachThread.cpp
|
||||
MacOSX/MachThreadList.cpp
|
||||
MacOSX/MachVMMemory.cpp
|
||||
MacOSX/MachVMRegion.cpp
|
||||
MacOSX/OsLogger.cpp
|
||||
${generated_mach_interfaces}
|
||||
${DEBUGSERVER_VERS_GENERATED_FILE})
|
||||
|
||||
# Tell LLVM not to complain about these source files.
|
||||
set(LLVM_OPTIONAL_SOURCES
|
||||
${lldbDebugserverCommonSources}
|
||||
debugserver.cpp)
|
||||
|
||||
add_lldb_library(lldbDebugserverCommon ${lldbDebugserverCommonSources})
|
||||
set_target_properties(lldbDebugserverCommon PROPERTIES FOLDER "lldb libraries/debugserver")
|
||||
|
||||
target_link_libraries(lldbDebugserverCommon
|
||||
INTERFACE ${COCOA_LIBRARY}
|
||||
${CORE_FOUNDATION_LIBRARY}
|
||||
${FOUNDATION_LIBRARY}
|
||||
${BACKBOARD_LIBRARY}
|
||||
${FRONTBOARD_LIBRARY}
|
||||
${SPRINGBOARD_LIBRARY}
|
||||
${MOBILESERVICES_LIBRARY}
|
||||
${LOCKDOWN_LIBRARY}
|
||||
${CAROUSELSERVICES_LIBRARY}
|
||||
lldbDebugserverArchSupport
|
||||
lldbDebugserverDarwin_DarwinLog
|
||||
${FOUNDATION_LIBRARY}
|
||||
${SECURITY_LIBRARY}
|
||||
${LIBCOMPRESSION}
|
||||
${ENERGY_LIBRARY})
|
||||
if(HAVE_LIBCOMPRESSION)
|
||||
set_property(TARGET lldbDebugserverCommon APPEND PROPERTY
|
||||
COMPILE_DEFINITIONS HAVE_LIBCOMPRESSION)
|
||||
endif()
|
||||
add_lldb_tool(debugserver ADD_TO_FRAMEWORK
|
||||
debugserver.cpp
|
||||
LINK_LIBS lldbDebugserverCommon
|
||||
ENTITLEMENTS ${entitlements}
|
||||
)
|
||||
|
||||
# Workaround for Xcode-specific code-signing behavior:
|
||||
# The XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY option causes debugserver to be copied
|
||||
# into the framework first and code-signed afterwards. Sign the copy manually.
|
||||
if (debugserver_codesign_identity AND LLDB_BUILD_FRAMEWORK AND
|
||||
CMAKE_GENERATOR STREQUAL "Xcode")
|
||||
if(NOT CMAKE_CODESIGN_ALLOCATE)
|
||||
execute_process(
|
||||
COMMAND xcrun -f codesign_allocate
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE CMAKE_CODESIGN_ALLOCATE
|
||||
)
|
||||
endif()
|
||||
if(entitlements)
|
||||
set(pass_entitlements --entitlements ${entitlements})
|
||||
endif()
|
||||
|
||||
set(copy_location ${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/Versions/${LLDB_FRAMEWORK_VERSION}/Resources/debugserver)
|
||||
|
||||
add_custom_command(TARGET debugserver POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E
|
||||
env CODESIGN_ALLOCATE=${CMAKE_CODESIGN_ALLOCATE}
|
||||
xcrun codesign -f -s ${debugserver_codesign_identity}
|
||||
${pass_entitlements} ${copy_location}
|
||||
COMMENT "Code-sign debugserver copy in the build-tree framework: ${copy_location}"
|
||||
)
|
||||
endif()
|
||||
|
||||
set_target_properties(debugserver PROPERTIES FOLDER "lldb libraries/debugserver")
|
||||
|
||||
if(APPLE_EMBEDDED)
|
||||
set_property(TARGET lldbDebugserverCommon APPEND PROPERTY COMPILE_DEFINITIONS
|
||||
WITH_LOCKDOWN
|
||||
WITH_FBS
|
||||
WITH_BKS
|
||||
)
|
||||
if(CAROUSELSERVICES_LIBRARY)
|
||||
set_property(TARGET lldbDebugserverCommon APPEND PROPERTY COMPILE_DEFINITIONS
|
||||
WITH_CAROUSEL
|
||||
)
|
||||
endif()
|
||||
set_property(TARGET debugserver APPEND PROPERTY COMPILE_DEFINITIONS
|
||||
WITH_LOCKDOWN
|
||||
WITH_FBS
|
||||
WITH_BKS
|
||||
)
|
||||
set_property(TARGET lldbDebugserverCommon APPEND PROPERTY COMPILE_FLAGS
|
||||
-F${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks
|
||||
)
|
||||
|
||||
add_lldb_library(lldbDebugserverCommon_NonUI ${lldbDebugserverCommonSources})
|
||||
target_link_libraries(lldbDebugserverCommon_NonUI
|
||||
INTERFACE ${COCOA_LIBRARY}
|
||||
${CORE_FOUNDATION_LIBRARY}
|
||||
${FOUNDATION_LIBRARY}
|
||||
lldbDebugserverArchSupport
|
||||
lldbDebugserverDarwin_DarwinLog
|
||||
${SECURITY_LIBRARY}
|
||||
${LIBCOMPRESSION})
|
||||
if(HAVE_LIBCOMPRESSION)
|
||||
set_property(TARGET lldbDebugserverCommon_NonUI APPEND PROPERTY
|
||||
COMPILE_DEFINITIONS HAVE_LIBCOMPRESSION)
|
||||
endif()
|
||||
|
||||
add_lldb_tool(debugserver-nonui
|
||||
debugserver.cpp
|
||||
|
||||
LINK_LIBS
|
||||
lldbDebugserverCommon_NonUI
|
||||
|
||||
ENTITLEMENTS
|
||||
${entitlements}
|
||||
)
|
||||
endif()
|
|
@ -1,92 +0,0 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
public class SBTraceOptions {
|
||||
private transient long swigCPtr;
|
||||
protected transient boolean swigCMemOwn;
|
||||
|
||||
protected SBTraceOptions(long cPtr, boolean cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = cPtr;
|
||||
}
|
||||
|
||||
protected static long getCPtr(SBTraceOptions obj) {
|
||||
return (obj == null) ? 0 : obj.swigCPtr;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
protected void finalize() {
|
||||
delete();
|
||||
}
|
||||
|
||||
public synchronized void delete() {
|
||||
if (swigCPtr != 0) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
lldbJNI.delete_SBTraceOptions(swigCPtr);
|
||||
}
|
||||
swigCPtr = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public SBTraceOptions() {
|
||||
this(lldbJNI.new_SBTraceOptions(), true);
|
||||
}
|
||||
|
||||
public TraceType getType() {
|
||||
return TraceType.swigToEnum(lldbJNI.SBTraceOptions_getType(swigCPtr, this));
|
||||
}
|
||||
|
||||
public java.math.BigInteger getTraceBufferSize() {
|
||||
return lldbJNI.SBTraceOptions_getTraceBufferSize(swigCPtr, this);
|
||||
}
|
||||
|
||||
public SBStructuredData getTraceParams(SBError error) {
|
||||
return new SBStructuredData(lldbJNI.SBTraceOptions_getTraceParams(swigCPtr, this, SBError.getCPtr(error), error), true);
|
||||
}
|
||||
|
||||
public java.math.BigInteger getMetaDataBufferSize() {
|
||||
return lldbJNI.SBTraceOptions_getMetaDataBufferSize(swigCPtr, this);
|
||||
}
|
||||
|
||||
public void setTraceParams(SBStructuredData params) {
|
||||
lldbJNI.SBTraceOptions_setTraceParams(swigCPtr, this, SBStructuredData.getCPtr(params), params);
|
||||
}
|
||||
|
||||
public void setType(TraceType type) {
|
||||
lldbJNI.SBTraceOptions_setType(swigCPtr, this, type.swigValue());
|
||||
}
|
||||
|
||||
public void setTraceBufferSize(java.math.BigInteger size) {
|
||||
lldbJNI.SBTraceOptions_setTraceBufferSize(swigCPtr, this, size);
|
||||
}
|
||||
|
||||
public void setMetaDataBufferSize(java.math.BigInteger size) {
|
||||
lldbJNI.SBTraceOptions_setMetaDataBufferSize(swigCPtr, this, size);
|
||||
}
|
||||
|
||||
public void setThreadID(java.math.BigInteger thread_id) {
|
||||
lldbJNI.SBTraceOptions_setThreadID(swigCPtr, this, thread_id);
|
||||
}
|
||||
|
||||
public java.math.BigInteger getThreadID() {
|
||||
return lldbJNI.SBTraceOptions_getThreadID(swigCPtr, this);
|
||||
}
|
||||
|
||||
public boolean IsValid() {
|
||||
return lldbJNI.SBTraceOptions_IsValid(swigCPtr, this);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
public class SWIGTYPE_p_JNIEnv {
|
||||
private transient long swigCPtr;
|
||||
|
||||
protected SWIGTYPE_p_JNIEnv(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
|
||||
swigCPtr = cPtr;
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_JNIEnv() {
|
||||
swigCPtr = 0;
|
||||
}
|
||||
|
||||
protected static long getCPtr(SWIGTYPE_p_JNIEnv obj) {
|
||||
return (obj == null) ? 0 : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
public class SWIGTYPE_p_bool {
|
||||
private transient long swigCPtr;
|
||||
|
||||
protected SWIGTYPE_p_bool(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
|
||||
swigCPtr = cPtr;
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_bool() {
|
||||
swigCPtr = 0;
|
||||
}
|
||||
|
||||
protected static long getCPtr(SWIGTYPE_p_bool obj) {
|
||||
return (obj == null) ? 0 : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
public class SWIGTYPE_p_byte {
|
||||
private transient long swigCPtr;
|
||||
|
||||
protected SWIGTYPE_p_byte(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
|
||||
swigCPtr = cPtr;
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_byte() {
|
||||
swigCPtr = 0;
|
||||
}
|
||||
|
||||
protected static long getCPtr(SWIGTYPE_p_byte obj) {
|
||||
return (obj == null) ? 0 : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
public class SWIGTYPE_p_char {
|
||||
private transient long swigCPtr;
|
||||
|
||||
protected SWIGTYPE_p_char(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
|
||||
swigCPtr = cPtr;
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_char() {
|
||||
swigCPtr = 0;
|
||||
}
|
||||
|
||||
protected static long getCPtr(SWIGTYPE_p_char obj) {
|
||||
return (obj == null) ? 0 : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
public class SWIGTYPE_p_float {
|
||||
private transient long swigCPtr;
|
||||
|
||||
protected SWIGTYPE_p_float(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
|
||||
swigCPtr = cPtr;
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_float() {
|
||||
swigCPtr = 0;
|
||||
}
|
||||
|
||||
protected static long getCPtr(SWIGTYPE_p_float obj) {
|
||||
return (obj == null) ? 0 : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
public class SWIGTYPE_p_p_char {
|
||||
private transient long swigCPtr;
|
||||
|
||||
protected SWIGTYPE_p_p_char(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
|
||||
swigCPtr = cPtr;
|
||||
}
|
||||
|
||||
protected SWIGTYPE_p_p_char() {
|
||||
swigCPtr = 0;
|
||||
}
|
||||
|
||||
protected static long getCPtr(SWIGTYPE_p_p_char obj) {
|
||||
return (obj == null) ? 0 : obj.swigCPtr;
|
||||
}
|
||||
}
|
||||
|
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
package agent.lldb.lldb;
|
||||
|
||||
import java.io.File;
|
||||
import java.math.BigInteger;
|
||||
import java.util.*;
|
||||
|
||||
|
@ -22,8 +23,6 @@ import SWIG.*;
|
|||
import agent.lldb.manager.LldbEvent;
|
||||
import agent.lldb.manager.LldbManager;
|
||||
import agent.lldb.manager.evt.*;
|
||||
import ghidra.framework.OperatingSystem;
|
||||
import ghidra.framework.Platform;
|
||||
import ghidra.util.Msg;
|
||||
|
||||
public class DebugClientImpl implements DebugClient {
|
||||
|
@ -41,18 +40,6 @@ public class DebugClientImpl implements DebugClient {
|
|||
|
||||
@Override
|
||||
public DebugClient createClient() {
|
||||
try {
|
||||
if (Platform.CURRENT_PLATFORM.getOperatingSystem() == OperatingSystem.LINUX) {
|
||||
System.load("/usr/lib/liblldb.so");
|
||||
} else if (Platform.CURRENT_PLATFORM.getOperatingSystem() == OperatingSystem.MAC_OS_X) {
|
||||
System.load("/usr/lib/liblldb.dylib");
|
||||
} else if (Platform.CURRENT_PLATFORM.getOperatingSystem() == OperatingSystem.WINDOWS) {
|
||||
System.load("/usr/lib/liblldb.dll");
|
||||
}
|
||||
}
|
||||
catch (UnsatisfiedLinkError ex) {
|
||||
Msg.error(this, "LLDB libraries not found for "+Platform.CURRENT_PLATFORM.getOperatingSystem());
|
||||
}
|
||||
SBError error = SBDebugger.InitializeWithErrorHandling();
|
||||
if (!error.Success()) {
|
||||
SBStream stream = new SBStream();
|
||||
|
@ -171,7 +158,8 @@ public class DebugClientImpl implements DebugClient {
|
|||
public SBProcess createProcess(DebugServerId si, String fileName,
|
||||
List<String> args, List<String> envp, List<String> pathsIO,
|
||||
String workingDir, long createFlags, boolean stopAtEntry) {
|
||||
session = connectSession(fileName);
|
||||
File f = new File(fileName); //hack to avoid /C:/
|
||||
session = connectSession(f.getAbsolutePath());
|
||||
|
||||
String[] argArr = args.toArray(new String[args.size()]);
|
||||
// null for envp means use the default environment
|
||||
|
|
|
@ -41,13 +41,37 @@ import agent.lldb.model.iface1.*;
|
|||
import ghidra.async.*;
|
||||
import ghidra.dbg.target.TargetObject;
|
||||
import ghidra.dbg.util.HandlerMap;
|
||||
import ghidra.framework.OperatingSystem;
|
||||
import ghidra.framework.Platform;
|
||||
import ghidra.lifecycle.Internal;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.datastruct.ListenerSet;
|
||||
|
||||
public class LldbManagerImpl implements LldbManager {
|
||||
|
||||
private String LldbSrvTransport;
|
||||
static {
|
||||
String libPath = System.getProperty("java.library.path");
|
||||
try {
|
||||
String lldb = "lldb";
|
||||
if (Platform.CURRENT_PLATFORM.getOperatingSystem() == OperatingSystem.WINDOWS) {
|
||||
lldb = "lib" + lldb; // Wow, sigh
|
||||
}
|
||||
System.loadLibrary(lldb);
|
||||
}
|
||||
catch (UnsatisfiedLinkError ule) {
|
||||
Msg.error(LldbManagerImpl.class, "java.library.path => " + libPath);
|
||||
Msg.error(LldbManagerImpl.class,
|
||||
"liblldb not found - add relevant java.library.path to support/launch.properties");
|
||||
}
|
||||
try {
|
||||
System.loadLibrary("lldb-java");
|
||||
}
|
||||
catch (UnsatisfiedLinkError ule) {
|
||||
Msg.error(LldbManagerImpl.class, "java.library.path => " + libPath);
|
||||
Msg.error(LldbManagerImpl.class,
|
||||
"liblldb-java not found - add relevant java.library.path to support/launch.properties");
|
||||
}
|
||||
}
|
||||
|
||||
public DebugStatus status;
|
||||
|
||||
|
@ -119,6 +143,9 @@ public class LldbManagerImpl implements LldbManager {
|
|||
map = new HashMap<>();
|
||||
threads.put(DebugClient.getId(process), map);
|
||||
}
|
||||
if (thread == null) {
|
||||
return;
|
||||
}
|
||||
String id = DebugClient.getId(thread);
|
||||
SBThread pred = map.get(id);
|
||||
if (!map.containsKey(id) || !thread.equals(pred)) {
|
||||
|
@ -703,6 +730,9 @@ public class LldbManagerImpl implements LldbManager {
|
|||
addSessionIfAbsent(eventSession);
|
||||
addProcessIfAbsent(eventSession, eventProcess);
|
||||
addThreadIfAbsent(eventProcess, eventThread);
|
||||
//SBStream s = new SBStream();
|
||||
//event.GetDescription(s);
|
||||
//System.err.println(s.GetData());
|
||||
client.translateAndFireEvent(event);
|
||||
}
|
||||
|
||||
|
@ -1013,7 +1043,9 @@ public class LldbManagerImpl implements LldbManager {
|
|||
if (status.equals(DebugStatus.NO_DEBUGGEE)) {
|
||||
waiting = false;
|
||||
if (state.equals(StateType.eStateExited)) {
|
||||
processEvent(new LldbRunningEvent(DebugClient.getId(eventThread)));
|
||||
if (eventThread != null) {
|
||||
processEvent(new LldbRunningEvent(DebugClient.getId(eventThread)));
|
||||
}
|
||||
processEvent(new LldbProcessExitedEvent(0));
|
||||
processEvent(new LldbSessionExitedEvent(DebugClient.getId(currentSession), 0));
|
||||
}
|
||||
|
@ -1499,14 +1531,12 @@ public class LldbManagerImpl implements LldbManager {
|
|||
}
|
||||
|
||||
public SBThread getCurrentThread() {
|
||||
if (!currentThread.IsValid()) {
|
||||
if (currentThread != null && !currentThread.IsValid()) {
|
||||
currentProcess = currentSession.GetProcess();
|
||||
for (int i = 0; i < currentProcess.GetNumThreads(); i++) {
|
||||
SBThread thread = currentProcess.GetThreadAtIndex(i);
|
||||
System.err.println(thread + ":" + thread.IsValid());
|
||||
}
|
||||
currentThread = SBThread.GetThreadFromEvent(currentEvent);
|
||||
System.err.println(currentThread.IsValid());
|
||||
}
|
||||
return currentThread != null ? currentThread : eventThread;
|
||||
}
|
||||
|
|
|
@ -95,6 +95,11 @@ public class LldbModelTargetStackFrameRegisterImpl
|
|||
if (value == null) {
|
||||
return new byte[0];
|
||||
}
|
||||
if (value.startsWith("{")) {
|
||||
String trim = value.substring(1, value.length() - 1);
|
||||
String[] split = trim.split(" ");
|
||||
value = split[0].substring(2) + split[1].substring(2);
|
||||
}
|
||||
BigInteger val = new BigInteger(value, 16);
|
||||
byte[] bytes = ConversionUtils.bigIntegerToBytes((int) getRegister().GetByteSize(), val);
|
||||
changeAttributes(List.of(), Map.of( //
|
||||
|
|
|
@ -88,6 +88,9 @@ public class LldbModelTargetThreadContainerImpl extends LldbModelTargetObjectImp
|
|||
|
||||
@Override
|
||||
public void threadExited(SBThread thread) {
|
||||
if (thread == null) {
|
||||
return;
|
||||
}
|
||||
String threadId = LldbModelTargetThreadImpl.indexThread(thread);
|
||||
LldbModelTargetThread targetThread = (LldbModelTargetThread) getMapObject(thread);
|
||||
if (targetThread != null) {
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
To use the LLDB agent in Ghidra, you will need to build the JNI interface to the LLDB Scripting Bridge.
|
||||
|
||||
To do this:
|
||||
(1) check the version for your copy of lldb:
|
||||
lldb --version
|
||||
|
||||
If you have a version other than the most current (release/13.x), you will need to either
|
||||
install v13 or generate the JNI interface for the version you have.
|
||||
|
||||
(2a) To install LLVM/lldb version 13:
|
||||
- git clone https://github.com/llvm/llvm-project.git
|
||||
- git checkout release/13.x
|
||||
- cd llvm-project
|
||||
- mkdir build && cd build
|
||||
- cmake -G Ninja -DLLVM_ENABLE_PROJECTS="clang;libcxx;lldb" -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_LINKER=gold ../llvm
|
||||
- ninja lldb
|
||||
- ninja lldb-server
|
||||
- ninja install
|
||||
|
||||
(2b) To generate the JNI for your version
|
||||
- git clone https://github.com/llvm/llvm-project.git
|
||||
- git checkout release/YOUR_VERSION.x
|
||||
- export LLVM_HOME=/path_to_llvm-project
|
||||
|
||||
- cd Ghidra/Debug/Debugger-swig-lldb
|
||||
- gradle generateSwig
|
||||
- cp -r build/generated/src/main src
|
||||
|
||||
If you have the most current version or have completed step (2), you can:
|
||||
|
||||
(3) Compile the JNI interface by:
|
||||
- export JAVA_HOME=/path_to_java
|
||||
- export LLVM_HOME=/path_to_llvm-project
|
||||
- export LLVM_BUILD=/path_to_llvm_build_directory_or_whatever_contains_lib/liblldb.(so/dylib/dll)
|
||||
(for Windows, these vars should have the drive: prefix and probably not have spaces)
|
||||
- cd Ghidra/Debug/Debugger-swig-lldb
|
||||
- gradle build
|
||||
|
||||
(4) To run:
|
||||
- add -Djava.library.path=/path_to/liblldb:/path_to/liblldb-java:etc in support/launch.properties or,
|
||||
if you're running out of Eclipse, to the arguments in the Run/Debug Configuration
|
||||
|
||||
TROUBLESHOOTING:
|
||||
(1) If you are trying to execute "gradle buildGhidra" with LLVM_HOME already set, you are likely
|
||||
to run into difficulties. Unset LLVM_HOME (or on Windows set LLVM_HOME=) before running.
|
||||
(2) If you are running "gradle generateSwig" and encounter errors, make sure LLVM_HOME is set.
|
||||
(3) If you are running "gradle buildNatives" and it succeeds but there is no library in Ghidra/
|
||||
Debug/Debugger-swig/lldb/build/os, again check LLVM_HOME, LLVM_BUILD, and JAVA_HOME. Keep
|
||||
in mind that different generators for LLVM, esp. for Window, may put liblldb.xxx in unusual
|
||||
places. Check "build/lib", "build/bin", and subdirs like "build/Release/bin".
|
||||
(4) If you get an "Unsatisfied Link Error" when you start the debugger, make sure both liblldb
|
||||
and liblldb-java are in the path described by java.library.path.
|
||||
(5) Link errors can also be caused by different architectures or platforms for the libraries.
|
||||
|
||||
|
||||
|
1
Ghidra/Debug/Debugger-swig-lldb/Module.manifest
Normal file
1
Ghidra/Debug/Debugger-swig-lldb/Module.manifest
Normal file
|
@ -0,0 +1 @@
|
|||
MODULE FILE LICENSE: src/llvm-project Apache License 2.0 with LLVM Exceptions
|
51
Ghidra/Debug/Debugger-swig-lldb/build.gradle
Normal file
51
Ghidra/Debug/Debugger-swig-lldb/build.gradle
Normal file
|
@ -0,0 +1,51 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
apply from: "$rootProject.projectDir/gradle/javaProject.gradle"
|
||||
apply from: "$rootProject.projectDir/gradle/jacocoProject.gradle"
|
||||
apply from: "$rootProject.projectDir/gradle/javaTestProject.gradle"
|
||||
apply from: "$rootProject.projectDir/gradle/nativeProject.gradle"
|
||||
apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle"
|
||||
apply from: "buildNatives.gradle"
|
||||
|
||||
apply plugin: 'eclipse'
|
||||
eclipse.project.name = 'Debug Debugger-swig-lldb'
|
||||
|
||||
dependencies {
|
||||
api project(':Framework-AsyncComm')
|
||||
api project(':Framework-Debugging')
|
||||
api project(':Debugger-gadp')
|
||||
|
||||
testImplementation project(path: ':Framework-AsyncComm', configuration: 'testArtifacts')
|
||||
testImplementation project(path: ':Framework-Debugging', configuration: 'testArtifacts')
|
||||
testImplementation project(path: ':Debugger-gadp', configuration: 'testArtifacts')
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java {
|
||||
srcDir tasks.generateSwig.outdir_java
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Include buildable native source in distribution
|
||||
rootProject.assembleDistribution {
|
||||
from (this.project.projectDir.toString()) {
|
||||
include "src/**"
|
||||
include "*.txt"
|
||||
into { getZipPath(this.project) }
|
||||
}
|
||||
}
|
145
Ghidra/Debug/Debugger-swig-lldb/buildNatives.gradle
Normal file
145
Ghidra/Debug/Debugger-swig-lldb/buildNatives.gradle
Normal file
|
@ -0,0 +1,145 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
def llvmRequired = false; // tasks will be skipped if LLVM_HOME not defined in env
|
||||
|
||||
// Native build files are already applied in development mode (indicated by presence of the
|
||||
// Generic project). Only need to apply them if we are in a distribution.
|
||||
if (findProject(':Generic') == null) {
|
||||
// running from within Ghidra install
|
||||
apply from: "../../../GPL/utils.gradle"
|
||||
apply from: "../../../GPL/nativePlatforms.gradle"
|
||||
apply from: "../../../GPL/nativeBuildProperties.gradle"
|
||||
llvmRequired = true;
|
||||
}
|
||||
|
||||
task generateSwig {
|
||||
ext.srcdir = file("src/llvm-project/lldb/bindings/java")
|
||||
ext.outdir_java = file("build/generated/src/main/java")
|
||||
ext.outdir_cpp = file("build/generated/src/main/cpp")
|
||||
ext.llvm_dir = System.env.LLVM_HOME;
|
||||
outputs.dir(outdir_java)
|
||||
outputs.dir(outdir_cpp)
|
||||
doLast {
|
||||
if (System.env.LLVM_HOME) {
|
||||
println "Debugger-swig-lldb: using LLVM_HOME=" + System.env.LLVM_HOME
|
||||
new File(ext.outdir_java, "/SWIG").mkdirs()
|
||||
def exe = "swig"
|
||||
exec {
|
||||
commandLine exe, "-c++", "-features", "autodoc", "-D__STDC_LIMIT_MACROS", "-D__STDC_CONSTANT_MACROS",
|
||||
"-I$llvm_dir/lldb/include", "-I$llvm_dir/lldb/bindings", "-java", "-package", "SWIG", "-c++",
|
||||
"-outdir", "$outdir_java/SWIG", "-o", "$outdir_cpp/LLDBWrapJava.cpp"
|
||||
args "$srcdir/java.swig"
|
||||
}
|
||||
} else if (llvmRequired) {
|
||||
throw new GradleException("Debugger-swig-lldb:generateSwig requires LLVM_HOME to be defined")
|
||||
} else {
|
||||
println "Debugger-swig-lldb:generateSwig skipped - LLVM_HOME not defined"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "native build model" for building the SWIG executables.
|
||||
*/
|
||||
if (System.env.LLVM_HOME) {
|
||||
model {
|
||||
components {
|
||||
main(NativeLibrarySpec) {
|
||||
baseName "lldb-java"
|
||||
targetPlatform "win_x86_64"
|
||||
targetPlatform "linux_x86_64"
|
||||
targetPlatform "linux_arm_64"
|
||||
targetPlatform "mac_x86_64"
|
||||
targetPlatform "mac_arm_64"
|
||||
}
|
||||
}
|
||||
|
||||
binaries {
|
||||
ext.llvm_dir = System.env.LLVM_HOME;
|
||||
ext.llvm_build_dir = System.env.LLVM_BUILD;
|
||||
if (System.env.JAVA_HOME) {
|
||||
// Allow Gradle's default JAVA_HOME to be overridden by an environment variable we set
|
||||
project.ext.JAVA_HOME = System.env.JAVA_HOME;
|
||||
}
|
||||
else {
|
||||
project.ext.JAVA_HOME = "${System.properties.'java.home'}"
|
||||
}
|
||||
all{ b ->
|
||||
if (b.targetPlatform.operatingSystem.linux) {
|
||||
b.cppCompiler.args "-I${JAVA_HOME}/include/linux"
|
||||
} else if (b.targetPlatform.operatingSystem.windows) {
|
||||
b.cppCompiler.args "-I${JAVA_HOME}/include/win32"
|
||||
} else {
|
||||
b.cppCompiler.args "-I${JAVA_HOME}/include/darwin"
|
||||
}
|
||||
if (b.toolChain in Gcc) {
|
||||
b.cppCompiler.args "-I$llvm_dir/lldb/include"
|
||||
b.cppCompiler.args "-I${JAVA_HOME}/include"
|
||||
b.linker.args "-L$llvm_build_dir/lib"
|
||||
b.linker.args "-llldb"
|
||||
b.cppCompiler.args "-std=c++14"
|
||||
b.cppCompiler.args "-O3"
|
||||
// b.cppCompiler.args "-g" // for DEBUG, uncomment this line
|
||||
}
|
||||
else if (b.toolChain in Clang) {
|
||||
b.cppCompiler.args "-I$llvm_dir/lldb/include"
|
||||
b.cppCompiler.args "-I${JAVA_HOME}/include"
|
||||
b.linker.args "-L$llvm_build_dir/lib"
|
||||
b.linker.args "-llldb"
|
||||
b.cppCompiler.args "-std=c++14"
|
||||
b.cppCompiler.args "-O3"
|
||||
// b.cppCompiler.args "-g" // for DEBUG, uncomment this line
|
||||
}
|
||||
else if (b.toolChain in VisualCpp) {
|
||||
b.cppCompiler.args "/I$llvm_dir/lldb/include"
|
||||
b.cppCompiler.args "-I${JAVA_HOME}/include"
|
||||
b.linker.args "/LIBPATH:$llvm_build_dir/lib"
|
||||
b.linker.args "liblldb.lib"
|
||||
// b.cppCompiler.args "/Zi" // for DEBUG, uncomment this line
|
||||
// b.cppCompiler.args "/FS" // for DEBUG, uncomment this line
|
||||
// b.linker.args "/DEBUG" // for DEBUG, uncomment this line
|
||||
if (b.targetPlatform.operatingSystem.windows) {
|
||||
b.cppCompiler.define "WINDOWS"
|
||||
b.cppCompiler.define "_WINDOWS"
|
||||
b.cppCompiler.define "WIN32"
|
||||
b.cppCompiler.define "_WIN32"
|
||||
if (b.targetPlatform.name == "win_x86_64") {
|
||||
b.cppCompiler.define "WIN64"
|
||||
b.cppCompiler.define "_WIN64"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
println "Debugger-swig-lldb:buildNatives skipped - LLVM_HOME not defined"
|
||||
}
|
||||
|
||||
task checkLLVM {
|
||||
doFirst {
|
||||
if (System.env.LLVM_HOME) {
|
||||
println "Debugger-swig-lldb: using LLVM_HOME=" + System.env.LLVM_HOME
|
||||
}
|
||||
else if (llvmRequired) {
|
||||
throw new GradleException("Debugger-swig-lldb:build requires LLVM_HOME to be defined")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Module build within Ghidra install requires LLVM_HOME
|
||||
tasks.build.dependsOn checkLLVM
|
10
Ghidra/Debug/Debugger-swig-lldb/certification.manifest
Normal file
10
Ghidra/Debug/Debugger-swig-lldb/certification.manifest
Normal file
|
@ -0,0 +1,10 @@
|
|||
##VERSION: 2.0
|
||||
##MODULE IP: Apache License 2.0
|
||||
##MODULE IP: Apache License 2.0 with LLVM Exceptions
|
||||
.classpath||NONE||reviewed||END|
|
||||
.project||NONE||reviewed||END|
|
||||
InstructionsForBuildingLLDBInterface.txt||GHIDRA||||END|
|
||||
Module.manifest||GHIDRA||||END|
|
||||
build.gradle||GHIDRA||||END|
|
||||
src/llvm-project/lldb/bindings/java/java-typemaps.swig||Apache License 2.0 with LLVM Exceptions||||END|
|
||||
src/llvm-project/lldb/bindings/java/java.swig||Apache License 2.0 with LLVM Exceptions||||END|
|
|
@ -0,0 +1,18 @@
|
|||
%include <typemaps.i>
|
||||
%include <carrays.i>
|
||||
%include <various.i>
|
||||
|
||||
%typemap(javabase) ByteArray "SWIGTYPE_p_void"
|
||||
%typemap(javabody) ByteArray %{
|
||||
private long swigCPtr; // Minor bodge to work around private variable in parent
|
||||
private boolean swigCMemOwn;
|
||||
public $javaclassname(long cPtr, boolean cMemoryOwn) {
|
||||
super(cPtr, cMemoryOwn);
|
||||
this.swigCPtr = SWIGTYPE_p_void.getCPtr(this);
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
}
|
||||
%}
|
||||
|
||||
%array_class(jbyte, ByteArray);
|
||||
|
||||
%apply char **STRING_ARRAY { char ** }
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
lldb.swig
|
||||
|
||||
This is the input file for SWIG, to create the appropriate C++ wrappers and
|
||||
functions for various scripting languages, to enable them to call the
|
||||
liblldb Script Bridge functions.
|
||||
*/
|
||||
|
||||
%module lldb
|
||||
|
||||
%include <std_string.i>
|
||||
%include "java-typemaps.swig"
|
||||
%include "macros.swig"
|
||||
%include "headers.swig"
|
||||
|
||||
%{
|
||||
using namespace lldb_private;
|
||||
using namespace lldb;
|
||||
%}
|
||||
|
||||
%include "interfaces.swig"
|
||||
|
File diff suppressed because it is too large
Load diff
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class AccessType {
|
||||
public final static AccessType eAccessNone = new AccessType("eAccessNone");
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class BasicType {
|
||||
public final static BasicType eBasicTypeInvalid = new BasicType("eBasicTypeInvalid", lldbJNI.eBasicTypeInvalid_get());
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class BreakpointEventType {
|
||||
public final static BreakpointEventType eBreakpointEventTypeInvalidType = new BreakpointEventType("eBreakpointEventTypeInvalidType", lldbJNI.eBreakpointEventTypeInvalidType_get());
|
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
|
@ -47,7 +47,6 @@ public class ByteArray extends SWIGTYPE_p_void {
|
|||
lldbJNI.ByteArray_setitem(swigCPtr, this, index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
public SWIGTYPE_p_jbyte cast() {
|
||||
long cPtr = lldbJNI.ByteArray_cast(swigCPtr, this);
|
||||
return (cPtr == 0) ? null : new SWIGTYPE_p_jbyte(cPtr, false);
|
||||
|
@ -57,6 +56,5 @@ public class ByteArray extends SWIGTYPE_p_void {
|
|||
long cPtr = lldbJNI.ByteArray_frompointer(SWIGTYPE_p_jbyte.getCPtr(t));
|
||||
return (cPtr == 0) ? null : new ByteArray(cPtr, false);
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class ByteOrder {
|
||||
public final static ByteOrder eByteOrderInvalid = new ByteOrder("eByteOrderInvalid", lldbJNI.eByteOrderInvalid_get());
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class CommandArgumentType {
|
||||
public final static CommandArgumentType eArgTypeAddress = new CommandArgumentType("eArgTypeAddress", lldbJNI.eArgTypeAddress_get());
|
||||
|
@ -102,6 +100,7 @@ public final class CommandArgumentType {
|
|||
public final static CommandArgumentType eArgTypeCommand = new CommandArgumentType("eArgTypeCommand");
|
||||
public final static CommandArgumentType eArgTypeColumnNum = new CommandArgumentType("eArgTypeColumnNum");
|
||||
public final static CommandArgumentType eArgTypeModuleUUID = new CommandArgumentType("eArgTypeModuleUUID");
|
||||
public final static CommandArgumentType eArgTypeSaveCoreStyle = new CommandArgumentType("eArgTypeSaveCoreStyle");
|
||||
public final static CommandArgumentType eArgTypeLastArg = new CommandArgumentType("eArgTypeLastArg");
|
||||
|
||||
public final int swigValue() {
|
||||
|
@ -138,7 +137,7 @@ public final class CommandArgumentType {
|
|||
swigNext = this.swigValue+1;
|
||||
}
|
||||
|
||||
private static CommandArgumentType[] swigValues = { eArgTypeAddress, eArgTypeAddressOrExpression, eArgTypeAliasName, eArgTypeAliasOptions, eArgTypeArchitecture, eArgTypeBoolean, eArgTypeBreakpointID, eArgTypeBreakpointIDRange, eArgTypeBreakpointName, eArgTypeByteSize, eArgTypeClassName, eArgTypeCommandName, eArgTypeCount, eArgTypeDescriptionVerbosity, eArgTypeDirectoryName, eArgTypeDisassemblyFlavor, eArgTypeEndAddress, eArgTypeExpression, eArgTypeExpressionPath, eArgTypeExprFormat, eArgTypeFileLineColumn, eArgTypeFilename, eArgTypeFormat, eArgTypeFrameIndex, eArgTypeFullName, eArgTypeFunctionName, eArgTypeFunctionOrSymbol, eArgTypeGDBFormat, eArgTypeHelpText, eArgTypeIndex, eArgTypeLanguage, eArgTypeLineNum, eArgTypeLogCategory, eArgTypeLogChannel, eArgTypeMethod, eArgTypeName, eArgTypeNewPathPrefix, eArgTypeNumLines, eArgTypeNumberPerLine, eArgTypeOffset, eArgTypeOldPathPrefix, eArgTypeOneLiner, eArgTypePath, eArgTypePermissionsNumber, eArgTypePermissionsString, eArgTypePid, eArgTypePlugin, eArgTypeProcessName, eArgTypePythonClass, eArgTypePythonFunction, eArgTypePythonScript, eArgTypeQueueName, eArgTypeRegisterName, eArgTypeRegularExpression, eArgTypeRunArgs, eArgTypeRunMode, eArgTypeScriptedCommandSynchronicity, eArgTypeScriptLang, eArgTypeSearchWord, eArgTypeSelector, eArgTypeSettingIndex, eArgTypeSettingKey, eArgTypeSettingPrefix, eArgTypeSettingVariableName, eArgTypeShlibName, eArgTypeSourceFile, eArgTypeSortOrder, eArgTypeStartAddress, eArgTypeSummaryString, eArgTypeSymbol, eArgTypeThreadID, eArgTypeThreadIndex, eArgTypeThreadName, eArgTypeTypeName, eArgTypeUnsignedInteger, eArgTypeUnixSignal, eArgTypeVarName, eArgTypeValue, eArgTypeWidth, eArgTypeNone, eArgTypePlatform, eArgTypeWatchpointID, eArgTypeWatchpointIDRange, eArgTypeWatchType, eArgRawInput, eArgTypeCommand, eArgTypeColumnNum, eArgTypeModuleUUID, eArgTypeLastArg };
|
||||
private static CommandArgumentType[] swigValues = { eArgTypeAddress, eArgTypeAddressOrExpression, eArgTypeAliasName, eArgTypeAliasOptions, eArgTypeArchitecture, eArgTypeBoolean, eArgTypeBreakpointID, eArgTypeBreakpointIDRange, eArgTypeBreakpointName, eArgTypeByteSize, eArgTypeClassName, eArgTypeCommandName, eArgTypeCount, eArgTypeDescriptionVerbosity, eArgTypeDirectoryName, eArgTypeDisassemblyFlavor, eArgTypeEndAddress, eArgTypeExpression, eArgTypeExpressionPath, eArgTypeExprFormat, eArgTypeFileLineColumn, eArgTypeFilename, eArgTypeFormat, eArgTypeFrameIndex, eArgTypeFullName, eArgTypeFunctionName, eArgTypeFunctionOrSymbol, eArgTypeGDBFormat, eArgTypeHelpText, eArgTypeIndex, eArgTypeLanguage, eArgTypeLineNum, eArgTypeLogCategory, eArgTypeLogChannel, eArgTypeMethod, eArgTypeName, eArgTypeNewPathPrefix, eArgTypeNumLines, eArgTypeNumberPerLine, eArgTypeOffset, eArgTypeOldPathPrefix, eArgTypeOneLiner, eArgTypePath, eArgTypePermissionsNumber, eArgTypePermissionsString, eArgTypePid, eArgTypePlugin, eArgTypeProcessName, eArgTypePythonClass, eArgTypePythonFunction, eArgTypePythonScript, eArgTypeQueueName, eArgTypeRegisterName, eArgTypeRegularExpression, eArgTypeRunArgs, eArgTypeRunMode, eArgTypeScriptedCommandSynchronicity, eArgTypeScriptLang, eArgTypeSearchWord, eArgTypeSelector, eArgTypeSettingIndex, eArgTypeSettingKey, eArgTypeSettingPrefix, eArgTypeSettingVariableName, eArgTypeShlibName, eArgTypeSourceFile, eArgTypeSortOrder, eArgTypeStartAddress, eArgTypeSummaryString, eArgTypeSymbol, eArgTypeThreadID, eArgTypeThreadIndex, eArgTypeThreadName, eArgTypeTypeName, eArgTypeUnsignedInteger, eArgTypeUnixSignal, eArgTypeVarName, eArgTypeValue, eArgTypeWidth, eArgTypeNone, eArgTypePlatform, eArgTypeWatchpointID, eArgTypeWatchpointIDRange, eArgTypeWatchType, eArgRawInput, eArgTypeCommand, eArgTypeColumnNum, eArgTypeModuleUUID, eArgTypeSaveCoreStyle, eArgTypeLastArg };
|
||||
private static int swigNext = 0;
|
||||
private final int swigValue;
|
||||
private final String swigName;
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class CommandFlags {
|
||||
public final static CommandFlags eCommandRequiresTarget = new CommandFlags("eCommandRequiresTarget", lldbJNI.eCommandRequiresTarget_get());
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class CommandInterpreterResult {
|
||||
public final static CommandInterpreterResult eCommandInterpreterResultSuccess = new CommandInterpreterResult("eCommandInterpreterResultSuccess");
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class ConnectionStatus {
|
||||
public final static ConnectionStatus eConnectionStatusSuccess = new ConnectionStatus("eConnectionStatusSuccess");
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class DescriptionLevel {
|
||||
public final static DescriptionLevel eDescriptionLevelBrief = new DescriptionLevel("eDescriptionLevelBrief", lldbJNI.eDescriptionLevelBrief_get());
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class DynamicValueType {
|
||||
public final static DynamicValueType eNoDynamicValues = new DynamicValueType("eNoDynamicValues", lldbJNI.eNoDynamicValues_get());
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class EmulateInstructionOptions {
|
||||
public final static EmulateInstructionOptions eEmulateInstructionOptionNone = new EmulateInstructionOptions("eEmulateInstructionOptionNone", lldbJNI.eEmulateInstructionOptionNone_get());
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class Encoding {
|
||||
public final static Encoding eEncodingInvalid = new Encoding("eEncodingInvalid", lldbJNI.eEncodingInvalid_get());
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class ErrorType {
|
||||
public final static ErrorType eErrorTypeInvalid = new ErrorType("eErrorTypeInvalid");
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class ExpressionEvaluationPhase {
|
||||
public final static ExpressionEvaluationPhase eExpressionEvaluationParse = new ExpressionEvaluationPhase("eExpressionEvaluationParse", lldbJNI.eExpressionEvaluationParse_get());
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class ExpressionResults {
|
||||
public final static ExpressionResults eExpressionCompleted = new ExpressionResults("eExpressionCompleted", lldbJNI.eExpressionCompleted_get());
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class FilePermissions {
|
||||
public final static FilePermissions eFilePermissionsUserRead = new FilePermissions("eFilePermissionsUserRead", lldbJNI.eFilePermissionsUserRead_get());
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class Format {
|
||||
public final static Format eFormatDefault = new Format("eFormatDefault", lldbJNI.eFormatDefault_get());
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class FrameComparison {
|
||||
public final static FrameComparison eFrameCompareInvalid = new FrameComparison("eFrameCompareInvalid");
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class FunctionNameType {
|
||||
public final static FunctionNameType eFunctionNameTypeNone = new FunctionNameType("eFunctionNameTypeNone", lldbJNI.eFunctionNameTypeNone_get());
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class GdbSignal {
|
||||
public final static GdbSignal eGdbSignalBadAccess = new GdbSignal("eGdbSignalBadAccess", lldbJNI.eGdbSignalBadAccess_get());
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class InputReaderAction {
|
||||
public final static InputReaderAction eInputReaderActivate = new InputReaderAction("eInputReaderActivate");
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class InputReaderGranularity {
|
||||
public final static InputReaderGranularity eInputReaderGranularityInvalid = new InputReaderGranularity("eInputReaderGranularityInvalid", lldbJNI.eInputReaderGranularityInvalid_get());
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class InstrumentationRuntimeType {
|
||||
public final static InstrumentationRuntimeType eInstrumentationRuntimeTypeAddressSanitizer = new InstrumentationRuntimeType("eInstrumentationRuntimeTypeAddressSanitizer", lldbJNI.eInstrumentationRuntimeTypeAddressSanitizer_get());
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class LanguageType {
|
||||
public final static LanguageType eLanguageTypeUnknown = new LanguageType("eLanguageTypeUnknown", lldbJNI.eLanguageTypeUnknown_get());
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class LaunchFlags {
|
||||
public final static LaunchFlags eLaunchFlagNone = new LaunchFlags("eLaunchFlagNone", lldbJNI.eLaunchFlagNone_get());
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class MatchType {
|
||||
public final static MatchType eMatchTypeNormal = new MatchType("eMatchTypeNormal");
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class MemberFunctionKind {
|
||||
public final static MemberFunctionKind eMemberFunctionKindUnknown = new MemberFunctionKind("eMemberFunctionKindUnknown", lldbJNI.eMemberFunctionKindUnknown_get());
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class PathType {
|
||||
public final static PathType ePathTypeLLDBShlibDir = new PathType("ePathTypeLLDBShlibDir");
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class Permissions {
|
||||
public final static Permissions ePermissionsWritable = new Permissions("ePermissionsWritable", lldbJNI.ePermissionsWritable_get());
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class QueueItemKind {
|
||||
public final static QueueItemKind eQueueItemKindUnknown = new QueueItemKind("eQueueItemKindUnknown", lldbJNI.eQueueItemKindUnknown_get());
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class QueueKind {
|
||||
public final static QueueKind eQueueKindUnknown = new QueueKind("eQueueKindUnknown", lldbJNI.eQueueKindUnknown_get());
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class RegisterKind {
|
||||
public final static RegisterKind eRegisterKindEHFrame = new RegisterKind("eRegisterKindEHFrame", lldbJNI.eRegisterKindEHFrame_get());
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class ReturnStatus {
|
||||
public final static ReturnStatus eReturnStatusInvalid = new ReturnStatus("eReturnStatusInvalid");
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public final class RunMode {
|
||||
public final static RunMode eOnlyThisThread = new RunMode("eOnlyThisThread");
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public class SBAddress {
|
||||
private transient long swigCPtr;
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public class SBAttachInfo {
|
||||
private transient long swigCPtr;
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public class SBBlock {
|
||||
private transient long swigCPtr;
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public class SBBreakpoint {
|
||||
private transient long swigCPtr;
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public class SBBreakpointList {
|
||||
private transient long swigCPtr;
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public class SBBreakpointLocation {
|
||||
private transient long swigCPtr;
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public class SBBreakpointName {
|
||||
private transient long swigCPtr;
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public class SBBroadcaster {
|
||||
private transient long swigCPtr;
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public class SBCommandInterpreter {
|
||||
private transient long swigCPtr;
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public class SBCommandInterpreterRunOptions {
|
||||
private transient long swigCPtr;
|
||||
|
@ -85,6 +83,14 @@ public class SBCommandInterpreterRunOptions {
|
|||
lldbJNI.SBCommandInterpreterRunOptions_SetPrintResults(swigCPtr, this, arg0);
|
||||
}
|
||||
|
||||
public boolean GetPrintErrors() {
|
||||
return lldbJNI.SBCommandInterpreterRunOptions_GetPrintErrors(swigCPtr, this);
|
||||
}
|
||||
|
||||
public void SetPrintErrors(boolean arg0) {
|
||||
lldbJNI.SBCommandInterpreterRunOptions_SetPrintErrors(swigCPtr, this, arg0);
|
||||
}
|
||||
|
||||
public boolean GetAddToHistory() {
|
||||
return lldbJNI.SBCommandInterpreterRunOptions_GetAddToHistory(swigCPtr, this);
|
||||
}
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public class SBCommandReturnObject {
|
||||
private transient long swigCPtr;
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public class SBCommunication {
|
||||
private transient long swigCPtr;
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public class SBCompileUnit {
|
||||
private transient long swigCPtr;
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public class SBData {
|
||||
private transient long swigCPtr;
|
|
@ -1,17 +1,16 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public class SBDebugger {
|
||||
private transient long swigCPtr;
|
||||
protected transient boolean swigCMemOwn;
|
||||
|
@ -428,6 +427,10 @@ public class SBDebugger {
|
|||
return new SBTypeSynthetic(lldbJNI.SBDebugger_GetSyntheticForType(swigCPtr, this, SBTypeNameSpecifier.getCPtr(arg0), arg0), true);
|
||||
}
|
||||
|
||||
public SBStructuredData GetScriptInterpreterInfo(ScriptLanguage arg0) {
|
||||
return new SBStructuredData(lldbJNI.SBDebugger_GetScriptInterpreterInfo(swigCPtr, this, arg0.swigValue()), true);
|
||||
}
|
||||
|
||||
public String __str__() {
|
||||
return lldbJNI.SBDebugger___str__(swigCPtr, this);
|
||||
}
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public class SBDeclaration {
|
||||
private transient long swigCPtr;
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public class SBEnvironment {
|
||||
private transient long swigCPtr;
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public class SBError {
|
||||
private transient long swigCPtr;
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public class SBEvent {
|
||||
private transient long swigCPtr;
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public class SBExecutionContext {
|
||||
private transient long swigCPtr;
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public class SBExpressionOptions {
|
||||
private transient long swigCPtr;
|
|
@ -1,17 +1,15 @@
|
|||
/* ###
|
||||
* IP: Apache License 2.0 with LLVM Exceptions
|
||||
*/
|
||||
package SWIG;
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 4.0.2
|
||||
* Version 4.0.1
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package SWIG;
|
||||
|
||||
public class SBFile {
|
||||
private transient long swigCPtr;
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue