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/20397] New: Singlestepping continues way beyond where it should.


https://sourceware.org/bugzilla/show_bug.cgi?id=20397

            Bug ID: 20397
           Summary: Singlestepping continues way beyond where it should.
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: dje at google dot com
  Target Milestone: ---

I have a function where gcc has emitted two prologues with one line number
record. When I step on a line that has a conditional branch to the second
prologue gdb keeps going right past it due to this code:

=>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");
      end_stepping_range (ecs);
      return;
    }

We've stepped into the "middle" of a line, but we definitely want to stop.

GCC trunk (as of today) doesn't AFAICT emit an "epilogue_begin" record, which
gdb could use to know to not apply the above heuristic here. Epilogues can be
combined/merged (one could be the tail of another), but all we need to know is
that we're in epilogue code.

If I can come up with a fileable example I'll add it.

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