View Full Version : What to do when aborts don't abort? :Die PUB die...
Oldbitcollector (Jeff)
03-18-2009, 06:39 AM
I'm working on a routine that includes code for condition checking.
I'm calling my PUB from my Main and I can see the report that
a condition has been met with my an "str(string("Condition met"))
but it never comes back with the abort
What would cause an abort to hang instead of coming back to
the original routine that called it's PUB?
I've got something like this in my PUB
if r < 0
term.str(string("failed."))
abort
I see the failed message, but it doesn't wander back for continued execution.
Ideas?
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Check out: Protoboard Introduction (http://jeffledger.googlepages.com/Protoboard_Introduction.pdf) , Propeller Cookbook 1.4 (http://ucontroller.com/Propeller%20Protoboard%20Designs%20for%20the%20Beg inner.pdf) & Software Index (http://forums.parallax.com/showthread.php?p=770318)
Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us (http://propeller.warrantyvoid.us)
Got an SD card connected? - PropDOS (http://www.orrtech.net/propdos/)
Post Edited (Oldbitcollector) : 3/17/2009 11:47:06 PM GMT
Oldbitcollector (Jeff)
03-18-2009, 07:07 AM
I've resigned myself to using a RETURN, but I'd still love to hear what the
Spin wizards here say about this.
Thanks!
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Check out: Protoboard Introduction (http://jeffledger.googlepages.com/Protoboard_Introduction.pdf) , Propeller Cookbook 1.4 (http://ucontroller.com/Propeller%20Protoboard%20Designs%20for%20the%20Beg inner.pdf) & Software Index (http://forums.parallax.com/showthread.php?p=770318)
Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us (http://propeller.warrantyvoid.us)
Got an SD card connected? - PropDOS (http://www.orrtech.net/propdos/)
Ariba
03-18-2009, 07:31 AM
Have you called the methode which should ABORT, with a \ before the name: \methode(..) ?
If not the ABORT returns to the first routine in the Top Object.
Andy
Harrison.
03-18-2009, 07:33 AM
You must catch your aborts by starting your method calls with a \. It will look something like this:
PUB main
\testing
PRI testing
abort -1
The Propeller Manual explains abort in much more detail. Basically it just POPs the call stack until it reaches a call that 'catches' the abort.
Oldbitcollector (Jeff)
03-18-2009, 07:40 AM
Ah ha! That makes sense!
Thank you!
(Now why didn't I catch that from the three pages in the manual!??)
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Check out: Protoboard Introduction (http://jeffledger.googlepages.com/Protoboard_Introduction.pdf) , Propeller Cookbook 1.4 (http://ucontroller.com/Propeller%20Protoboard%20Designs%20for%20the%20Beg inner.pdf) & Software Index (http://forums.parallax.com/showthread.php?p=770318)
Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us (http://propeller.warrantyvoid.us)
Got an SD card connected? - PropDOS (http://www.orrtech.net/propdos/)
Timothy D. Swieter
03-18-2009, 08:08 AM
Learning something new here - I didn't realize there was a \ either, but then again I hadn't used the abort yet.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, E.I.
www.brilldea.com (http://www.brilldea.com) - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
www.tdswieter.com (http://www.tdswieter.com)
Jeff Martin
03-18-2009, 09:28 AM
Yeah, without the \ your abort was popping everything out of the stack, and should have caused the cog to terminate... since the stack is initially populated with a return address that causes the Spin interpreter to execute a COGSTOP(COGID).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Jeff Martin
· Sr. Software Engineer
· Parallax, Inc.
ericball
06-13-2009, 02:29 AM
Just a clarification - is the abort value returned to the abort trap? i.e.
PRI child
if <bad thing>
abort -1
PRI parent
rc := child
PUB main | rc
rc := \parent
IF rc == -1
<handle bad thing>
Thanks Mike.· := fixed
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Composite NTSC sprite driver: http://forums.parallax.com/showthread.php?p=800114
NTSC color bars (template): http://forums.parallax.com/showthread.php?p=803904
Post Edited (ericball) : 6/15/2009 12:34:43 AM GMT
Mike Green
06-13-2009, 02:49 AM
Yes. Do remember that assignments use the ":=" operator.