Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Re: Remote breakpoint problem
@ 2003-02-14 16:28 Jan Hoogerbrugge
  2003-02-14 16:34 ` Daniel Jacobowitz
  2003-02-14 16:36 ` Mark Salter
  0 siblings, 2 replies; 6+ messages in thread
From: Jan Hoogerbrugge @ 2003-02-14 16:28 UTC (permalink / raw)
  To: msalter, ac131313; +Cc: gdb

>From: Mark Salter <msalter@redhat.com>
>To: ac131313@redhat.com
> >>>>> Andrew Cagney writes:
>
> >> Hi,
> >>
> >> I am porting gdb to a new target processor were remote debugging is 
>used. I have a problem with breakpoints. When I place a breakpoint on foo 
>followed by a continue I see the following communication between gdb and 
>the stub on the other side:
> >>
> >> - the instruction at foo is saved
> >> - foo is replaced by a breakpoint instruction
> >> - gdb sends a continue command
> >> - the stub reports the breakpoint hit (signal = 5, pc = foo)
> >> - gdb replaces the code at foo with the saved instruction
> >> - gdb sends a step instruction command
> >> - tbe stub reports again a breakpoint hit at foo (signal = 5, pc = foo)
>
> > Shouldn't this stop beyond foo?
>
>I wonder if the stub is flushing the icache after gdb puts the
>saved instruction back...

Caches are properly syncronisched. The respone of the remote target and its 
stub is correct as far as I can see. It is gdb that issues a continue 
command to the stub after hitting the breakpoint and single stepping the 
instruction on which teh breakpoint was placed.

This is what gccint.texinfo says:
>Software breakpoints require @value{GDBN} to do somewhat more work.
>The basic theory is that @value{GDBN} will replace a program
>instruction with a trap, illegal divide, or some other instruction
>that will cause an exception, and then when it's encountered,
>@value{GDBN} will take the exception and stop the program.  When the
>user says to continue, @value{GDBN} will restore the original
>instruction, single-step, re-insert the trap, and continue on.

Cheers,
Jan

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Remote breakpoint problem
  2003-02-14 16:28 Remote breakpoint problem Jan Hoogerbrugge
@ 2003-02-14 16:34 ` Daniel Jacobowitz
  2003-02-14 16:36 ` Mark Salter
  1 sibling, 0 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2003-02-14 16:34 UTC (permalink / raw)
  To: Jan Hoogerbrugge; +Cc: msalter, ac131313, gdb

On Fri, Feb 14, 2003 at 05:28:43PM +0100, Jan Hoogerbrugge wrote:
> >From: Mark Salter <msalter@redhat.com>
> >To: ac131313@redhat.com
> >>>>>> Andrew Cagney writes:
> >
> >>> Hi,
> >>>
> >>> I am porting gdb to a new target processor were remote debugging is 
> >used. I have a problem with breakpoints. When I place a breakpoint on foo 
> >followed by a continue I see the following communication between gdb and 
> >the stub on the other side:
> >>>
> >>> - the instruction at foo is saved
> >>> - foo is replaced by a breakpoint instruction
> >>> - gdb sends a continue command
> >>> - the stub reports the breakpoint hit (signal = 5, pc = foo)
> >>> - gdb replaces the code at foo with the saved instruction
> >>> - gdb sends a step instruction command
> >>> - tbe stub reports again a breakpoint hit at foo (signal = 5, pc = foo)
> >
> >> Shouldn't this stop beyond foo?
> >
> >I wonder if the stub is flushing the icache after gdb puts the
> >saved instruction back...
> 
> Caches are properly syncronisched. The respone of the remote target and its 
> stub is correct as far as I can see. It is gdb that issues a continue 
> command to the stub after hitting the breakpoint and single stepping the 
> instruction on which teh breakpoint was placed.

If you single-step over the instruction at foo, and the stub reports a
stop at foo, something is wrong.  You're stopped at the _following_
instruction.


-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Remote breakpoint problem
  2003-02-14 16:28 Remote breakpoint problem Jan Hoogerbrugge
  2003-02-14 16:34 ` Daniel Jacobowitz
@ 2003-02-14 16:36 ` Mark Salter
  1 sibling, 0 replies; 6+ messages in thread
From: Mark Salter @ 2003-02-14 16:36 UTC (permalink / raw)
  To: hoogerbrugge; +Cc: gdb

>>>>> Jan Hoogerbrugge writes:

