Ticket #30: patch
File patch, 1.2 KB (added by , 15 years ago) |
---|
-
ataprint.cpp
old new 1006 1006 } 1007 1007 1008 1008 // Print hexdump of log pages. 1009 // Format is compatible with 'xxd -r'.1009 // Format is compatible with output of 'hd'. 1010 1010 static void PrintLogPages(const char * type, const unsigned char * data, 1011 1011 unsigned char logaddr, unsigned page, 1012 1012 unsigned num_pages, unsigned max_pages) … … 1016 1016 for (unsigned i = 0; i < num_pages * 512; i += 16) { 1017 1017 const unsigned char * p = data+i; 1018 1018 pout("%07x: %02x %02x %02x %02x %02x %02x %02x %02x " 1019 "%02x %02x %02x %02x %02x %02x %02x %02x \n",1019 "%02x %02x %02x %02x %02x %02x %02x %02x ", 1020 1020 (page * 512) + i, 1021 1021 p[ 0], p[ 1], p[ 2], p[ 3], p[ 4], p[ 5], p[ 6], p[ 7], 1022 1022 p[ 8], p[ 9], p[10], p[11], p[12], p[13], p[14], p[15]); 1023 #define P(n) (isprint((int)(p[n]))?(int)(p[n]):'.') 1024 pout("|%c%c%c%c%c%c%c%c" 1025 "%c%c%c%c%c%c%c%c|\n", 1026 P( 0), P( 1), P( 2), P( 3), P( 4), P( 5), P( 6), P( 7), 1027 P( 8), P( 9), P(10), P(11), P(12), P(13), P(14), P(15)); 1028 #undef P 1023 1029 if ((i & 0x1ff) == 0x1f0) 1024 1030 pout("\n"); 1025 1031 }