Project

General

Profile

Python Debug » History » Version 3

Alexis Jeandet, 09/07/2015 09:25 PM

1 1 Alexis Jeandet
h1. Python Debug
2
3
It is possible to use a Python debugger with SocExplorer, to do so you need to install winpdb (packaged on fedora). 
4
5
* First you have to start the server from SocExplorer python console, you just need to type:
6
7
  <pre><code class="python">
8
9
import rpdb2; rpdb2.start_embedded_debugger('some password')
10
11
  </code></pre>
12
13 3 Alexis Jeandet
p=. 
14
!{width: 80%}SocExplorerRpdbStart.png(SocExplorerPlot rpdb2 start)! 
15 1 Alexis Jeandet
16
* Then you have to start winpdb, and connect it to your running rpdb2 server (File->Attach):
17
18 2 Alexis Jeandet
p=. !{width: 20%}WinPdbAttach.png(Winpdb attach)! 
19 1 Alexis Jeandet
20
Note that you have to provide the same password than used to start the server!
21
You should get a list of running sessions like this:
22
23 2 Alexis Jeandet
p=. !{width: 20%}WinPdbSessionsList.png(Winpdb sessions list)! 
24 1 Alexis Jeandet
25
And once connected, you should get this:
26
27
p=. !{width: 80%}ConnectedWinpdb.png(Winpdb connected)!
28
29
* Now if you want to add some breakpoints you need to open the python file from winpdb(File->Open Source) and set them:
30
31
p=. !{width: 80%}WinpdbWithSomeBPs.png(Winpdb with some breakpoints)!
32
33
Note that you need to click on the arrow to start debugging but SocExplorer will not evaluate the python file, you need to execute by dragging your file in the SocExplorer Python console, then have some fun!