From f572aeb71f53731ee1d8b351c959b93ed9eb91f5 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 14 Oct 2018 23:45:33 +0000 Subject: [PATCH] Moved hexdump macro before used git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- addr2line.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/addr2line.c b/addr2line.c index 71031c219c..e5442cca23 100644 --- a/addr2line.c +++ b/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,