[Pdbg] [PATCH v6 0/5] hexdump bytes from getmem/getmemio
Amitay Isaacs
amitay at ozlabs.org
Wed Apr 17 16:02:58 AEST 2019
If the output of getmem/getmemio contains non-printable characters,
then dump output using hexdump format. Otherwise dump raw bytes.
To force the raw output add command-line flag --raw to getmem/getmemio.
V2 changes:
- If the memory is printable, output directly instead of using hexdump
V3 changes:
- Print the addresses aligned to 16 bytes in hexdump
- Add hexdump tests for grouping and aligntment
V4 changes:
- work around isprint()
V5 changes:
- Also ignore 0x0 as printable character
This is useful when testing putmem/getmem on skiboot console.
V6 changes:
- Add command-line flag --raw to getmem/getmemio
Update usage docs for getmem/getmemio
Amitay Isaacs (5):
main: Add hexdump() function to dump bytes
tests: Add tests for hexdump()
mem: Dump memory only if mem_read was successful
main: Use hexdump to dump memory from gemem/getmemio
mem: CR and LF are printable characters
Makefile.am | 8 ++-
src/main.c | 4 +-
src/mem.c | 72 +++++++++++++++++------
src/tests/hexdump_test.c | 83 +++++++++++++++++++++++++++
src/util.c | 45 +++++++++++++++
src/util.h | 16 ++++++
tests/test_hexdump.sh | 119 +++++++++++++++++++++++++++++++++++++++
7 files changed, 326 insertions(+), 21 deletions(-)
create mode 100644 src/tests/hexdump_test.c
create mode 100755 tests/test_hexdump.sh
--
2.20.1
More information about the Pdbg
mailing list