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.
    
    
    