PDA

View Full Version : Breakpoints for the PChip



APStech-Attila
10-27-2006, 05:02 PM
Hi Everyone!

·· I have developed a module to enable breakpoints and trace points for the Propeller! All you need is a terminal program to do breakpoint stepping.

In your code you will add breakpoints and tracepoints like this:

Line#20·|·BPT.BPT(1,20)····· 'Breakpoint(FileID, Line#)
Line#21·| outa[8]~~
Line#22·|· repeat
Line#23·|·· ·BPT.TRC(1,23)··· 'Tracepoint(FileID, Line#)
Line#24·|··· !outa[8]
··
In the hyperterminal you will see·cnt·time your code has reached a trace or breakpoint, you will see the cogid, fileID (or other·8bit information - it supports constants and variables too!) and finally the line number (HEX)

B03303B1 TRC 00010026
B041CCE1 TRC 00010017
B05071F1 TRC 0001001A
B05G2G21 BPT 00010023

The code runs normally, until it·run into·a trace or breakpoint.

If your code is executing a tracepoint, a trace infromation is sent to the terminal via RS232, so you can see "File 1, line 23 was executed by COG $00,·at cnt time $B041CCE1" . This way it easy to see if a condition was true, see how your case statements work,·calculate cycle time, etc.

A breakpoint is very similar to a tracepoint, but·a breakpoint·halts the·execution until user interaction. It will show the same infromation, just it will wait for a keypress on hyper terminal, to continue execution. Combined with the "monitor.spin" you can see all variables, modify them if you want before continuing execution.

I have started working on a PC software, that will display the actual BPT and TRC in realtime, in the SPIN sourcecode!

Comments, ideas and help are wellcome!

Attila

cgracey
10-29-2006, 01:06 AM
Attila,

This looks really neat!

I think that by making an object to do this, you're taking the best approach. People have been asking about (integrated) debuggers and I've been loathe to pick a single approach and then complicate the tool system with it. An object is a neutral approach which doesn't undermine anything. Plus, debug objects could take many forms and be very flexible. I like this much better than an integrated one-size-fits-all approach which would load things with caveats.·I know that a map file would greatly extend your capabilities, though. It's going to take some work on this end...

Keep up the good work!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


Chip Gracey
Parallax, Inc.

APStech-Attila
10-30-2006, 09:28 PM
·I am still working on the debug stuff...

·· Attached please find a low-end preprocessor to help line numbering for breakpoints and tracepoints.

·· It is called SPINup http://forums.parallax.com/images/smilies/smile.gif

·· Soon it will have the usual #Include<file> option - of course Propeller style http://forums.parallax.com/images/smilies/smile.gif

nutson
11-02-2006, 08:41 PM
Hi all,

Here is another attempt·at·propeller debugging tools, roughly in line with Atilla's approach. Only,·I·use·a prop with VGA and keyboard to control 2 propsticks over a 2 wire connection. Sacrificing·one·Cog in the target system·allows for a variety of·control and monitoring functions. See the attached document.

I have two comments after this exercise:
- for Parallax: working with 2 props and·one PC means I have to·switch·programming cables all the time,·the IDE does not allow me to choose a specific interface (USB for the demoboard, USB·to serial for the propsticks). Any chance·this will change?
- for Mike Green: thanks for using your OS, works fine for·creating custom keyboard commands. Only, I have to cut and paste my parts·in your·source directly. Is there a more intelligent way to do this?

Regards

Nico Hattink

nutson
11-02-2006, 08:46 PM
Sorry, forgot a slave demo program. Here it is.

Please inform me of comments, bugs etc

Nico Hattink

Mike Green
11-02-2006, 10:22 PM
Nico,
In the most recent upload, the initialization code has been moved to a separate object so there are only a few lines required in your main program to essentially make your main program the command interpreter. That doesn't take care of the command scanning routines which you still have to incorporate into your program. Now that the SPIN compiler is more flexible with the number of objects allowed in your program, I could move most of the scanning routines to a separate object which would make their use easier. Send me a PM about what would be helpful for you.
Mike