Skip to content

Tutorial 6: Debugging the Code

Milan Jelisavcic edited this page Feb 14, 2019 · 1 revision

Debug the Python code

  1. Run ./revolve.py

  2. Run your manager script through pdb by using pdb manager.py or python -m pdb myscript.py: There are a few commands you can then issue, which are documented on the pdb page.

    Some useful ones to remember are:

    • b: set a breakpoint
    • c: continue debugging until you hit a breakpoint
    • s: step through the code
    • n: to go to next line of code
    • l: list source code for the current file (default: 11 lines including the line being executed)
    • u: navigate up a stack frame
    • d: navigate down a stack frame
    • p: to print the value of an expression in the current context

    If you don't want to use a command line debugger, some IDEs like PyDev have a GUI debugger.

Debug the C++ plugin code

  1. Run gzserver with a debugger

  2. Run your manager script

_________________
/ Premature      \
| optimization   |
| is the root of |
| all evil.      |
|                |
\ -- D.E. Knuth  /
-----------------
    \   ^__^
     \  (oo)\_______
        (__)\       )\/\
            ||----w |
            ||     ||
Clone this wiki locally