Project

General

Profile

Bug #17052 » ruby-addr2line-debug_info_read-debug-code-0001.patch

Debug code for `debug_info_read` - xtkoba (Tee KOBAYASHI), 08/19/2021 12:51 PM

View differences:

addr2line.c
{
const char *p = reader->abbrev_table[abbrev_number];
if (!p) {
fprintf(stderr,"%d: Abbrev Number %"PRId64" not found\n",__LINE__, abbrev_number);
uint64_t a = abbrev_number;
ptrdiff_t len = 0;
while (a) {
len++;
a >>= 7;
}
fprintf(stderr,"%d: debug_info 0x%"PRIxPTR" Abbrev Number %"PRId64" not found\n",__LINE__, reader->p - reader->obj->debug_info.ptr - len, abbrev_number);
abort();
}
return p;
......
}
}
}
/* assert(reader->p >= reader->cu_end); */
ptrdiff_t p_rel = reader->p - reader->obj->debug_info.ptr;
ptrdiff_t cu_end_rel = reader->cu_end - reader->obj->debug_info.ptr;
if (reader->p > reader->cu_end) {
fprintf(stderr,"%d: debug_info CU over-read 0x%"PRIxPTR" > 0x%"PRIxPTR"\n",__LINE__, p_rel, cu_end_rel);
abort();
}
/* assert(reader->p == reader->cu_end); */
}
#ifdef USE_ELF
(5-5/5)