Q: Bug in comment/code in record_full_resume?

Andreas From <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
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.

BR,
Andreas


static void
record_full_resume (struct target_ops *ops, ptid_t ptid, int step,
                     enum gdb_signal signal)
{
   record_full_resume_step = step;
   record_full_resumed = 1;
   record_full_execution_dir = execution_direction;

   if (!RECORD_FULL_IS_REPLAY)
     {
       struct gdbarch *gdbarch = target_thread_architecture (ptid);

       record_full_message (get_current_regcache (), signal);

       if (!step)
         {
           /* This is not hard single step.  */
           if (!gdbarch_software_single_step_p (gdbarch))
             {
               /* This is a normal continue.  */
               step = 1;
             }
           else
             {
               /* This arch support soft sigle step.  */
               if (thread_has_single_step_breakpoints_set 
(inferior_thread ()))
                 {
                   /* This is a soft single step.  */
                   record_full_resume_step = 1;
                 }
               else
                 {
                   /* This is a continue.
                      Try to insert a soft single step breakpoint.  */
                   if (!gdbarch_software_single_step (gdbarch,
                                                      get_current_frame ()))
                     {
                       /* This system don't want use soft single step.
                          Use hard sigle step.  */
                       step = 1;
                     }
                 }
             }
         }

...
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.