public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: arijit79@gmail.com
Cc: gdb@sourceware.org
Subject: Re: How to portably print out Env of a Process
Date: Sat, 17 Jun 2006 20:00:00 -0000	[thread overview]
Message-ID: <200606171914.k5HJEJGY032428@elgar.sibelius.xs4all.nl> (raw)
In-Reply-To: <5f3d30900605222046t810dd4cue180cba7b0541fa7@mail.gmail.com> 	(arijit79@gmail.com)

> X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on 
> 	elgar.sibelius.xs4all.nl
> X-Spam-Level: 
> X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=failed 
> 	version=3.1.1
> Date: Tue, 23 May 2006 09:16:42 +0530
> From: "Arijit Das" <arijit79@gmail.com>
> Content-Disposition: inline
> X-IsSubscribed: yes
> Mailing-List: contact gdb-help@sourceware.org; run by ezmlm
> Sender: gdb-owner@sourceware.org
> X-UTwente-MailScanner-Information: Scanned by MailScanner. Contact helpdesk@ITBE.utwente.nl for more information.
> X-UTwente-MailScanner: Found to be clean
> X-UTwente-MailScanner-SpamScore: s
> X-UTwente-MailScanner-From: gdb-return-25381-m.m.kettenis=alumnus.utwente.nl@sourceware.org
> X-XS4ALL-DNSBL-Checked: mxdrop44.xs4all.nl checked 130.89.2.8 against DNS blacklists
> X-Virus-Scanned: by XS4ALL Virus Scanner
> X-XS4ALL-Spam-Score: 0.401 () FROM_ENDS_IN_NUMS,HTML_MESSAGE
> X-XS4ALL-Spam: NO
> Envelope-To: mark.kettenis@xs4all.nl
> X-MIME-Autoconverted: from quoted-printable to 8bit by mxdrop44.xs4all.nl id k4N3lNcQ019572
> X-UIDL: 1148356045._smtp.mxdrop44.19580,S=3409
> 
> 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 = 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 = 0xffffffffbfffc790 <Address 0xffffffffbfffc790 out of bounds>
> (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?
> 

Make sure you install libc with full debug info.  It looks like you're
using Linux.  Debian has packages with the necessary debug info.
Other distros might not.  If your distro does not provide such
packages please complain.

Cheers,

Mark

  parent reply	other threads:[~2006-06-17 19:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-23 13:05 Arijit Das
2006-05-23 18:32 ` Bob Rossi
2006-05-23 22:07   ` Daniel Jacobowitz
2006-05-24  9:16     ` Arijit Das
2006-07-12 16:56       ` Daniel Jacobowitz
2006-06-17 20:00 ` Mark Kettenis [this message]
2006-07-12 16:39   ` Daniel Jacobowitz
2006-07-16 16:48     ` Mark Kettenis
2006-07-17  0:57       ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200606171914.k5HJEJGY032428@elgar.sibelius.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=arijit79@gmail.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).