Received: (at submit) by bugs.debian.org; 17 Feb 2000 17:20:42 +0000 Received: (qmail 9273 invoked from network); 17 Feb 2000 17:20:41 -0000 Received: from vertex.london.excite.com (194.216.238.11) by master.debian.org with SMTP; 17 Feb 2000 17:20:41 -0000 Received: from dhcp-84.london.excite.com (hell.london.excite.com) [194.216.238.84] (mail) by vertex.london.excite.com with esmtp (Exim 3.12 #1 (Debian)) id 12LUbQ-000396-00; Thu, 17 Feb 2000 17:20:32 +0000 Received: from shaslam by hell.london.excite.com with local (Exim 3.12 #1 (Debian)) id 12LUbP-0000ES-00; Thu, 17 Feb 2000 17:20:31 +0000 From: shaslam To: Debian Bug Tracking System Subject: can't "p environ" X-Reportbug-Version: 0.48 X-Mailer: reportbug 0.48 Date: Thu, 17 Feb 2000 17:20:31 +0000 Message-Id: Sender: Steve Haslam Package: gdb Version: 4.18.19990928-1 Severity: normal I wrote envstuff.c: #include #include extern char **environ; int main(int argc, char **argv, char **env) { printf("argc=%d argv=%p env=%p environ=%p\n", argc, argv, env, environ); exit(0); } and compiled it (gcc -ggdb envstuff.c -o envstuff) It produces this output: bash$ ./envstuff argc=1 argv=0xbffff8d4 env=0xbffff8dc environ=0xbffff8dc but when in gdb, I get: (gdb) b main Breakpoint 1 at 0x8048486: file envstuff.c, line 8. (gdb) r Starting program: /usr/home/shaslam/perltest/envstuff Breakpoint 1, main (argc=1, argv=0xbffff8c4, env=0xbffff8cc) at envstuff.c:8 8 printf("argc=%d argv=%p env=%p environ=%p\n", argc, argv, env, environ); (gdb) p env $1 = (char **) 0xbffff8cc (gdb) p environ $2 = (char **) 0x0 ? bash$ gcc -v Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs gcc version 2.95.2 20000116 (Debian GNU/Linux) SRH -- System Information Debian Release: 2.2 Architecture: i386 Kernel: Linux hell 2.2.14 #1-DellLatCPi Thu Jan 6 20:47:36 GMT 2000 i686 Versions of packages gdb depends on: ii libc6 2.1.3-2 GNU C Library: Shared libraries an ii libncurses4 4.2-8 Shared libraries for terminal hand