From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32265 invoked by alias); 14 Sep 2013 06:25:08 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 32243 invoked by uid 48); 14 Sep 2013 06:25:08 -0000 From: "bhuvibhuvanesh at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/15955] New: gdb sometimes shows incorrect values for variables Date: Sat, 14 Sep 2013 06:25:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 7.6 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: bhuvibhuvanesh at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-q3/txt/msg00346.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=15955 Bug ID: 15955 Summary: gdb sometimes shows incorrect values for variables Product: gdb Version: 7.6 Status: NEW Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: bhuvibhuvanesh at gmail dot com Created attachment 7197 --> https://sourceware.org/bugzilla/attachment.cgi?id=7197&action=edit demo c code used to showcase the bug. variable which is displayed wrong = optind When printing the values for varaiables gdb sometimes shows wrong values. Not sure under what conditions this occurs, attached the demo c code where this happens. gdb always shows the vaule of optind varable as 1, while the printf statement in the code shows otherwise. run the code with (gdb)break main (gdb)run -o file1 file2 file3 and step through the code until you reach the for loop and check the value of optind variable, it shous 1,where it should be 3. (gdb)print optind gdb version details: GNU gdb (GDB) 7.6 (Debian 7.6-5) gdb configuartion : x86_64-linux-gnu Distro used : Debian testing Can also confirm this is in version 7.5 and also in 32bit version. -- You are receiving this mail because: You are on the CC list for the bug.