public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* How to portably print out Env of a Process
@ 2006-05-23 13:05 Arijit Das
  2006-05-23 18:32 ` Bob Rossi
  2006-06-17 20:00 ` Mark Kettenis
  0 siblings, 2 replies; 9+ messages in thread
From: Arijit Das @ 2006-05-23 13:05 UTC (permalink / raw)
  To: gdb

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?

Thanks,
Arijit

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-07-17  0:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-23 13:05 How to portably print out Env of a Process 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
2006-07-12 16:39   ` Daniel Jacobowitz
2006-07-16 16:48     ` Mark Kettenis
2006-07-17  0:57       ` Daniel Jacobowitz

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).