How do breakpoint work in emulators?

I have been using these JTAG emulators for ADSP blackfin processors for quite some time now. I want to know about how the software breakpoint actually works internally. I opened the ADSP JTAG emulator, it had a BF531 DSP and a flash inside. Now, if my understanding is right... When we run the code in emulator mode, then the code runs from the DSP in the JTAG device. Now when i keep a breakpoint in the emulator.. how does it work??.. I have one possible interpretation from my basic understanding.. please help me understand if its right.... May be when we set the breakpoint, the code from that part is pushed into some stack and some breakpoint function is replaced onto that location. This function has some infinite loop within.... Am i somewhere even close??

Reply to
adonis
Loading thread data ...

Not really, processor in JTAG device is only used for communication between PC and processor on board.

I am not sure how it is done exactly in blackfin, but generally, when you setup software breakpoint, instruction which is at given address is replaced with instruction, which generates emulator exception. Then processor goes to exception handling routines and talks to emulator

Best Regards AK

Reply to
AK

Reply to
adonis

Yes, but this is really a "software breakpoint" as opposed to a "breakpoint in the software". Most processors with on-chip debug module support at least one or two hardware breakpoints, where a compare on the PC triggers the breakpoint in hardware.

Reply to
larwe

How does a hardware breakpoint work?.. How does it halts the processor. Is it that when some hardware line is pulled up or down, then some software exception handler is called. What i actually mean to ask is, whether it is purely hardware or is hardware just a trigger.

Reply to
adonis

Architecture-specific. But they are normally designed to be completely invisible to the software; in other words, the h/w breakpoint will automatically cut the clock to the CPU and set a flag in an internal debugger register, which is then read out by the host PC over JTAG.

Reply to
larwe

Wooow cutting clock sounds cool... So that the Dsp cannot do any further.. and to return to processing just agian feed the clock again .. Very good way of break the process.. thats really totally hardware interrupt...

Thanks Larwe...

larwe wrote:

Reply to
adonis

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.