Re: Q: Bug in comment/code in record_full_resume?

Pedro Alves <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
On 12/10/2014 07:13 PM, Andreas From wrote:
> Hi,
> 
> I am thinking this is a bug - in the comment or in the code. Either way, 
> I am confused about this code.
> 
> At the first assignment - 'step = 1' - as indicated by the comment on 
> the line above, a normal continue should mean having step == 0. At the 
> second step assignment the comment and the assignment match in content.

Recording works by forcing the target to single-step all the way,
and recording side effects at each single-step.

So here:

>        if (!step)

... GDB core told the target to continue ...

>          {
>            /* This is not hard single step.  */
>            if (!gdbarch_software_single_step_p (gdbarch))

... and the target/arch doesn't need software single-step, so ...

>              {
>                /* This is a normal continue.  */
>                step = 1;

... we can ask the target to do the single-step for us.  "step" is
passed to the target beneath a bit further below:

      ops->beneath->to_resume (ops->beneath, ptid, step, signal);

>              }

Thanks,
Pedro Alves
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.