Request for help in organising/releasing source code

discuss PC<>Acorn file transfer issues & the use of FDC, XFER, Omniflop/disk etc.
User avatar
Richard Russell
Posts: 955
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: Request for help in organising/releasing source code

Post by Richard Russell » Sat Sep 29, 2018 9:16 am

Coeus wrote:
Fri Sep 28, 2018 10:11 pm
how would the IDE control the other process when debugging, i.e. cause it to single step etc. given that, by default, processors don't share any memory (unlike threads)?
You could look at 'sdldebug.bbc' (in the lib/ directory) to discover the gory details, but in short it uses files as the means of communication. There are two files, one for each direction: sdldebug.cmd which sends commands from the IDE to the executing program (run, pause, halt, single step) and sdldebug.dat which returns data from the executing program back to the IDE. This data consists of pointers to the 'current' line and 'error' line, so that they can be highlighted, and either a list of variables and their values (used by the listvars.bbc utility) or a list of times spent in each line (used by the profiler.bbc utility), depending on whether Run...Debug or Run...Profile was issued.

Sharing the same process for the IDE and the running program (which the BB4W IDE does) simplifies the communication between them, but makes it far more likely that a major crash in the running BBC BASIC program will take down the IDE too - and it happens! Of the two approaches, I much prefer the security of knowing that however catastrophically the BASIC program may fail, the IDE (and the potentially unsaved program) should survive. I do know that there are a couple of residual bugs in SDLIDE.bbc than can cause it to crash, but I've never tracked them down.

Unfortunately in the absence of an assembler you can't see the debug facilities in action on a 64-bit build at present, but they work nicely on the 32-bit x86 (downloadable from my website) and Raspberry Pi builds.
Last edited by Richard Russell on Sat Sep 29, 2018 9:23 am, edited 1 time in total.

User avatar
Richard Russell
Posts: 955
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: Request for help in organising/releasing source code

Post by Richard Russell » Sun Sep 30, 2018 11:13 am

I've updated the BBCSDL source code zip to fix ceefax.bbc (in the examples/general directory) which suffered a minor regression in the v0.24a release. I'm constantly on the lookout for more example programs to show off BBC BASIC's (and especially BBCSDL's) capabilities to the full; if you know of anything suitable please let me know.

Coeus
Posts: 1402
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Request for help in organising/releasing source code

Post by Coeus » Sun Sep 30, 2018 12:12 pm

Richard, thanks for the explanation.
Richard Russell wrote:
Sat Sep 29, 2018 9:16 am
I much prefer the security of knowing that however catastrophically the BASIC program may fail, the IDE (and the potentially unsaved program) should survive.
That makes perfect sense to me.

Post Reply