[OpenBIOS] RFC: Best way to implement debugging support

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Thu Jul 30 18:43:07 CEST 2009

Hi all,

Over the past few weeks, I've been experimenting with different 
approaches to allow me to break and single-step through certain code 
sections to help me debug issues with Sparc64. Sadly, after a reasonable 
amount of experimentation, I haven't managed to come up with anything 
that works 100% per specification and so thought I'd ask the list to see 
if there are any better ideas.

My aim has been to implement a subset of the OF spec "Forth 
source-level debugger" commands to enable me to step through various 
code sections.

The main problem I have at the moment is that there doesn't seem to be 
an easy way to determine which word is currently being executed in order 
  to decide whether to execute the word normally or single step through it.

The nearest I have managed so far is to append a debug marker to the 
return stack indicating whether words executed in the current stack 
frame should executed normally or single-stepped. This works for the 
majority of words, except for those which push/pop items from the return 
stack during execution - as soon as the return stack is popped, the 
marker is lost and so debug disappears part way through a word :(

Can anyone else come up with a better idea of implementing this so that 
it can work with words that modify the return stack?



Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
t: +44 870 608 0063

More information about the OpenBIOS mailing list