This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: Does GDB use single-stepping on source level debugging?
- To: "Tony Ko" <nhko at gctsemi dot com>
- Subject: RE: [ECOS] Does GDB use single-stepping on source level debugging?
- From: Jesper Skov <jskov at cambridge dot redhat dot com>
- Date: Tue, 19 Jun 2001 15:24:00 +0200
- Cc: "Jesper Skov" <jskov at cambridge dot redhat dot com>,<ecos-discuss at sources dot redhat dot com>
- References: <9860C773D04D834D83FD6FAD00A61E930F1FE3@gctsemi.gctsemi.com>
>>>>> "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