On Wed, 2020-03-04 at 17:19 +0100, Helge Kruse wrote: > > Hi, > > after writing my first decoder half a year ago I want to start with a > new decoder. > > The documentation pages > - https://sigrok.org/wiki/Protocol_decoder_HOWTO > - https://sigrok.org/wiki/Protocol_decoder_API > show some help. But I feel uncomfortable with this alone. I hope that > digging in my decoder with a debugger would help to learn what I get > in my functions. > > How can I setup a debugger (I hope WinPDB, pdb would also be okay) on > my Windows 10 PC? > How can I attach the debugger to the running PulseView process, or can > I start the program from the debugger?
Have you seen the paragraph on WinPDB in the HOWTO page that you refer to above? Use the embedded debugger feature, because the protocol decoder that is written in Python runs inside a host application and thus cannot be used like a regular script or standalone application. Another detail to remain aware of is that sigrok decoders are written in Python3. In the past there was some hickup with getting WinPDB to work with that language version, can't tell how this changed in the meantime. And I can't speak for development on Windows. Another way of learning is to read a lot of other existing code. Which also lets you pick up best practices and idioms. Add some print statement in interesting spots to "get an idea". But most decoders can get written without a debugger, depending on the protocol's complexity. And I say that from first hand experience. virtually yours Gerhard Sittig -- If you don't understand or are scared by any of the above ask your parents or an adult to help you. _______________________________________________ sigrok-devel mailing list sigrok-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sigrok-devel