Closed bobbingwide closed 4 years ago
In the first version I'll just include the helper functon bw_trace_hexdump
which will load and call oik_hexdump
from the hexdump
shared library. oik-bwtrace will deliver the hexdump library in the libs folder. This file will need to be added to the oik-libs repository.
The hexdump logic is currently tested in oik-batch.
The hexdump function was written to support single byte characters.
To hexdump the first line of Hello Dolly add the following code in hello_dolly_get_lyric()
$lyr = bw_trace_hexdump( $lyrics[0]);
bw_trace2( $lyr, "lyric");
The hexdump output for the first line of "Hello Dolly" is
13
Hello, Dolly........ 48 65 6c 6c 6f 2c 20 44 6f 6c 6c 79 0d
Notes:
£
and €
the number of characters dislplayed in the first half of the hexdump output may be fewer than 20. ABCDEFG\n12345678910\t£"
the output is
22\r\n
ABCDEFG.12345678910. 41 42 43 44 45 46 47 0a 31 32 33 34 35 36 37 38 39 31 30 09 \r\n
£.................. c2 a3 \r\n
ctype_cntrl()
) characters or are just padding.
Sometimes, when you want to see the exact contents of data a
print_r()
is not good enough. We need to be able to see a hex dump of each character.Proposed solution
Provide a helper function to return data in hex dump format.