mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-27 20:14:06 +08:00
* sysdump.c (dh): Changed format of output to be 16 hex digits
followed by 16 ascii characters, similar to Emacs' hexl-mode, to make it easier to read.
This commit is contained in:
parent
63e1380d57
commit
5a25ad782b
Binary file not shown.
@ -84,27 +84,26 @@ dh (ptr, size)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
int span = 20;
|
||||
int span = 16;
|
||||
|
||||
printf ("\n************************************************************\n");
|
||||
|
||||
for (i = 0; i < size; i += span)
|
||||
{
|
||||
for (j = 0; j < span && j + i < size; j++)
|
||||
for (j = 0; j < span; j++)
|
||||
{
|
||||
printf ("%02x ", ptr[i + j]);
|
||||
if (j + i < size)
|
||||
printf ("%02x ", ptr[i + j]);
|
||||
else
|
||||
printf (" ");
|
||||
}
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
for (i = 0; i < size; i += span)
|
||||
{
|
||||
for (j = 0; j < span && j + i < size; j++)
|
||||
{
|
||||
int c = ptr[i + j];
|
||||
if (c < 32 || c > 127)
|
||||
c = '.';
|
||||
printf (" %c ", c);
|
||||
printf ("%c", c);
|
||||
}
|
||||
printf ("\n");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user