Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: Variable "foo" is not available
       [not found]         ` <20050424221155.GA13653@nevyn.them.org>
@ 2005-04-27 13:06           ` Eli Zaretskii
  2005-04-27 13:10             ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Eli Zaretskii @ 2005-04-27 13:06 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

> Date: Sun, 24 Apr 2005 18:11:55 -0400
> From: Daniel Jacobowitz <drow@false.org>
> 
> > > 2005-02-28  Daniel Jacobowitz  <dan@codesourcery.com>
> > > 
> > >         * dwarf2loc.c (loclist_read_variable): Set optimized_out
> > >         instead of reporting an error.
> > >         * valprint.c (value_check_printable): New function.
> > >         (common_val_print): New function.  Use value_check_printable.
> > >         (value_print): Use value_check_printable.
> > >         * value.h (common_val_print): Add prototype.
> > 
> > Daniel, I asked this before, but didn't see any replies: what would
> > the current GDB print when an argument from the function call is
> > optimized away?  I'd like to mention this in the manual.
> 
> Hi Eli,
> 
> Terribly sorry about not getting back to you since.  I've not had time
> to pull together a testcase to check, but it _should_ look like
> foo (a=<value optimized out>).  The message comes from
> value_check_printable in valprint.c.

Thanks.  I've committed the attached.

2005-04-27  Eli Zaretskii  <eliz@gnu.org>

	* gdb.texinfo (Backtrace): Describe backtraces with arguments that
	were optimized away.


Index: gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.247
retrieving revision 1.248
diff -u -r1.247 -r1.248
--- gdb.texinfo	22 Apr 2005 13:09:27 -0000	1.247
+++ gdb.texinfo	27 Apr 2005 13:02:13 -0000	1.248
@@ -4170,6 +4170,35 @@
 value, indicating that your program has stopped at the beginning of the
 code for line @code{993} of @code{builtin.c}.
 
+@cindex value optimized out, in backtrace
+@cindex function call arguments, optimized out
+If your program was compiled with optimizations, some compilers will
+optimize away arguments passed to functions if those arguments are
+never used after the call.  Such optimizations generate code that
+passes arguments through registers, but doesn't store those arguments
+in the stack frame.  @value{GDBN} has no way of displaying such
+arguments in stack frames other than the innermost one.  Here's what
+such a backtrace might look like:
+
+@smallexample
+@group
+#0  m4_traceon (obs=0x24eb0, argc=1, argv=0x2b8c8)
+    at builtin.c:993
+#1  0x6e38 in expand_macro (sym=<value optimized out>) at macro.c:242
+#2  0x6840 in expand_token (obs=0x0, t=<value optimized out>, td=0xf7fffb08)
+    at macro.c:71
+(More stack frames follow...)
+@end group
+@end smallexample
+
+@noindent
+The values of arguments that were not saved in their stack frames are
+shown as @samp{<value optimized out>}.
+
+If you need to display the values of such optimized-out arguments,
+either deduce that from other variables whose values depend on the one
+you are interested in, or recompile without optimizations.
+
 @cindex backtrace beyond @code{main} function
 @cindex program entry point
 @cindex startup code, and backtrace


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

* Re: Variable "foo" is not available
  2005-04-27 13:06           ` Variable "foo" is not available Eli Zaretskii
@ 2005-04-27 13:10             ` Daniel Jacobowitz
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2005-04-27 13:10 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

On Wed, Apr 27, 2005 at 04:03:47PM +0300, Eli Zaretskii wrote:
> Thanks.  I've committed the attached.
> 
> 2005-04-27  Eli Zaretskii  <eliz@gnu.org>
> 
> 	* gdb.texinfo (Backtrace): Describe backtraces with arguments that
> 	were optimized away.

Thank you!


-- 
Daniel Jacobowitz
CodeSourcery, LLC


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

end of thread, other threads:[~2005-04-27 13:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <v9mzsisb72.fsf@marauder.physik.uni-ulm.de>
     [not found] ` <20050401171947.GA19058@nevyn.them.org>
     [not found]   ` <01c53768$Blat.v2.4$d52008a0@zahav.net.il>
     [not found]     ` <20050402142639.GA27550@nevyn.them.org>
     [not found]       ` <01c54803$Blat.v2.4$d5da9160@zahav.net.il>
     [not found]         ` <20050424221155.GA13653@nevyn.them.org>
2005-04-27 13:06           ` Variable "foo" is not available Eli Zaretskii
2005-04-27 13:10             ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox