Subject: re: db 'step' function
To: None <macbsd-general@NetBSD.ORG>
From: John Wittkoski <jpw@insoft2.insoft.com>
List: macbsd-general
Date: 01/03/1995 14:10:28
> I'm no authority on this, but it seems to me that it is impossible to 
> 'step' through ROM. The way I understand it, the debugger tries to use this 
> algorithm to 'step':
> 1) save the instruction after the current instruction
> 2) insert a trap after the current instruction
> 3) execute the current instruction
> 4) (control returns to the debugger via the inserted trap)
> 5) replace the saved instruction (which is now current)
> In ROM (Read Only Memory), this algorithm fails, since you cannot write the 
> necessary trap instruction to ROM. This results in the 'step' command 
> acting like a 'continue' command (without the trap, control never returns 
> to the debugger; the processor simply continues to execute instructions in 
> ROM).

I think it can be done like this, and it may be done like this on some 
processors or with some debuggers.

However, the 680x0 processors have a flag in one of the registers which, when
set, generates a trap after EVERY instruction. This trap is generated by the 
CPU itself and so is not dependant on where the current instruction actually is
in memory.

Plus, 'step'-ing fail even in RAM, so it is not a RAM/ROM issue.

Thanks for your suggestions, though.

	--John

--
--------------------------------------------------------------
 John Wittkoski				InSoft, Inc.
 Senior Technical Support Engineer      Phone: (717) 730-9501
 Email: jpw@insoft.com                  Fax  : (717) 730-9504
--------------------------------------------------------------