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/15955] New: gdb sometimes shows incorrect values for variables


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]