This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: exp/1837: Printing value of structs comprising components of pointer and long long type


The following reply was made to PR exp/1837; it has been noted by GNATS.

From: Mark kettenis <kettenis@gnu.org>
To: gdb-gnats@sources.redhat.com, westphal@informatik.uni-oldenburg.de
Cc:  
Subject: Re: exp/1837: Printing value of structs comprising components of pointer and long long type
Date: Thu, 30 Dec 2004 14:44:48 +0100 (CET)

 I can't quite reproduce this on my i386-unknown-freebsd4.7 system.  I
 suspect this is either a bug in your compiler, or an artifact of an
 optimization by the compiler (even though you didn't ask for the
 compiler to optimize anything).  What's probably happening is that
 when you're issuing the 'p x' command, the stack frame is already in
 the process of being torn down.  I get similar behaviour with gcc
 2.95.4 if I issue a `stepi' command on the return statement and then
 use the 'p x' command.  The problem here is that since you don't
 actually use the variable x in the program beyond the point where you
 issue the 'p x' command, there is no reason why the variable should
 still contain its origional contents.  (Notice that compiling with -O2
 completely optimizes away the variable x).
 
 Could you repeat your little experiment, while issueing a 'p x' after
 each 'n' command?
 
 Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]