Hi, On Mon, Oct 03, 2016 at 09:30:38AM -0700, Chris Dreher wrote: > What tools are people using to develop protocol decoders? > > So far, all I've used is a text editor, running pdtest, and using self.put() > for crude debug output. Is there a better way to print debug output? Is > there a debugger to single-step through the python script code and observe > variables?
I'm personally using vim to edit .py files, type "make install" in libsigrokdecode's build directory, and run sigrok-cli or PulseView to see/test my changes. If you make an alias or use your shell's history function that's pretty quick (works for me at least, and I've written quite a bunch of PDs). Something like this: $ cd build $ vim ../decoders/foo/pd.py && make install && LD_LIBRARY_PATH=$HOME/sr/lib ~/sr/bin/pulseview PulseView now remembers the last *.sr file you had open and also the last PD (if there's only one; there's a few more things it could remember later such as channel assignment, stacked PDs, options and such), so that's pretty convenient. I also switch between sigrok-cli and PulseView a bit, whichever is more convenient for the task at hand. For finding generic problems/bugs in the PD you can use sigrok-cli (with "-l 5" if needed), but when checking whether the annotations span the correct start/end samples PulseView is the only proper option of course (you have to actually see the graphical representation). Cheers, Uwe. -- http://hermann-uwe.de | http://randomprojects.org | http://sigrok.org ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ sigrok-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sigrok-devel

