[patch] Suggest 'graph display array@nelems1@nelems2' in manual

Rhys Ulerich <[email protected]> Wed, 15 Feb 2012 14:50:06 -0600
Newsgroups gmane.comp.debugging.ddd.general
Message-ID <CAKDqugQgJoKn_DazjEVqmZ80yUhLkS9XpWa_8T3e-Qy9mdczOw@mail.gmail.com>
Hi all,

It took me an embarassingly long time to figure out how to display a
1D array as a 2D table.

Attached is a minor documentation patch adding an example like
    graph display array@nelems1@nelems2
to the "Array Slices" section of the manual.

Hopefully this saves the next person some time,
Rhys

_______________________________________________
ddd mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/ddd
manual_repeated_slice.patch (text/x-patch, 785 B)
Index: ddd/ddd.texi
===================================================================
--- ddd/ddd.texi	(revision 7209)
+++ ddd/ddd.texi	(working copy)
@@ -9063,6 +9063,14 @@
 the index of the first element, and @var{nelems} is the number of
 elements to display.
 
+You may use @sampl{@@} twice to generate a two-dimensional slice
+from a one-dimensional array.  This permits viewing a one-dimensional
+array as a table (see @pxref{Arrays as Tables}) and looks as follows:
+
+@example
+graph display @var{array}[@var{first}]@@@var{nelems1}@@@var{nelems2}
+@end example
+
 The left operand of @samp{@@} must reside in memory.  Array values made
 with @samp{@@} in this way behave just like other arrays in terms of
 subscripting, and are coerced to pointers when used in expressions.