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/14.x), you will need to either 
install v14 or generate the JNI interface for the version you have.

(2a) To install LLVM/lldb version 14:
	- git clone https://github.com/llvm/llvm-project.git
	- git checkout release/14.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 (not including the actual library name)
	  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.
(6) You may need to set up the development environment before running gradle:
		gradle -I gradle/support/fetchDependencies.gradle init
(7) If you are using the homebrew installation of lldb, you may need to modify buildNatives.gradle 
    to reflect the homebrew directory structure, e.g. $llvm_dir/lldb/include -> $llvm_dir/include.
    
    
    