@@ -114,29 +114,11 @@ static int _getmem(uint64_t addr, uint64_t size, uint8_t block_size, bool ci, bo
}
if (count > 0) {
- uint64_t i;
- bool printable = true;
-
if (raw) {
if (write(STDOUT_FILENO, buf, size) < 0)
PR_ERROR("Unable to write stdout.\n");
} else {
- for (i=0; i<size; i++) {
- if (buf[i] == 0x0a || buf[i] == 0x0d || buf[i] == 0)
- continue;
-
- if (!isprint(buf[i])) {
- printable = false;
- break;
- }
- }
-
- if (!printable) {
- hexdump(addr, buf, size, 1);
- } else {
- if (write(STDOUT_FILENO, buf, size) < 0)
- PR_ERROR("Unable to write stdout.\n");
- }
+ hexdump(addr, buf, size, 1);
}
}
The getmem command would not hexdump if printable characters were found. This was useful for dumping text buffers such as the OPAL console buffer. However when dumping other regions it is still common for there to be printable characters which results in the output not getting hexdumped. Instead always hexdump, raw output can always be obtained using the `--raw` option. Signed-off-by: Alistair Popple <alistair@popple.id.au> --- src/mem.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-)