[RFA/doco] Document "set/show print frame-arguments"

Joel Brobecker brobecker@adacore.com
Sat Nov 10 18:20:00 GMT 2007


> Please use @dots{} here and elsewhere, it looks better in print.

Should I use that in @smallexample too? I didn't think it would
make sense, but let me know.

> > +By default, all argument values are always printed. But this command
> > +can be useful to make a backtrace more readable, for instance, by
> > +reducing the amount of information printed for each frame, particularly
> > +when large objects would normally be printed.
> 
> Don't you want to mention the Adacore case, which was the reason for
> this feature?

I wasn't really sure of that, because we're working on the performance
aspect too.  We think we've improved a little bit already.  But on the
other hand, it's true that the only real solution to ultimate performance
is through the use of pure DWARF, which is still a ways away (and AdaCore
is also still supporting targets where DWARF is not available). So your
suggestion was indeed a good idea, and I followed it.


2007-11-10  Joel Brobecker  <brobecker@adacore.com>

        * gdb.texinfo (Print Settings): Add documentation for "set/show
        print frame-arguments".

I'm also attaching the NEWS entry, which I did forget (good catch!).

2007-11-10  Joel Brobecker  <brobecker@adacore.com>

        * NEWS: Add entry for new set/show print frame-args command.

Thanks, Eli.
-- 
Joel
-------------- next part --------------
Index: gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.442
diff -u -p -r1.442 gdb.texinfo
--- gdb.texinfo	5 Nov 2007 11:32:31 -0000	1.442
+++ gdb.texinfo	10 Nov 2007 18:09:46 -0000
@@ -6250,6 +6250,51 @@ identical repetitions, instead of displa
 themselves.  Setting the threshold to zero will cause all elements to
 be individually printed.  The default threshold is 10.
 
+@item set print frame-arguments @var{value}
+@cindex printing frame argument values
+@cindex print all frame argument values
+@cindex print frame argument values for scalars only
+@cindex do not print frame argument values
+This command allows to control how the values of arguments are printed
+when the debugger prints a frame (@pxref{Frames}).  The possible
+values are:
+
+@table @code
+@item all
+The values of all arguments are printed.  This is the default.
+
+@item scalars
+Print the value of an argument only if it is a scalar.  The value of more
+complex arguments such as arrays, structures, unions, etc, is replaced
+by @dots{}. Here is an example where only scalar arguments are shown:
+
+@smallexample
+#1  0x08048361 in call_me (i=3, s=..., ss=0xbf8d508c, u=..., e=green)
+  at frame-args.c:23
+@end smallexample
+
+@item none
+None of the argument values are printed.  Instead, the value of each argument
+is replaced by @dots{}.  In this case, the example above now becomes:
+
+@smallexample
+#1  0x08048361 in call_me (i=..., s=..., ss=..., u=..., e=...)
+  at frame-args.c:23
+@end smallexample
+@end table
+
+By default, all argument values are always printed.  But this command
+can be useful in several cases.  For instance, it can be used to reduce
+the amount of information printed in each frame, making the backtrace
+more readable.  Also, this command can be used to improve performance
+when displaying Ada frames, because the computation of large arguments
+can sometimes be CPU-intensive, especiallly in large applications.
+Setting @code{print frame-arguments} to @code{scalars} or @code{none}
+avoids this computation, thus speeding up the display of each Ada frame.
+
+@item show print frame-arguments
+Show how the value of arguments should be displayed when printing a frame.
+
 @item show print repeats
 Display the current threshold for printing repeated identical
 elements.
-------------- next part --------------
Index: NEWS
===================================================================
RCS file: /cvs/src/src/gdb/NEWS,v
retrieving revision 1.246
diff -u -p -r1.246 NEWS
--- NEWS	25 Oct 2007 05:57:58 -0000	1.246
+++ NEWS	10 Nov 2007 18:13:49 -0000
@@ -3,6 +3,13 @@
 
 *** Changes since GDB 6.7
 
+* New commands
+
+set print frame-arguments (all|scalars|none)
+show print frame-arguments
+  The value of this variable can be changed to control which argument
+  values should be printed by the debugger when displaying a frame.
+
 * GDB can now be built as a native debugger for debugging Windows x86
 (mingw32) Portable Executable (PE) programs.
 


More information about the Gdb-patches mailing list