This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Does GDB use single-stepping on source level debugging?


>>>>> "Tony" == Tony Ko <nhko@gctsemi.com> writes:

Tony> Hi Jesper.  You wrote " However, when using breakpoints it will
Tony> _always_ use a single-step to get past the instruction after
Tony> hitting a breakpoint."

Tony> Could you explain more about this. especially for "to get past
Tony> the instruction after ~ "

Think about it: GDB puts a breakpoint somewhere in the code
stream. After it is hit and you decide to continue, GDB must let the
CPU continue its execution _and_ place the breakpoint in the code
stream again. Remember the instruction at the address was never
actually executed.

So what it does is remove the breakpoint, putting back the original
instruction at that address, and do a single-instruction step. It then
places a breakpoint instruction at the address again, and finally does
a 'continue'.

Jesper


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]