public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* mi-watch.exp fail, pls help
@ 2008-01-17  3:58 ligang
  2008-01-17 14:44 ` Daniel Jacobowitz
  0 siblings, 1 reply; 6+ messages in thread
From: ligang @ 2008-01-17  3:58 UTC (permalink / raw)
  To: gdb

hello all,

When i run gdb testsuite, mi-watch.exp fail.

See the following diassembly:

34:  C = A + B;
     116:   1742        lw!     r7, [r2,8]
     118:   1641        lw!     r6, [r2,4]
     11a:   80c7 1810   add     r6, r7, r6
     11e:   2640        sw!     r6, [r2,0]
35:  return 0;
     120:   64c0        ldiu!   r6, 0
36:}
     122:   4086        mv!     r4, r6
     124:   5c8c        addi!   r2, 12
     126:   4002        mv!     r0, r2
     128:   0042        pop!    r2
     12a:   0083        br!     r3

After setting watchpoint to C, it will be hit at 0x11e, and PC will be 
0x120 at the time,
but GDB will execute a single step, after that, PC will be 0x122, so 
source line will be 36 but not 
expected 35.
Anyone can tell me how to resolve this problem?
Thanks.

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

* Re: mi-watch.exp fail, pls help
  2008-01-17  3:58 mi-watch.exp fail, pls help ligang
@ 2008-01-17 14:44 ` Daniel Jacobowitz
  2008-01-18  4:26   ` ligang
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2008-01-17 14:44 UTC (permalink / raw)
  To: ligang; +Cc: gdb

On Thu, Jan 17, 2008 at 11:57:33AM +0800, ligang@sunnorth.com.cn wrote:
> After setting watchpoint to C, it will be hit at 0x11e, and PC will be 
> 0x120 at the time,
> but GDB will execute a single step, after that, PC will be 0x122, so 
> source line will be 36 but not 
> expected 35.
> Anyone can tell me how to resolve this problem?

Check your target configuration.  GDB thinks you have non-steppable
watchpoints, but you actually have continuable watchpoints.

-- 
Daniel Jacobowitz
CodeSourcery

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

* Re: mi-watch.exp fail, pls help
  2008-01-17 14:44 ` Daniel Jacobowitz
@ 2008-01-18  4:26   ` ligang
  2008-01-18 15:20     ` Daniel Jacobowitz
  0 siblings, 1 reply; 6+ messages in thread
From: ligang @ 2008-01-18  4:26 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb

Daniel Jacobowitz <drow@false.org> wrote on 2008-01-17 22:44:10:

> On Thu, Jan 17, 2008 at 11:57:33AM +0800, ligang@sunnorth.com.cn wrote:
> > After setting watchpoint to C, it will be hit at 0x11e, and PC will be 

> > 0x120 at the time,
> > but GDB will execute a single step, after that, PC will be 0x122, so 
> > source line will be 36 but not 
> > expected 35.
> > Anyone can tell me how to resolve this problem?
> 
> Check your target configuration.  GDB thinks you have non-steppable
> watchpoints, but you actually have continuable watchpoints.

After a watchpoint trap in my target, the PC points to the instruction 
after the one that caused the trap. 
But after stepping over the traped instruction(example store), my target 
increases PC to the next instruction, so,
the source line will not be correct. It occurs at whatever 
HAVE_NONSTEPPABLE_WATCHPOINT or HAVE_CONTINUABLE_WATCHPOINT.

Dose it mean that my target can not match the action of GDB?

> Daniel Jacobowitz
> CodeSourcery

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

* Re: mi-watch.exp fail, pls help
  2008-01-18  4:26   ` ligang
@ 2008-01-18 15:20     ` Daniel Jacobowitz
  2008-01-21  1:16       ` ligang
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2008-01-18 15:20 UTC (permalink / raw)
  To: ligang; +Cc: gdb

On Fri, Jan 18, 2008 at 12:25:43PM +0800, ligang@sunnorth.com.cn wrote:
> After a watchpoint trap in my target, the PC points to the instruction 
> after the one that caused the trap. 
> But after stepping over the traped instruction(example store), my target 
> increases PC to the next instruction, so,
> the source line will not be correct. It occurs at whatever 
> HAVE_NONSTEPPABLE_WATCHPOINT or HAVE_CONTINUABLE_WATCHPOINT.

If you have continuable watchpoints, GDB should not step after
hitting a watchpoint.  The store has already happened when the
watchpoint triggers, right?

-- 
Daniel Jacobowitz
CodeSourcery

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

* Re: mi-watch.exp fail, pls help
  2008-01-18 15:20     ` Daniel Jacobowitz
@ 2008-01-21  1:16       ` ligang
  2008-01-21  3:16         ` Daniel Jacobowitz
  0 siblings, 1 reply; 6+ messages in thread
From: ligang @ 2008-01-21  1:16 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb

Daniel Jacobowitz <drow@false.org> wrote on 2008-01-18 23:20:23:

> On Fri, Jan 18, 2008 at 12:25:43PM +0800, ligang@sunnorth.com.cn wrote:
> > After a watchpoint trap in my target, the PC points to the instruction 

> > after the one that caused the trap. 
> > But after stepping over the traped instruction(example store), my 
target 
> > increases PC to the next instruction, so,
> > the source line will not be correct. It occurs at whatever 
> > HAVE_NONSTEPPABLE_WATCHPOINT or HAVE_CONTINUABLE_WATCHPOINT.
> 
> If you have continuable watchpoints, GDB should not step after
> hitting a watchpoint.  The store has already happened when the
> watchpoint triggers, right?

The store triggers the watchpoint, but it does not execute.

> -- 
> Daniel Jacobowitz
> CodeSourcery

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

* Re: mi-watch.exp fail, pls help
  2008-01-21  1:16       ` ligang
@ 2008-01-21  3:16         ` Daniel Jacobowitz
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2008-01-21  3:16 UTC (permalink / raw)
  To: ligang; +Cc: gdb

On Mon, Jan 21, 2008 at 09:15:27AM +0800, ligang@sunnorth.com.cn wrote:
> The store triggers the watchpoint, but it does not execute.

GDB does not currently support watchpoints on any target that requires
the debugger to decrement PC after the watchpoint triggers.  You might
want to handle this in your debug stub, and pretend the PC was before
the store.

-- 
Daniel Jacobowitz
CodeSourcery

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

end of thread, other threads:[~2008-01-21  3:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-17  3:58 mi-watch.exp fail, pls help ligang
2008-01-17 14:44 ` Daniel Jacobowitz
2008-01-18  4:26   ` ligang
2008-01-18 15:20     ` Daniel Jacobowitz
2008-01-21  1:16       ` ligang
2008-01-21  3:16         ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).