varobj/1956: argc is always 0
Sun Jun 5 01:58:00 GMT 2005

>Number:         1956
>Category:       varobj
>Synopsis:       argc is always 0
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jun 05 01:58:00 UTC 2005
>Release:        gdb v6.3
AMD64 Gentoo 2005
tux-gentoo flowlayout $ gdb ./flowlayout
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu"...Using host libthread_db library "/lib/".

(gdb) b main
Breakpoint 1 at 0x403bf0: file main.cpp, line 34.
(gdb) r 1 2 3 4
Starting program: /home/parag/qt-x11-opensource-4.0.0-rc1-snapshot-20050604/examples/layouts/flowlayout/flowlayout 1 2 3 4
[Thread debugging using libthread_db enabled]
[New Thread 46912531523776 (LWP 13010)]
[Switching to Thread 46912531523776 (LWP 13010)]

Breakpoint 1, main (argc=0, argv=0x7fffffffee38) at main.cpp:34
34      {
(gdb) print argc
As seen the argc value is wrong as shown by GDB. If I print out argc in the program that works fine.
Debug any program. Run with arguments. Check for value of argc - GDB shows it is always 0.


More information about the Gdb-prs mailing list