Debugging set up Using VS Code on Mac

I am getting closer to setting up the C++ debugger on VS Code on a Mac. I think I have a simple question for getting this to work. If I can get an answer to this, I think I can get this working.

If I wanted to run a file, such as main.py from ball-in-maze and I wanted it to use the panda3d I have built-in debug mode how would I run that from the command line? Basically, I am asking what executable in the built folder would I launch it with? In the directions for using visual studio on Windows it says to launch the .py file by executing this executable:

/built/bin/ppython.exe
/samples/ball-in-maze/main.py

I am not finding a similar file on my mac build. Thanks

On non-Windows systems, we use system-wide installations of Python, and don’t ship our own Python build. So you can just install Python 3 from python.org onto your system and point to the system-wide python binary for the appropriate version.

You do need to set the PYTHONPATH environment variable (which can be done in VS Code settings) to point to the built folder, so that Python can find the Panda3D installation.

I have that set up correctly and I can debug any .py file I create. Can I also set breakpoints in the C++ file? For example, I would like to set a breakpoint at at TexturePool::
ns_load_texture
and see and confirm what I think it is doing. This doesn’t seem to work.

It’s still not clear to me how to step through C++ code when running panda3d. It would make my life much easier if I could watch the C++ code inside a debugger. I think I know how to attach objects for debugging, but what object do I attach once I have the panda3d library built? The library was built with optimize=1

If I can get this last piece up and running I can start testing some changes. In addition, I could write an up to date tutorial on how to build, run, and debug panda3d.

Perhaps you should just use cmake to create a panda3d project, and work from a Visual Studio.

Right now I am building the panda source using the makepanda.py file. This creates everything in the built directory. I did some more digging and I can debug .py scripts, but I cannot step into the C++ code that I want to examine.
I am pretty sure I have the process figured out for debugging a file.

  1. Set a breakpoint in your .py file
  2. Launch the debugger with your .py file in focus
  3. Attach the C++ debugger to the process (this is the .py file) you want to debug

I just need to know the program for attachment. In other words, the panda3d library? Here is the config file:
{
“name”: “(lldb) Attach”,
“type”: “cppdbg”,
“request”: “attach”,
“program”: “What do I put here? I am assuming some panda3d library?”,
“processId”: “${command:pickProcess}”,
“MIMode”: “lldb”
},

I meant to say a Panda3d project using cmake. However, I’m not sure if this will help. You may need to create a test code in C++. By project, I mean the VS .project file

After many attempts and noodling around, I finally got debugging of panda3d using VScode to work on mac os x. Thanks rdb and serega-kkz for all your patience and advice. I have documented all the steps needed to get this working on Big Sur and would be happy to write out a detailed guide. Would that be useful and where should I put it?