зеркало из https://github.com/github/ruby.git
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:
Родитель
bb9eea9065
Коммит
f572aeb71f
48
addr2line.c
48
addr2line.c
|
@ -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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче