Previous: , Up: dump   [Contents][Index]

13.1.2 Presentation options for dump

By default, the hexadecimal display shows two bytes grouped together, and then a space. You can alter this behaviour using the group_by parameter.

(poke) dump :ascii 0 :size 0x40#B :group_by 4#B
00000000: 68f19a63 df2a8886 c466631c a7fdd5c7  h..c.*...fc.....
00000010: 3075746a 0adb03ca f5b1ff14 6166fa07
00000020: 0dd3cfbd 8eff46a2 4152a81d 471beddf  ......F.AR..G...
00000030: a0501cae 8bfcec6f 7a4f5701 45ba9fc3  .P.....ozOW.E...

Another parameter is the cluster_by argument. By setting cluster_by to n, this causes dump to display an additional space after the nth group has been displayed, and also in the corresponding position in the ascii display:

(poke) dump :size 0x40#B :group_by 2#B :cluster_by 4
76543210  0011 2233 4455 6677  8899 aabb ccdd eeff  01234567 89ABCDEF
00000000: 91b8 540d d4dc 49ae  3320 ba7d efd1 16ab  ..T...I. 3 .}....
00000010: b1a8 5ea0 5846 8bea  f741 3f80 42bc 201f  ..^.XF.. .A?.B. .
00000020: 6e5e fa50 23fb f16a  d380 be8c fc98 d195  n^.P#..j ........
00000030: 7bbf fa3e 3fc2 43a4  2a1e 9763 2bd6 5d24  {..>?.C. *..c+.]$

Another variable that the user can customize is pk_dump_nonprintable_char. It defaults to '.', and contains the character to use in the ASCII dump to represent a non-printable character.

If you have a personal preference on how memory dumps should appear, you can set the relevant pk_dump_* variables. These global variables serve as the defaults for dump, so this way, you will not need to explicitly pass them when you call the function.