[Pdbg] [PATCH v4 0/5] hexdump bytes from getmem
Amitay Isaacs
amitay at ozlabs.org
Wed Apr 10 17:04:38 AEST 2019
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
V4 changes:
- work around isprint()
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
mem: CR and LF are printable characters
Makefile.am | 8 ++-
src/mem.c | 45 +++++++++++----
src/tests/hexdump_test.c | 83 +++++++++++++++++++++++++++
src/util.c | 45 +++++++++++++++
src/util.h | 16 ++++++
tests/test_hexdump.sh | 119 +++++++++++++++++++++++++++++++++++++++
6 files changed, 304 insertions(+), 12 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