In this post you will learn how to setup the environment and the project on eclipse to help debug the system.
- Make a folder under your home directory and name it python-source. (Example: /home/prashanth/python-source).
- Extract the contents of the python source code downloaded into the folder.
- Enter the folder in the command line.
- Type the command ./configure –with-pydebug to enable debugging of the source code.
- When the command completes without errors enter the next command make -j8. Where 8 is the number of CPU cores. This could vary on your system. Type the appropriate number.
- Open Eclipse and create a new C/C++ project and name it python-source.
- Select Import in Eclipse menu as shown in the pictures below.
- Complete the wizard by selecting the folder from the menu and the project to import to as python-source.
- Select the Run Menu and then select Debug Configurations to open the debug menu as shown below.
- Select the python executable as shown below.
- Click on the debug option and you must see the python shell in the debug menu.
You are ready to go.