Replies: 2 comments 4 replies
-
It's not possible with nvim-dap-python (as far as I Know). But you can set the break points in your c++ files and use |
Beta Was this translation helpful? Give feedback.
-
Thank you for the tip, I'm able to pass the path of |
Beta Was this translation helpful? Give feedback.
-
Hello,
I currently work on a project which uses a library written in C++ which can be used in Python with pybind11. To debug the C++ code, I currently use
ipython
together withlldb
. Which works as follows:ipython
and get the process id with!ps aux | grep -i ipython
lldb
in another terminal and connect toipyhton
withattach --pid $PID
andcontinue
lldb
to a class method, e.g.breakpoint -n Cat::purr
ipython
launch the Python script withrun examples/example.py
lldb
breaks at the breakpoint and I can step through the code inlldb
which is possible but also a bit tedious.Is there a way to set a breakpoint through
nvim-dap
in C++ and then launch the Python script throughnvim-dap-python
and have it recognize the C++ breakpoint when running the Python script?PS:
I prepared a little example project https://github.com/k0nze/nvim_cpp_python_debugging which can be set up as follows:
An example which instantiates the C++ classes in Python can be run with:
The C++ file in which I would like to set a breakpoint in is located under:
Additionally, I added a minimal
nvim
config which installs plugins into a temporary directory which can be launched with:If the plugins don't install automatically, you can use
:PackerSync
When started you can launch
nvim-dap
withnvim-dap-ui
with [SPACE]+[d] and use the usual commands for setting breakpoints, and stepping though code.Thank you in advance!
Beta Was this translation helpful? Give feedback.
All reactions