Debugging Python UPoC

Python UPoC debugging is supported only from the command line, not with NetBeans.

  1. In the shell of a terminal, run setroot, then setsite to the JavaScript/Python demo site.
  2. To debug Jython TPS, in the hcitpstest command line, add {DEBUG 1} to enable debugging:
    $ hcitpstest -r run -x ASCII -f nl -c sms_ib_data -e "hcitpstestshowbydisp" $HCISITEDIR/in.txt 
    "cljTPS {CLASS ScriptTPS} {LANG python} {FILE per.py} {FUNC tpsFunc}"
    The simpleUPoC module is imported
    > /work/quovadx_dev/qdx6.2P/integrator/jsjy/pythonmodules/simpleUPoC.py(17)run()
    -> '@type msg: Message'
    (Pdb)
    At this point, you can use various commands to do debugging. Specify “h” for help. See the online pdb - The Python Debugger document for reference.

    https://docs.python.org/2/library/pdb.html

  3. In Emacs (Version 24.3.1 on CentOS 7.1), add these lines to the ~/.emacs file:
    (require 'python)
    (add-hook 'comint-output-filter-functions 'python-pdbtrack-comint-output-filter-function)
  4. Start Emacs, then run the hcitpstest command in any comint-based buffers. For example, *shell*. The pdbtrack hook acknowledges the pdb prompt and presents the line in the source file where the program is stopped in a pop-up buffer.