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 breakpoints/12932] New: Incorrent code line number onbreakpoint set by function name


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

           Summary: Incorrent code line number on breakpoint set by
                    function name
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: breakpoints
        AssignedTo: unassigned@sourceware.org
        ReportedBy: jimenezrick@gmail.com


Created attachment 5820
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5820
Test case

*Tested on GDB 7.3.50.20110624 x86_64*

In the next code, add a breakpoint in the function `f' with
the command `break f'. The breakpoint is placed after the
last brace of `for (;;)' which is wrong. It makes bypass the
first iteration of the loop. When the breakpoint is hit then i=1:

=================================================
void f(char *s, int i)
{
        for (;;) {
                if (s[i++] == '\n')
                        break;
        } <--- breakpoint set here with `break f'
               with i=1
}

int main(int argc, char *argv[])
{
        char buf[] = "0123456789\n";

        f(buf, 0);

        return 0;
}
=================================================

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