* GDB stub question?
@ 2006-04-24 7:21 Inder
[not found] ` <a1029acd0604232313t7e0bb829ia325f3e658fc34e9@mail.gmail.com>
0 siblings, 1 reply; 6+ messages in thread
From: Inder @ 2006-04-24 7:21 UTC (permalink / raw)
To: gdb
--
Thanks,
Inder
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GDB stub question?
[not found] ` <a1029acd0604240126g4c766d1ft3e5ecf2c69d781e@mail.gmail.com>
@ 2006-04-24 12:23 ` Inder
[not found] ` <20060424121630.GA19787@nevyn.them.org>
0 siblings, 1 reply; 6+ messages in thread
From: Inder @ 2006-04-24 12:23 UTC (permalink / raw)
To: gdb
Hi Ramana
The stub is capable of single steping but can only step one
instruction at a time, when debugging C code, the next or step should
acutally step to the next source line, but in my case for every next
or step i am only able to step one instruction.
The stub has no information about the source lines so the host is
capable of doing this, by reading the debug info.
Communication between my GDB host and the target is like
>>> when GDB is connected to the target
Host - +$Hc-1#09
Target Reply- +$OK#9a|
Host - +$qC#b4
Target Reply- +$#00|
Host - +$qOffsets#4b
Target Reply- +$#00|
Host - +$?#3f
Target Reply- +$S12#b6|
Host - +
Host - $Hg0#df
Target Reply- +$OK#9a|
Host - +$pf#d6
Target Reply- +$#00|
Host - +$g#67
Target Reply- +$020000007c03|
Target Reply- 8500a8224d0001|
Target Reply- 00000056f38400|
Target Reply- a8ee8400000000|
Target Reply- 00000000000000|
Target Reply- 00000000000000|
Target Reply- 00000078038500|
Target Reply- 7c038500140385|
Target Reply- 0030df3700a08e|
Target Reply- 00001f0000201f|
Target Reply- 000020#96|
Host - +
Host - $m8ea0,4#fb
Target Reply- +$64004be2#f7|
Host - +
Host - $qSymbol::#5b
Target Reply- +$#00|
Host - +
>> i am connected to the target
>> after the step command
Host - $vCont?#49
Target Reply- +$#00|
Host - +$Hc0#db
Target Reply- +$OK#9a|
Host - +$S12#b6
Target Reply- +|
Target Reply- $S12#b6|
this S12 packet is a single step with a signal packet which in my case only
steps one instructions.
Is there any packed which i need to support in order to support source stepping?
Thanks
Inder.
On 4/24/06, Ramana Radhakrishnan <ramana.radhakrishnan@codito.com> wrote:
> This means your stub is capable of doing single stepping by itself. S12
> would mean give signal 12 to the debuggee.
>
> >From the manual ->
>
> `S'SIG`;'ADDR -- step with signal
> Like `C' but step not continue.
>
> If you need more help show a complete log of the remote protocol for the
> steps you did and the behaviour you expected / observed.
>
>
> - Ramana
>
> On Mon, 2006-04-24 at 11:43 +0530, Inder wrote:
> > Hi All
> >
> > I have ported a GDB stub for ARM based system, but when i tried doing
> > source stepping GDB (GDB 6.4) host sends the following packet to the
> > target system:
> >
> > ---> $S12#b6
> >
> > which tell the target to actually do a single instruction step. I
> > believe in the previous versions of GDB source stepping was done by
> > setting the breakpoint to the next source line and then continue.
> >
> > Am i missing something here.
> >
> > Any help will be appriciated.
> >
> > --
> > Thanks,
> > Inder
>
>
--
Thanks,
Inder
--
Thanks,
Inder
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GDB stub question?
[not found] ` <20060424121630.GA19787@nevyn.them.org>
@ 2006-04-24 15:48 ` Inder
[not found] ` <20060424123222.GA20402@nevyn.them.org>
0 siblings, 1 reply; 6+ messages in thread
From: Inder @ 2006-04-24 15:48 UTC (permalink / raw)
To: Inder, gdb
It just stops after a single instruction step, and the source line
does not change.
Could it be a problem with the debug info?
My object file does contain line number information.
any pointers might be helpful here.
Thanks
Inder.
On 4/24/06, Daniel Jacobowitz <drow@false.org> wrote:
> On Mon, Apr 24, 2006 at 01:59:02PM +0530, Inder wrote:
> > Hi Ramana
> >
> > The stub is capable of single steping but can only step one
> > instruction at a time, when debugging C code, the next or step should
> > acutally step to the next source line, but in my case for every next
> > or step i am only able to step one instruction.
> >
> > The stub has no information about the source lines so the host is
> > capable of doing this, by reading the debug info.
>
> What's going wrong then? GDB implements source level single stepping
> by doing instruction level single stepping until the source line
> changes.
>
> --
> Daniel Jacobowitz
> CodeSourcery
>
--
Thanks,
Inder
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GDB stub question?
[not found] ` <20060424123222.GA20402@nevyn.them.org>
@ 2006-04-26 14:03 ` Inder
[not found] ` <20060426123642.GA18007@nevyn.them.org>
0 siblings, 1 reply; 6+ messages in thread
From: Inder @ 2006-04-26 14:03 UTC (permalink / raw)
To: gdb
Hi Daniel
Thanks for your responce. The problem was with the signals received
from the target which promoted the inf to abort.
I do have another question, now GDB for single source stepping
receives control after every instruction step. This makes single
stepping very slow if you have a slow serial interface.
Is there any way we could revert back to the old way (i.e)
- set breakpoint at the next address
- continue
- remove breakpoint.
Thanks
Inder.
On 4/24/06, Daniel Jacobowitz <drow@false.org> wrote:
> On Mon, Apr 24, 2006 at 05:53:05PM +0530, Inder wrote:
> > It just stops after a single instruction step, and the source line
> > does not change.
> > Could it be a problem with the debug info?
> > My object file does contain line number information.
> > any pointers might be helpful here.
>
> Try "set debug infrun 1". If that doesn't help, try debugging GDB to
> see why handle_inferior_event stopped.
>
> --
> Daniel Jacobowitz
> CodeSourcery
>
--
Thanks,
Inder
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GDB stub question?
[not found] ` <20060426123642.GA18007@nevyn.them.org>
@ 2006-04-26 14:08 ` Paul Koning
2006-04-26 14:55 ` Daniel Jacobowitz
0 siblings, 1 reply; 6+ messages in thread
From: Paul Koning @ 2006-04-26 14:08 UTC (permalink / raw)
To: drow; +Cc: inderpreetb, gdb
>>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:
>> Is there any way we could revert back to the old way (i.e) - set
>> breakpoint at the next address - continue - remove breakpoint.
Daniel> GDB has never done this to implement source single stepping,
Daniel> so I don't know what you want. You can't predict the next
Daniel> address that far ahead; what if the current line contains a
Daniel> branch?
Isn't there a "target side single step" optional packet -- so if the
stub supports that then gdb can just say "stepi" rather than the more
laborious process of setting one or two breakpoints and doing a
continue?
Daniel> You might want to look at the T packet response if you aren't
Daniel> already using it; supplying a few registers there can make
Daniel> stepping much faster.
I did that with our MIPS target -- yes it helps a lot. I think you
need SP and (if relevant on the target) FP, and maybe PC. A good way
to tell whether it's right is to see if gdb still asks for registers
after it gets the T packet. If yes, then one of the registers it
wanted immediately wasn't in the T packet.
paul
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GDB stub question?
2006-04-26 14:08 ` Paul Koning
@ 2006-04-26 14:55 ` Daniel Jacobowitz
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2006-04-26 14:55 UTC (permalink / raw)
To: Paul Koning; +Cc: inderpreetb, gdb
On Wed, Apr 26, 2006 at 10:03:02AM -0400, Paul Koning wrote:
> >>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:
>
> >> Is there any way we could revert back to the old way (i.e) - set
> >> breakpoint at the next address - continue - remove breakpoint.
>
> Daniel> GDB has never done this to implement source single stepping,
> Daniel> so I don't know what you want. You can't predict the next
> Daniel> address that far ahead; what if the current line contains a
> Daniel> branch?
>
> Isn't there a "target side single step" optional packet -- so if the
> stub supports that then gdb can just say "stepi" rather than the more
> laborious process of setting one or two breakpoints and doing a
> continue?
It's not optional, really. GDB's configuration determines whether it
will be used or not. And he's already using it, as far as I can tell.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-04-26 14:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-24 7:21 GDB stub question? Inder
[not found] ` <a1029acd0604232313t7e0bb829ia325f3e658fc34e9@mail.gmail.com>
[not found] ` <1145862112.7595.5.camel@localhost.localdomain>
[not found] ` <a1029acd0604240126g4c766d1ft3e5ecf2c69d781e@mail.gmail.com>
2006-04-24 12:23 ` Inder
[not found] ` <20060424121630.GA19787@nevyn.them.org>
2006-04-24 15:48 ` Inder
[not found] ` <20060424123222.GA20402@nevyn.them.org>
2006-04-26 14:03 ` Inder
[not found] ` <20060426123642.GA18007@nevyn.them.org>
2006-04-26 14:08 ` Paul Koning
2006-04-26 14:55 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox