Skip to content

Building on MacOS

Anton Hromov edited this page Nov 17, 2021 · 7 revisions

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 library binary used by lldb. Depending on the IDE you're using you may interract with different versions of lldb.

In order to proceed, you have to discover two paths:

  • python include directory
  • python library file

Instructions for python discovery for different lldb versions:

Finally you can proceed with the normal compilation instructions. Insert discovered python path in cmake command. Don't use sudo during installation

git clone https://github.com/OpenImageDebugger/OpenImageDebugger.git
cd OpenImageDebugger
git submodule init
git submodule update

mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=/usr/local/bin -DLLDB_PYTHON3_LIBRARY="__insert_discovered_python_library_file_path__" -DLLDB_PYTHON3_INCLUDE_DIR="__insert_discovered_python_include_directory_path__"
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 Debugger window should open and you should be able to inspect the available symbols.

Clone this wiki locally