1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Moved hexdump macro before used

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-10-14 23:45:33 +00:00
parent bb9eea9065
commit f572aeb71f

View file

@ -1216,6 +1216,30 @@ di_find_abbrev(DebugInfoReader *reader, uint64_t abbrev_number)
}
#if 0
static void
hexdump0(const unsigned char *p, size_t n)
{
size_t i;
fprintf(stderr, " 0 1 2 3 4 5 6 7 8 9 A B C D E F\n");
for (i=0; i < n; i++){
switch (i & 15) {
case 0:
fprintf(stderr, "%02zd: %02X ", i/16, p[i]);
break;
case 15:
fprintf(stderr, "%02X\n", p[i]);
break;
default:
fprintf(stderr, "%02X ", p[i]);
break;
}
}
if ((i & 15) != 15) {
fprintf(stderr, "\n");
}
}
#define hexdump(p,n) hexdump0((const unsigned char *)p, n)
static void
div_inspect(DebugInfoValue *v)
{
@ -1507,30 +1531,6 @@ fail:
return 0;
}
static void
hexdump0(const unsigned char *p, size_t n)
{
size_t i;
fprintf(stderr, " 0 1 2 3 4 5 6 7 8 9 A B C D E F\n");
for (i=0; i < n; i++){
switch (i & 15) {
case 0:
fprintf(stderr, "%02zd: %02X ", i/16, p[i]);
break;
case 15:
fprintf(stderr, "%02X\n", p[i]);
break;
default:
fprintf(stderr, "%02X ", p[i]);
break;
}
}
if ((i & 15) != 15) {
fprintf(stderr, "\n");
}
}
#define hexdump(p,n) hexdump0((const unsigned char *)p, n)
/* read file and fill lines */
static uintptr_t
fill_lines(int num_traces, void **traces, int check_debuglink,