Differences

This shows you the differences between two versions of the page.

Link to this comparison view

tutorials:freecad:debug [2019/05/12 10:18] (current)
alanzheng created
Line 1: Line 1:
 +===== How to debug FreeCAD python module =====
 +
 +  - install winpdb-reborn by **python -m pip install winpdb-reborn** at FreeCAD directory
 +  - launch FreeCAD, Add below macro, and F6 to execute it.
 +<​code>​
 +import rpdb2
 +import FreeCAD
 +import Part
 +import Draft
 +rpdb2.start_embedded_debugger("​test"​)
 +print ("​hello"​)
 +import Draft
 +points=[FreeCAD.Vector(-3.0,​-1.0,​0.0),​FreeCAD.Vector(-2.0,​0.0,​0.0)]
 +Draft.makeWire(points,​closed=False,​face=False,​support=None)
 +</​code>​
 +  - The FreeCAD will hang up now because of **rpdb2.start_embedded_debugger("​test"​)** break point
 +  - Start winpdb, and attach the process with the password **test**
 +{{:​tutorials:​freecad:​pasted:​20190512-101625.png}}
 +  - Happy debug!