Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:2355 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68983 invoked from network); 17 Jun 2003 18:53:00 -0000 Received: from unknown (HELO web21205.mail.yahoo.com) (216.136.131.248) by pb1.pair.com with SMTP; 17 Jun 2003 18:53:00 -0000 Message-ID: <20030617185259.52415.qmail@web21205.mail.yahoo.com> Received: from [67.30.104.134] by web21205.mail.yahoo.com via HTTP; Tue, 17 Jun 2003 11:52:59 PDT Date: Tue, 17 Jun 2003 11:52:59 -0700 (PDT) To: internals@lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: gdb php5 broken? gdb reading values for variables from wrong addresses From: golden_moon_rising@yahoo.com (Henry) Hi, I'm running gdb 5.3 under Red Hat 7.2 (up2date'd) on php5 CGI with the "broken" RH 2.96-112.7.2 gcc. However, when I try to print variables within gdb, gdb tries to print variables using the wrong addresses in VM (off by a some hundreds of bytes). I can add code to the source code such that I know things are working, but gdb just gives me garbage back when I use the "print" or "display" commands, since its reading values from the wrong addresses. It shows the right source code, and appears to step through the correct lines of code based on the input. Any idea what I've done wrong? I'm compiling php5 with --enable-debug, and CFLAGS -g (no -O), but gdb is clearly messed up in figuring out where the symbols are in the stack, even when I set a breakpoint at main(). Example output showing that program works, and gdb doesn't (added near the top of cgi_main.c): gdb /usr/local/php/bin/php . . 951 printf(" argv[0]=%s \n argv[1]=%s \n &argv=%lx \n *argv=%s\n", argv[0], argv[1], &argv, *argv); (gdb) argv[0]=/usr/local/php/bin/php argv[1]=-b &argv=bffff5b4 <=====program output shows real location *argv=/usr/local/php/bin/php (gdb) print argv $6 = (char **) 0x0 (gdb) print (&argv) $1 = (char ***) 0xbffff7c0 <=====gdb should say "0xbffff5b4"! (gdb) print (*(char***) 0xbffff5b4) $3 = (char **) 0xbffff614 (gdb) print (*(char**) 0xbffff614) $5 = 0xbffffc1e "/usr/local/php/bin/php" ^^^^^^^^^^^^^^^^^^^^^^ So, I can show that argv is ok .. just not where gdb thinks it is. Nothing unexpected in the process "maps" file showing that argv, argc is in the usual segment: bfffd000-c0000000 rwxp ffffe000 00:00 0 Thanks, Henry __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com