forked from OpenImageDebugger/OpenImageDebugger
-
Notifications
You must be signed in to change notification settings - Fork 0
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 python paths:
- include directory
- library file
Instructions for python discovery for different 'lldb' versions:
Finally you can proceed with the normal compilation instructions:
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="/Users/agromov/.vscode/extensions/vadimcn.vscode-lldb-1.6.10/lldb/lib/libpython39.dylib" -DLLDB_PYTHON3_INCLUDE_DIR="/usr/local/Frameworks/Python.framework/Versions/3.9/include/python3.9"
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 /path/to/installation/folder/OpenImageDebugger/oidwindow.app/Contents/MacOS/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.