We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Greetings,
sir/Madam the hardware break points use internal FPB comparators so that the address we update there are internally comare with program counter if value == program counter then automatically the core will be halted and ready to debug the internal registers.
coming to the software break point this will use "BKPT" instrruction so that when ever the address match with program counter user has to execute __ASM("BKPT"); which will case the target break and enter into halt so that user can further access the debug registers.
my doubt was how should i continuously check the program counter continuously so that i could break the target when ever address i supplied was match.
Correct me if i was wrong.
Thanks and Regards.
Harshan.
Hi Harshan,
If I understand your question correctly, you are asking how a software breakpoint is detected and what mechanism causes the execution of the BKPT instruction. With a software breakpoint, the debugger changes the program memory to replace the breakpointed instruction with BKPT. The debugger records what the original instruction was so that it can be restored when the breakpoint is removed.
I hope that answers your question.
Chris
Thanks for Reply,
Actually i am implementing serial wire debugger, i want to include break point functionality to my customized debugger, in hardware breakpoints they are limited to 6. after browsing on internet i found that we can set unlimited software break-points. but how could i break the target, i mean the process i need to follow in order to break the Target, in "joseph yiu" book i found the information regarding hardware break-point not much about software break point. can you please suggest me the process/example reference so that how could i add this software breakpoint feature to my custom debugger ??
In order to set a software breakpoint, your debugger must edit the code memory to replace the target instruction with a BKPT instruction. You must obviously then replace the original instruction in order to continue execution and when removing the breakpoint. Obviously, this only works when the code is executing from writeable memory.
Hope this helps.