QuantLib-Python is a SWIG-generated python module allowing access to QuantLib (C++) functionality. I wish to debug the core QuantLib source code from within Visual Studio debugger (by attaching to a python process). In the past I was able to do this on Visual Studio 2015 without much issue, using the steps below. However, on Visual Studio 2017 (and 2019) the debug symbols are not being loaded into Visual Studio from the PDB file.
quantlib.i
SWIG file (to combine debug C++ with release python) %begin %{
#ifdef _MSC_VER
#define SWIG_PYTHON_INTERPRETER_NO_DEBUG
#endif
%}
python setup.py wrap
python setup.py build --debug
python setup.py install
import QuantLib
I can see from the modules window that no symbols are being loaded for QuantLib. If I look at my QuantLib folder in site-packages I can see that the PDB file does indeed exist.
Has anyone else encountered this problem before? Any idea what might be causing the issue here?
I think I have figured this out now. One needs to ensure that "Native Code" is selected as the type of code to debug. This option can be set using the "Select" button, under "Debug > Attach To Process".