I have a C++ project on VSCode. In launch.json I define a proper setting to debug the…
- User
I have a C++ project on VSCode. In launch.json I define a proper setting to debug the code, but the pretty printers are not working as expect. The setting itself is fine, indeed I am using it in another machine and it is working. For this reason, I am considering that I am missing something to install. It is a Linux machine, I installed build-essential and cmake from terminal. Please provide feedback about what it is missing to have pretty printers.
- Assistant
If your pretty printers aren't working as expected in VSCode for a C++ project, even though the configuration works on another machine, there are several things you can check to resolve the issue:
- User
- How can I verify if GDB has Python support?
- Assistant
To verify if your GDB installation has Python support, you can use the following steps:
-
Run GDB in the Terminal: Open a terminal window and start GDB by executing the command:
gdb -
Check Python Support: Once GDB is running, type the following command at the GDB prompt:
show version -
Inspect the Output: In the output, look for a mention of Python support. You should see something similar to:
This GDB was configured as "...-linux-gnu"... Python API version X.Y...The presence of "Python API" or "Python scripting" in the output indicates that your GDB installation has Python support.
-
Exit GDB: You can exit GDB by typing:
quit
If your GDB installation lacks Python support, you may need to install a different version that includes it. On many Linux distributions, GDB with Python support is available through the package manager, often in packages named , (for cross-compiling), or similar. Consider checking if your distribution has a separate package for GDB with Python support, especially if your current installation lacks this feature.
-