git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
SpiderScript! (with a sample script)
[tpg/acess2.git]
/
Kernel
/
debug.c
diff --git
a/Kernel/debug.c
b/Kernel/debug.c
index
3a77610
..
8533a9e
100644
(file)
--- a/
Kernel/debug.c
+++ b/
Kernel/debug.c
@@
-397,9
+397,10
@@
void Debug_HexDump(char *Header, void *Data, Uint Length)
Debug_Puts(1, Header);
LogF(" (Hexdump of %p)\r\n", Data);
Debug_Puts(1, Header);
LogF(" (Hexdump of %p)\r\n", Data);
+ #define CH(n) ((' '<=cdat[(n)]&&cdat[(n)]<=0x7F) ? cdat[(n)] : '.')
+
while(Length >= 16)
{
while(Length >= 16)
{
- #define CH(n) ((' '<=cdat[(n)]&&cdat[(n)]<=0x7F) ? cdat[(n)] : '.')
Log("%04x: %02x %02x %02x %02x %02x %02x %02x %02x"
" %02x %02x %02x %02x %02x %02x %02x %02x"
" %c%c%c%c%c%c%c%c %c%c%c%c%c%c%c%c",
Log("%04x: %02x %02x %02x %02x %02x %02x %02x %02x"
" %02x %02x %02x %02x %02x %02x %02x %02x"
" %c%c%c%c%c%c%c%c %c%c%c%c%c%c%c%c",
@@
-414,14
+415,22
@@
void Debug_HexDump(char *Header, void *Data, Uint Length)
pos += 16;
}
pos += 16;
}
- LogF("Log: %04x: ", pos);
- while(Length)
{
{
- Uint byte = *cdat;
- LogF("%02x ", byte);
- Length--;
- cdat ++;
+ int i ;
+ LogF("Log: %04x: ", pos);
+ for(i = 0; i < Length; i ++)
+ {
+ LogF("%02x ", cdat[i]);
+ }
+ for( ; i < 16; i ++) LogF(" ");
+ LogF(" ");
+ for(i = 0; i < Length; i ++)
+ {
+ if( i == 8 ) LogF(" ");
+ LogF("%c", CH(i));
+ }
}
}
+
Debug_Putchar('\r');
Debug_Putchar('\n');
}
Debug_Putchar('\r');
Debug_Putchar('\n');
}
UCC
git Repository :: git.ucc.asn.au