This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
gdb/346: gdb confused about line numbers
- From: robs at cruzio dot com
- To: gdb-gnats at sources dot redhat dot com
- Date: 10 Feb 2002 00:48:12 -0000
- Subject: gdb/346: gdb confused about line numbers
- Reply-to: robs at cruzio dot com
>Number: 346
>Category: gdb
>Synopsis: gdb confused about line numbers
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Feb 09 16:58:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Rob Stevens
>Release: unknown-1.0
>Organization:
>Environment:
RedHat 7.2
>Description:
The debugger seems to be hopeless confused about the line numbers in the source code.
Here is an example:
stepping with "next":
149 int cktype=CHECKTIM,errors=0,i, mod, bangf, ownf, safef,
diff, nsys;(gdb)
159 lbl0();
(gdb)
160 printf("setrecv: process received files ...\n");
(gdb)
163 for(argv++; --argc > 0 && argv[0][0]=='-'; argv++) {
(gdb)
160 printf("setrecv: process received files ...\n");
(gdb)
setrecv: process received files ...
163 for(argv++; --argc > 0 && argv[0][0]=='-'; argv++) {
The printf statement at line 160 is hit twice (according
to gdb) with no branch to make that happen. The first report at line 160
is bogus because the program being debugged doesn't print anything.
Only the second line160 trace is correct.
This behavior isn't confined to a single executable. I have replicated on others. It seems to be connected with the presence of an open brace, '{', which is not on a line by itself
Details:
gdb-5.1.1 build from sources:
configure
. ...
system reported as i686-pc-linux-gnu
compiled with gcc-2.96
OS is RedHat Linux 7.2 (Linux kernel 2.4.7)
Also occurred on gdb-5.1.0 installed as binary.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: