This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/12257] gdb ignore line "bar: if(foo)goto bar;"


http://sourceware.org/bugzilla/show_bug.cgi?id=12257

--- Comment #5 from Tom Tromey <tromey at redhat dot com> 2012-02-08 21:38:41 UTC ---
This seems to be a side effect of this code in handle_inferior_event:

  if ((stop_pc == stop_pc_sal.pc)
      && (ecs->event_thread->current_line != stop_pc_sal.line
       || ecs->event_thread->current_symtab != stop_pc_sal.symtab))
    {
      /* We are at the start of a different line.  So stop.  Note that
         we don't stop if we step into the middle of a different line.
         That is said to make things like for (;;) statements work
         better.  */
      if (debug_infrun)
     fprintf_unfiltered (gdb_stdlog,
                 "infrun: stepped to a different line\n");
      ecs->event_thread->control.stop_step = 1;
      print_end_stepping_range_reason ();
      stop_stepping (ecs);
      return;
    }

Here we have:

(top-gdb) p /x stop_pc
$26 = 0x40056a
(top-gdb) p /x stop_pc_sal.pc
$27 = 0x400569

So we skip this stop and instead keep going.

I am not sure whether that comment still makes sense.  It is present
in the initial public checkin of gdb, so I somewhat suspect it is
very out of date now.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]