[ECOS] Breakpoint problem

Jonathan Larmour jlarmour@redhat.com
Thu Feb 14 11:18:00 GMT 2002

"N.Suresh" wrote:
>     *)  When we execute (gdb)  b main
>            It is just doing some memory access ('m' packets) and
> updating it's internal data structures.


>     *)  When we execute (gdb) c
>            The host sends a 'Z' packet to actually put the breakpoint.
>            But we are not processing this inside the stub.

Why do you say that? Admittedly it does depend on whether the target
supports the Z packet. If it doesn't, then GDb should fall back to using
memory writes to set a breakpoint (i.e. 'M' packets).

> But even then
> the target stops at main and GDB prints the
>             line number properly.

So surely that shows that the breakpoint was set...

>     After hitting the breakpoint:
>     *)   When we execute (gdb) c     it is sending a 's' packet and our
> stub is executing the single_step function and
>      target gives some errors but if we continue the execution after
> that, "Hello World!" is printed. Any
>      breakpoints after that is not hit.
>     My questions are :
>      How the target is stopping even when we are not putting a
> breakpoint at the given location ?
>      Why is the host (gdb) sending 's' packet for the second continue
> command?

GDB always does that if you're stopped at a software breakpoint. It's so
that it can execute one instruction and *then* reinstate the breakpoint. If
it just set the breakpoint again immediately we would hit it immediately
and we execution wouldn't continue!

Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

More information about the Ecos-discuss mailing list