From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5991 invoked by alias); 23 May 2006 03:46:58 -0000 Received: (qmail 5978 invoked by uid 22791); 23 May 2006 03:46:56 -0000 X-Spam-Check-By: sourceware.org Received: from wr-out-0506.google.com (HELO wr-out-0506.google.com) (64.233.184.237) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 23 May 2006 03:46:49 +0000 Received: by wr-out-0506.google.com with SMTP id i11so1229224wra for ; Mon, 22 May 2006 20:46:46 -0700 (PDT) Received: by 10.64.152.11 with SMTP id z11mr1474585qbd; Mon, 22 May 2006 20:46:42 -0700 (PDT) Received: by 10.65.224.3 with HTTP; Mon, 22 May 2006 20:46:42 -0700 (PDT) Message-ID: <5f3d30900605222046t810dd4cue180cba7b0541fa7@mail.gmail.com> Date: Tue, 23 May 2006 13:05:00 -0000 From: "Arijit Das" To: gdb@sourceware.org Subject: How to portably print out Env of a Process MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-05/txt/msg00334.txt.bz2 Hi, Is it possible to print out the env of a process portably with the same cmdline/script in different os/arch combinations? Here is how I tried to do it for i686 - RH3.0: (gdb) p (char *) getenv("HOME") [Switching to Thread 1024 (LWP 17639)] $1 =3D 0xdffff781 "/remote/vtghome7/arijit" (gdb) It worked fine. But when I tried executing this command in x86_64, I got strange results: (gdb) p (char *) getenv("HOME") [Switching to Thread 182901576896 (LWP 26427)] $1 =3D 0xffffffffbfffc790
(gdb) I guess some kind of 32/64 bits conversion might be messing things up here....but am not sure exactly what? Any help here? Thanks, Arijit