-
Notifications
You must be signed in to change notification settings - Fork 0
Building on MacOS
On MacOS debugging of C++ code is possible by using lldb debugger. Open Image Debugger is using python interface of lldb for getting debug variables.
In order to properly compile the plugin, you must make sure it is linked against the same python binary used by lldb.
Depending on the IDE you're using you may interact with different versions of lldb command.
Note that some lldb assemblies use the python library while others use the python framework.
In order to proceed, you have to discover two paths:
- python include directory
- python library file OR framework directory
Instructions for python discovery for different lldb versions:
Finally, you can proceed with the normal compilation instructions. Insert discovered python paths in cmake command. Don't use sudo during installation
- Download repository and its submodules
git clone https://github.com/OpenImageDebugger/OpenImageDebugger.git
cd OpenImageDebugger
git submodule init
git submodule update
- Create build directory
mkdir build && cd build
-
Configure CMake. Use one of these commands depending on the way of python binary loading by
lldb:3.1. If
lldbuses python librarycmake .. -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=/usr/local/bin -DAPPLE_LLDB_PYTHON3_INCLUDE_DIR="__insert_discovered_python_include_directory_path__" -DAPPLE_LLDB_PYTHON3_LIBRARY="__insert_discovered_python_library_file_path__"3.2. If
lldbuses python frameworkcmake .. -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=/usr/local/bin -DAPPLE_LLDB_PYTHON3_INCLUDE_DIR="__insert_discovered_python_include_directory_path__" -DAPPLE_LLDB_PYTHON3_FRAMEWORK_DIR="__insert_discovered_python_framework_directory_path__" -
Build and install project
make -j4
make install
- Now let's test it (only in case of system-wide
lldb):
c++ ../testbench/main.cpp -std=c++11 -g -o test
lldb test
command script import /usr/local/bin/OpenImageDebugger/oid.py
break set -f main.cpp -l 344
run
- As lldb hits the breakpoint, the
Open Image Debuggerwindow should open, and you should be able to inspect the available symbols.