Re: [HACKERS] why was the VAR 'optind' never changed in initdb?

2012-04-09 Thread Clover White
2012/4/9 Robert Haas > On Mon, Apr 9, 2012 at 7:38 AM, Clover White > wrote: > > Hi, > > I'm debugging initdb using gdb. > > I found that I could not step in the function getopt_long in line 2572 > in > > initdb.c. > > I also found that the valu

Re: [HACKERS] why was the VAR 'optind' never changed in initdb?

2012-04-09 Thread Clover White
2012/4/9 Andrew Dunstan > > > On 04/09/2012 07:38 AM, Clover White wrote: > >> Hi, >> I'm debugging initdb using gdb. >> I found that I could not step in the function getopt_long in line 2572 >> in initdb.c. >> I also found that the value o

[HACKERS] why was the VAR 'optind' never changed in initdb?

2012-04-09 Thread Clover White
g_data" (gdb) n 2648if (optind < argc) (gdb) p optind $9 = 1 (gdb) p argc $10 = 6 (gdb) n 2654if (optind < argc) (gdb) p optind $11 = 1 (gdb) p argc $12 = 6 (gdb) n 2663if (pwprompt && pwfilename) (gdb) -- Clover White

[HACKERS] Is there any way to disable compiler optimization and enable debug?

2012-04-08 Thread clover white
HI, I would like to debug PG because I have a problem when I run initdb, and I have question about the configure file. when I used the command below to config PG, it was only built with debugging symbols (-g) and O2 compiler optimization which would lead to execute order not match the source cod