ruby-changes:52868
From: nobu <ko1@a...>
Date: Mon, 15 Oct 2018 08:45:38 +0900 (JST)
Subject: [ruby-changes:52868] nobu:r65080 (trunk): Moved hexdump macro before used
nobu 2018-10-15 08:45:33 +0900 (Mon, 15 Oct 2018) New Revision: 65080 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65080 Log: Moved hexdump macro before used Modified files: trunk/addr2line.c Index: addr2line.c =================================================================== --- addr2line.c (revision 65079) +++ addr2line.c (revision 65080) @@ -1217,6 +1217,30 @@ di_find_abbrev(DebugInfoReader *reader, https://github.com/ruby/ruby/blob/trunk/addr2line.c#L1217 #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) { switch (v->type) { @@ -1507,30 +1531,6 @@ fail: https://github.com/ruby/ruby/blob/trunk/addr2line.c#L1531 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, -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/