>> From: Mark Salter <msalter@redhat.com>
>> To: ac131313@redhat.com
>> >>>>> Andrew Cagney writes:
>> 
>> >> Hi,
>> >>
>> >> I am porting gdb to a new target processor were remote debugging is 
>> used. I have a problem with breakpoints. When I place a breakpoint on foo 
>> followed by a continue I see the following communication between gdb and 
>> the stub on the other side:
>> >>
>> >> - the instruction at foo is saved
>> >> - foo is replaced by a breakpoint instruction
>> >> - gdb sends a continue command
>> >> - the stub reports the breakpoint hit (signal = 5, pc = foo)
>> >> - gdb replaces the code at foo with the saved instruction
>> >> - gdb sends a step instruction command
>> >> - tbe stub reports again a breakpoint hit at foo (signal = 5, pc = foo)
>> 
>> > Shouldn't this stop beyond foo?
>> 
>> I wonder if the stub is flushing the icache after gdb puts the
>> saved instruction back...

> Caches are properly syncronisched. The respone of the remote target and its 
> stub is correct as far as I can see. It is gdb that issues a continue 
> command to the stub after hitting the breakpoint and single stepping the 
> instruction on which teh breakpoint was placed.

But there is no breakpoint in place when gdb sends the step instruction.

>> >> - gdb replaces the code at foo with the saved instruction
>> >> - gdb sends a step instruction command
>> >> - tbe stub reports again a breakpoint hit at foo (signal = 5, pc = foo)

So, why did the stub report that it stopped at foo, rather than the
next instruction.

--Mark



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Remote breakpoint problem
  2003-02-14 14:19 ` Andrew Cagney
@ 2003-02-14 14:26   ` Mark Salter
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Salter @ 2003-02-14 14:26 UTC (permalink / raw)
  To: ac131313; +Cc: hoogerbrugge, gdb

>>>>> Andrew Cagney writes:

>> Hi,
>> 
>> I am porting gdb to a new target processor were remote debugging is used. I have a problem with breakpoints. When I place a breakpoint on foo followed by a continue I see the following communication between gdb and the stub on the other side:
>> 
>> - the instruction at foo is saved
>> - foo is replaced by a breakpoint instruction
>> - gdb sends a continue command
>> - the stub reports the breakpoint hit (signal = 5, pc = foo)
>> - gdb replaces the code at foo with the saved instruction
>> - gdb sends a step instruction command
>> - tbe stub reports again a breakpoint hit at foo (signal = 5, pc = foo)

> Shouldn't this stop beyond foo?

I wonder if the stub is flushing the icache after gdb puts the
saved instruction back...

--Mark





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Remote breakpoint problem
  2003-02-14 12:30 Jan Hoogerbrugge
@ 2003-02-14 14:19 ` Andrew Cagney
  2003-02-14 14:26   ` Mark Salter
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Cagney @ 2003-02-14 14:19 UTC (permalink / raw)
  To: Jan Hoogerbrugge; +Cc: gdb

> Hi,
> 
> I am porting gdb to a new target processor were remote debugging is used. I have a problem with breakpoints. When I place a breakpoint on foo followed by a continue I see the following communication between gdb and the stub on the other side:
> 
> - the instruction at foo is saved
> - foo is replaced by a breakpoint instruction
> - gdb sends a continue command
> - the stub reports the breakpoint hit (signal = 5, pc = foo)
> - gdb replaces the code at foo with the saved instruction
> - gdb sends a step instruction command
> - tbe stub reports again a breakpoint hit at foo (signal = 5, pc = foo)

Shouldn't this stop beyond foo?

> - gdb sends a continue command immediatly
> 
> So a breakpoint is detected and communicated to gdb but gdb lets the application continue immediately without giving control to the gdb user. Does anyone know what is wrong?
> 
> I have used breakpoint_from_pc function to supply the breakpoint code.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Remote breakpoint problem
@ 2003-02-14 12:30 Jan Hoogerbrugge
  2003-02-14 14:19 ` Andrew Cagney
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Hoogerbrugge @ 2003-02-14 12:30 UTC (permalink / raw)
  To: gdb

Hi,

I am porting gdb to a new target processor were remote debugging is used. I 
have a problem with breakpoints. When I place a breakpoint on foo followed 
by a continue I see the following communication between gdb and the stub on 
the other side:

- the instruction at foo is saved
- foo is replaced by a breakpoint instruction
- gdb sends a continue command
- the stub reports the breakpoint hit (signal = 5, pc = foo)
- gdb replaces the code at foo with the saved instruction
- gdb sends a step instruction command
- tbe stub reports again a breakpoint hit at foo (signal = 5, pc = foo)
- gdb sends a continue command immediatly

So a breakpoint is detected and communicated to gdb but gdb lets the 
application continue immediately without giving control to the gdb user. 
Does anyone know what is wrong?

I have used breakpoint_from_pc function to supply the breakpoint code.

Thanks,
Jan





_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-02-14 16:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-14 16:28 Remote breakpoint problem Jan Hoogerbrugge
2003-02-14 16:34 ` Daniel Jacobowitz
2003-02-14 16:36 ` Mark Salter
  -- strict thread matches above, loose matches on Subject: below --
2003-02-14 12:30 Jan Hoogerbrugge
2003-02-14 14:19 ` Andrew Cagney
2003-02-14 14:26   ` Mark Salter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox