[futurebasic] Re: [FB] FB^3 Threading Puzzle (continuing saga)

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 1999 : Group Archive : Group : All Groups

From: Robert Purves <robert.purves@...>
Date: Thu, 30 Sep 1999 19:50:22 +1200
>>(1) With thredEntryProc&=(LINE "THREADENTRY")+4, when you reach your
>>break-point in MacsBug, right at the start of THPROC (i.e. FN ThProc), why
>>don't you try stepping in MacsBug ("s")... That way you get to see what
>>is being executed.

>PowerPC breakpoint at 02C382DC THPROC..+00004
>Step (into)
>   THPROC..
>   +00004  * mflr r0
>   +00008    stw  r0,0x0008(SP)
>   +0000C    stmw r13,-0x0060(SP)
>   +00010    stwu SP,-0x00A8(SP)
>   +00014    addi r13,SP,0x0020
>   +00018    stw  r3,0x0020(r13)
>   +0001C    li   r3,0x0584
>Step (over)
>Bus Error at 00093DB0
>while reading byte from 08204000 in Supervisor data space

>----->It never got past the _GETSTRCONST call.

Exciting! For the first time in this long discussion, the Thread Manager
has successfully made a call-back to your PPC program. The MacsBug log
above shows the first 7 instructions of FN ThProc being executed without a
crash.

>"THREADENTRY"
>LOCAL FN ThProc(tmp&)
>  print "Here we are at ThProc"
>  FN ThHndlr(tmp&)
>end fn

Unfortunately the machine state (registers, stack or whatever) must have
been wrong, in such a way that the FB^3 runtime crashed when trying to
print the message.

What happens if you remove the run-time-using statements from FN ThProc?

LOCAL FN ThProc(tmp&)
 CALL DEBUGSTR("Hello from ThProc")
END FN

I confidently predict (translation: "I am almost certainly wrong in
saying") that this will work. You should be able to press command-G each
time the DEBUGSTR message appears, and have a working, but useless,
call-back demo.

>68K code works like a charm.
That will eventually prove to be an important clue.

Robert