Debugging/fr

Premiers tests
Avant de passer à la douloureuse phase de débogage, utilisez le framework de tests, pour vérifier, si les tests standards fonctionnent correctement. Si ce n'est pas le cas, c'est peut-être dû a une installation défectueuse.

Ligne de commande
Le débogage de FreeCAD est supporté par quelques mécanismes internes. La version en ligne de commande de FreeCAD fournit des options d'aide au débogage :


 * -v: Avec l'option "v", FreeCAD donne une sortie plus verbeuse (plus documentée).
 * -l: Avec l'option "l", FreeCAD écrit des informations supplémentaires dans un fichier .log.

Generating a Backtrace
If you are running a version of FreeCAD from the bleeding edge of the development curve, it may "crash". You can help solve such problems by providing the developers with a "backtrace". To do this, you need to be running a "debug build" of the software. "Debug build" is a parameter that is set at compile time, so you'll either need to compile FreeCAD yourself, or obtain a pre-compiled "debug" version.

For Linux
Prerequisites:


 * software package gdb installed
 * a debug build of FreeCAD
 * a FreeCAD model that causes a crash

Steps: Enter the following in your terminal window: cd FreeCAD/bin gdb FreeCAD handle SIG33 noprint nostop run FreeCAD will now start up. Perform the steps that cause FreeCAD to crash, then enter 'bt' in your terminal window. This will generate a lengthy listing of exactly what the program was doing when it crash. Include this with your problem report.

Python debugging
Here is an example of using winpdb inside FreeCAD:


 * 1) Run winpdb and set the password (e.g. test)
 * 2) Create a Python file with this content
 * 1) Start FreeCAD and load the above file into FreeCAD
 * 2) Press F6 to execute it
 * 3) Now FreeCAD will become unresponsive because the Python debugger is waiting
 * 4) Switch to the Windpdb GUI and click on "Attach". After a few seconds an item "" appears where you have to double-click
 * 5) Now the currently executed script appears in Winpdb.
 * 6) Set a break at the last line and press F5
 * 7) Now press F7 to step into the Python code of Draft.makeWire