Reputation: 347
Trying to understand what is behind the covers of a breakpoint.
What kind of code executes to halt the execution?
Most IDEs provide a nice front end that doesn't explain much.
I am currently using GDB and Eclipse-CDT, but this is standard across most debugging environments with an IDE.
Upvotes: 0
Views: 45
Reputation: 71546
It is specific to a platform, specific to the processor.
It ranges anywhere from the debugger replaces the instruction(s) in question with something that causes a fault or event that the debugger can trap, to, hardware/chip support that looks for an address fetch and generates an event for the debugger to catch, stops execution.
The front end of gdb doesnt know nor care how it works. when you port the back end to your system, it not only depends on the processor but how you are connected. via jtag, via a rom monitor, etc, each specific jtag solution may need a different backend. The software (gdb, etc) makes a generic I want a break point at this address function call, and the backend for that target can try to implement it the best it can or return fail I cant do it for whatever reason.
So you have to dig into the specific processor and possibly system and connection to that system to get more details. This is too broad for a single answer.
Upvotes: 1