-
Notifications
You must be signed in to change notification settings - Fork 0
Building on MacOS
In order to properly compile the plugin, you must make sure it is linked against the same python lib binary used by lldb. To find out this path, run:
lldb
(lldb) script
Python Interactive Interpreter. To exit, type 'quit()', 'exit()' or Ctrl-D.
>>> import sys; print(sys.path)
For instance, here I got the following results:
['/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A', '/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python3', '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python37.zip', '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7', '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/lib-dynload', '/Users/claudio.fernandes/Library/Python/3.7/lib/python/site-packages', '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages', '.']
In my case, the linked python is located under /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7. Finally, to link OpenImageDebugger against this specific python version, set the PKG_CONFIG_PATH environment variable to the folder lib/pkgconfig inside this python path, but do it before running qmake. In my case, I ran:
export PKG_CONFIG_PATH=/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/Current/lib/pkgconfig
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
qmake .. BUILD_MODE=release PREFIX=/path/to/installation/folder
make -j4
make install
Now let's test it:
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.