I'm getting a SEGV now whenever I step after setting record on for my target (the built-in moxie simulator). It's happening in the first line of watchpoints_triggered(), where the code reads: int stopped_by_watchpoint = target_stopped_by_watchpoint (); target_stopped_by_watchpoint is defined as (*current_target.to_stopped_by_watchpoint). The problem is that current_target.to_stopped_by_watchpoint is NULL. This has something to do with how the record and simulator targets interact. Normal breakpoints (w/o record) are working fine. AG
Thanks Anthony. Hello everybody, Now I have 2 ways to handle this issue: 1. Add a check to record.c when it call to_stopped_by_watchpoint 2. Add a default value for to_stopped_by_watchpoint to init_dummy_target. Which way for us it better? Thanks, Hui
(In reply to comment #1) > Thanks Anthony. > > Hello everybody, > > Now I have 2 ways to handle this issue: > 1. Add a check to record.c when it call to_stopped_by_watchpoint > 2. Add a default value for to_stopped_by_watchpoint to init_dummy_target. > > Which way for us it better? My guess is [2]. Thanks! AG
Subject: Re: SEGV during reverse debugging w/ record target over simulator Hi Anthony, I make a patch for it. Please help me test it. Thanks, Hui 2010-02-08 Hui Zhu <teawater@gmail.com> * target.c (init_dummy_target): Add to_stopped_by_watchpoint. --- target.c | 1 + 1 file changed, 1 insertion(+) --- a/target.c +++ b/target.c @@ -2836,6 +2836,7 @@ init_dummy_target (void) dummy_target.to_has_stack = (int (*) (struct target_ops *)) return_zero; dummy_target.to_has_registers = (int (*) (struct target_ops *)) return_zero; dummy_target.to_has_execution = (int (*) (struct target_ops *)) return_zero; + dummy_target.to_stopped_by_watchpoint = return_zero; dummy_target.to_magic = OPS_MAGIC; }
Subject: Re: SEGV during reverse debugging w/ record target over simulator Ping. On Mon, Feb 8, 2010 at 13:44, Hui Zhu <teawater@gmail.com> wrote: > Hi Anthony, > > I make a patch for it. > > Please help me test it. > > Thanks, > Hui > > 2010-02-08 Hui Zhu <teawater@gmail.com> > > * target.c (init_dummy_target): Add to_stopped_by_watchpoint. > --- > target.c | 1 + > 1 file changed, 1 insertion(+) > > --- a/target.c > +++ b/target.c > @@ -2836,6 +2836,7 @@ init_dummy_target (void) > dummy_target.to_has_stack = (int (*) (struct target_ops *)) return_zero; > dummy_target.to_has_registers = (int (*) (struct target_ops *)) return_zero; > dummy_target.to_has_execution = (int (*) (struct target_ops *)) return_zero; > + dummy_target.to_stopped_by_watchpoint = return_zero; > dummy_target.to_magic = OPS_MAGIC; > } >
Subject: Re: SEGV during reverse debugging w/ record target =?iso-8859-1?q?=09over?= simulator On Saturday 20 February 2010 05:55:57, Hui Zhu wrote: > Ping. > > On Mon, Feb 8, 2010 at 13:44, Hui Zhu <teawater@gmail.com> wrote: > > Hi Anthony, > > > > I make a patch for it. > > > > Please help me test it. > > > > Thanks, > > Hui > > > > 2010-02-08 Hui Zhu <teawater@gmail.com> > > > > * target.c (init_dummy_target): Add to_stopped_by_watchpoint. > > --- > > target.c | 1 + > > 1 file changed, 1 insertion(+) > > > > --- a/target.c > > +++ b/target.c > > @@ -2836,6 +2836,7 @@ init_dummy_target (void) > > dummy_target.to_has_stack = (int (*) (struct target_ops *)) return_zero; > > dummy_target.to_has_registers = (int (*) (struct target_ops *)) return_zero; > > dummy_target.to_has_execution = (int (*) (struct target_ops *)) return_zero; > > + dummy_target.to_stopped_by_watchpoint = return_zero; > > dummy_target.to_magic = OPS_MAGIC; > > } > > > Does this actually fix the problem? How?
Patch wait Green's test.
(In reply to comment #3) > Subject: Re: SEGV during reverse debugging w/ record target > over simulator > > Hi Anthony, > > I make a patch for it. > > Please help me test it. > This patch appears to fix the problem. Thanks! AG
Wait review.
Fixed in cvs-head.