dump
showsBy default dump
displays 128 bytes of memory starting at offset 0#B.
You can change the quantity and starting offset by using the size
and from
arguments. For example:
(poke) dump :from 0x10#B :size 0x40#B 76543210 0011 2233 4455 6677 8899 aabb ccdd eeff 0123456789ABCDEF 00000010: b6a2 a578 8d82 7b7f 2076 374c 3eab 7150 ...x..{. v7L>.qP 00000020: 31df 8ecb 3d33 ee12 429b 2e13 670d 948e 1...=3..B...g... 00000030: 86f1 2228 ae07 d95c 9884 cf0a d1a8 072e .."(...\........ 00000040: f93c 5368 9617 6c96 3d61 7b92 9038 a93b .<Sh..l.=a{..8.;
Note that both the size
and from
arguments are offsets.
As such, both must be specified using #
and an appropriate unit.
(see Offset Literals).
The other arguments change the appearance of the dump.
If the ruler
argument is zero, then the ruler will be omitted:
(poke) dump :ruler 0 :size 0x40#B 00000000: b1fd 1608 2346 759c 46a6 aa94 6fcd 846a ....#Fu.F...o..j 00000010: e39f 473f 3247 415f 174d a32b ed89 a435 ..G?2GA_.M.+...5 00000020: d2c6 2c52 bc82 e0a7 e767 31ea 84de 41e5 ..,R.....g1...A. 00000030: 2add 2869 e9c2 226b e222 8c74 4b94 af24 *.(i.."k.".tK..$
To omit the ascii
representation of the memory, call dump
with the ascii
argument set to zero:
(poke) dump :ruler 0 :size 0x40#B :ascii 0 00000000: 4393 85e7 0b0c 3921 5a26 39ec 2f5f 5f15 00000010: cc46 e6f3 d50f 6ae6 8988 d50e f8c4 d1c6 00000020: 5a2f 7c3e 490b 18d8 d867 4b6f 2549 1f6c 00000030: 34a9 a0d7 24d2 e9ac 9240 8247 10cb 4ba1
Instead of an explicit from+size
range, a mapped value can be
specified using the val
argument. In this case, dump
will show the bytes corresponding to the given value, with visual
indications on what bytes correspond to what element contained in the
value.
Let’s first see an example with a struct:
(poke) type Foo = struct { int<32> one; int<64> two; } (poke) dump :val Foo @ 0#B 76543210 0011 2233 4455 6677 8899 aabb ccdd eeff 0123456789ABCDEF 00000000: 0000 0000 0000 0000 0000 0000 ............ one two
Where both the bytes and the field names are colorized in order to establish a visual correspondence.
Similarly, the bytes corresponding to array elements are also characterized:
(poke) dump :val int[3] @ 2#B 76543210 0011 2233 4455 6677 8899 aabb ccdd eeff 0123456789ABCDEF 00000000: 0000 0000 0000 0000 0000 0000 0000 .............. [0] [1] [2]
If some of the elements contained in the value passed to
dump
is itself complex, then a number is printed right
before its name. For example:
(poke) type Foo = struct { int<32> one; struct { int<64> three; } two; } (poke) dump :val Foo @ 0#B 76543210 0011 2233 4455 6677 8899 aabb ccdd eeff 0123456789ABCDEF 00000000: 0000 0000 0000 0000 0000 0000 ............ one 1=two
This number can be used as an identifier in a subsequent invocation to
dump
to quickly refer to that value:
(poke) dump :val 1 76543210 0011 2233 4455 6677 8899 aabb ccdd eeff 0123456789ABCDEF 00000000: 0000 0000 0000 0000 0000 0000 ............ three
Note that these indexes get reset every time dump :val
gets
executed.
A function dumpval
is also provided in order to ease accessing
the values whose bytes we dump. It has prototype:
dumpval (int<32> val = -1) any
Where val is the index of a value whose bytes have been printed
by the last dump :val
command. The function returns that
value. If no index is specified, then dumpval returns the value
passed as :val
instead of some of its constituents.