Article View: gnu.gdb.bug
Article #2824Bug in gdb-5.1.1
From: Rob Stevens
Date: Mon, 28 Jan 2002 06:19
Date: Mon, 28 Jan 2002 06:19
42 lines
2246 bytes
2246 bytes
The debugger seems to be hopeless confused about the line numbers in the
source code.
Here is an example (you don't need the source code to understand that it
cannot be correct)
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++) {
As you can see 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 appears to happen with any programs on which I run gdb.
Here are 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)
What on earth is wrong here?? This must be a major snafu
Rob Stevens
Technical Details
Message-ID:
<3C54ED7E.6050104@cruzio.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!newsfeed.mathworks.com!portc01.blue.aol.com!uunet!dca.uu.net!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!bug-gdbShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f5053,eb8f486af346d14b,start X-Google-Attributes: gidf5053,public X-Google-ArrivalTime: 2002-01-27 22:18:07 PST x-uunet-gateway: mr0.ash.ops.us.uu.net from bug-gdb to gnu.gdb.bug; Mon, 28 Jan 2002 06:18:06 GMT Message-ID: <3C54ED7E.6050104@cruzio.com> Date: Sun, 27 Jan 2002 22:19:42 -0800 From: robs@cruzio.com (Rob Stevens) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901 X-Accept-Language: en-us MIME-Version: 1.0 Subject: Bug in gdb-5.1.1 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Approved: bug-gdb-request@mail.gnu.org Newsgroups: gnu.gdb.bug Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!newsfeed.mathworks.com!portc01.blue.aol.com!uunet!dca.uu.net!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!bug-gdb Sender: bug-gdb-request@mail.gnu.org Lines: 47