mbox series

[v3,0/4] hexdump bytes from getmem

Message ID 20190410052553.395843-1-amitay@ozlabs.org
Headers show
Series hexdump bytes from getmem | expand

Message

Amitay Isaacs April 10, 2019, 5:25 a.m. UTC
If running getmem from a terminal and if the output contains non-printable
characters, then dump output using hexdump format.

This avoids the need to introduce additional command-line option.

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


Amitay Isaacs (4):
  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

 Makefile.am              |   8 ++-
 src/mem.c                |  42 ++++++++++----
 src/tests/hexdump_test.c |  83 +++++++++++++++++++++++++++
 src/util.c               |  45 +++++++++++++++
 src/util.h               |  16 ++++++
 tests/test_hexdump.sh    | 119 +++++++++++++++++++++++++++++++++++++++
 6 files changed, 301 insertions(+), 12 deletions(-)
 create mode 100644 src/tests/hexdump_test.c
 create mode 100755 tests/test_hexdump.sh