<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Arial">&nbsp;&nbsp;&nbsp; I have been trying to add hardware/software
breakpoints to the elf loader I am using for Linux on the Pico E12/E14
boards.<br>
&nbsp;&nbsp;&nbsp; I have had no trouble setting up an exception handler - I found
several including the one inside the kernel to "borrow" from.<br>
&nbsp;&nbsp;&nbsp; Using the Xilinx/IBM PPC reference I have had no problem setting a
breakpoint - either by replacing an instruction with a trap, or by
setting&nbsp; the IAC registers.<br>
&nbsp;&nbsp;&nbsp; I have no problem catching the exception&nbsp; - exactly as I expected.<br>
&nbsp;&nbsp;&nbsp; But despite the fact that I have cleared the dbsr, dbcr0, esr, and
the appropriate bits in the msr/ appropriate srr for the exception, <br>
&nbsp;&nbsp;&nbsp;&nbsp; I can not exit from the excretion handler (back through restoring
registers (except for the above changes) , without having the exception
re-occur again at exactly the same place.<br>
&nbsp;&nbsp;&nbsp; I have poured over the Xilinx/IBM docs looking for something I am
missing, some bit I need to wiggle, ... but can't find anything.<br>
<br>
&nbsp;&nbsp;&nbsp; Is anyone aware of a clean example dealing with ppc405 software
debugging (or something similar enough to be useful)&nbsp; that I could use
as a reference ?<br>
&nbsp;&nbsp;&nbsp; Anyone have any ideas what I might be missing ? Or a mailing list
that might be a more appropriate target this question ?<br>
<br>
&nbsp;&nbsp;&nbsp; I have pasted a trace of what I am seeing - the trace is my own
code - part of the software debugger I am trying to build into the
bootloader.<br>
&nbsp;&nbsp;&nbsp; The trace at each exception only shows the registers that have
changed since the last display.<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; MonitorK.elf is the debugging version of my boot loader.<br>
&nbsp;&nbsp;&nbsp; Anything prefixed with a "!" is a command to MonitorK.<br>
&nbsp;&nbsp;&nbsp; <br>
<br>
File MonitorK.elf updated from C:\Pico\MonitorK.elf.<br>
Loading MonitorK.elf.<br>
!boot -vvTS kernel.elf<br>
Entrypoint: 0x000064e0 Cmdline @ 0x0fff0200: &lt;&gt;<br>
&nbsp;&nbsp;&nbsp; lr=0x000064e0&nbsp;&nbsp;&nbsp;&nbsp; r3=0x0fffb000&nbsp;&nbsp;&nbsp;&nbsp; r6=0x0fff0200&nbsp;&nbsp;&nbsp;&nbsp;
r9=0x10000000&nbsp;&nbsp; srr0=0x000064e0&nbsp; dbcr0=0x08000000 <br>
&nbsp; iac1=0x000064f0&nbsp;&nbsp;&nbsp;&nbsp; r1=0x0fff0000 <br>
DBCR0: IC <br>
Traps:&nbsp;&nbsp;&nbsp; 0x000064ec <br>
<br>
Program Exception 00000007 @ 000064ec<br>
&nbsp;&nbsp; bch=0x0fff010c&nbsp;&nbsp;&nbsp; blr=0x07000780&nbsp;&nbsp;&nbsp;&nbsp; pc=0x000064ec&nbsp;&nbsp;&nbsp;&nbsp;
cr=0x40000000&nbsp;&nbsp;&nbsp; r11=0x0006fa3c&nbsp;&nbsp; srr0=0x000064ec <br>
&nbsp;&nbsp; esr=0x02000000&nbsp;&nbsp;&nbsp; tsr=0xc4000000&nbsp;&nbsp; dbsr=0x98100300&nbsp; dbcr0=0x09000000
<br>
DBSR: IC TDE UDE IDE <br>
DBCR0: IC TDE <br>
ESR: PEU <br>
TSR: ENW WIS <br>
Traps:&nbsp;&nbsp;&nbsp; 0x000064ec <br>
000064ec: 41820008 bc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 12,2,0x8<br>
<br>
!step<br>
Program Exception 00000007 @ 000064ec<br>
&nbsp;&nbsp; tsr=0x04000000&nbsp;&nbsp; dbsr=0x90100000 <br>
DBSR: IC TDE IDE <br>
DBCR0: IC TDE <br>
ESR: PEU <br>
TSR: <br>
Traps:&nbsp;&nbsp;&nbsp; 0x000064f0 <br>
000064ec: 41820008 bc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 12,2,0x8<br>
<br>
!step<br>
Program Exception 00000007 @ 000064ec<br>
&nbsp;&nbsp; tsr=0xc4000000 <br>
DBSR: IC TDE IDE <br>
DBCR0: IC TDE <br>
ESR: PEU <br>
TSR: ENW WIS <br>
Traps:&nbsp;&nbsp;&nbsp; 0x000064f0 0x000064f0 <br>
000064ec: 41820008 bc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 12,2,0x8<br>
<br>
!step<br>
Program Exception 00000007 @ 000064ec<br>
&nbsp;&nbsp; tsr=0x04000000 <br>
DBSR: IC TDE IDE <br>
DBCR0: IC TDE <br>
ESR: PEU <br>
TSR: <br>
Traps:&nbsp;&nbsp;&nbsp; 0x000064f0 0x000064f0 0x000064f0 <br>
000064ec: 41820008 bc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 12,2,0x8<br>
<br>
<br>
I can get this to repeat pretty much infinitely with nothing changing
except TSR_ENW and&nbsp; TSR_WIS<br>
<br>
<br>
<br>
<br>
</font>
<pre class="moz-signature" cols="72">-- 
Dave Lynch                                                       DLA Systems
Software Development:                                           Embedded Linux
717.627.3770                <a class="moz-txt-link-abbreviated" href="mailto:dhlii@dlasys.net">dhlii@dlasys.net</a>           <a class="moz-txt-link-freetext" href="http://www.dlasys.net">http://www.dlasys.net</a>
fax: 1.253.369.9244                                    Cell: 1.717.587.7774
Over 25 years' experience in platforms, languages, and technologies too numerous to list.

"Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction."
Albert Einstein
</pre>
</body>
</html>