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

addr2line.c: fix *printf type warnings on 32-bit

Yup, back to using an ancient 32-bit system...

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
normal 2018-10-13 05:36:50 +00:00
parent 54ad3167e8
commit d3e1afacaa

View file

@ -814,25 +814,27 @@ next_line:
uintptr_t addr = (uintptr_t)traces[i];
uintptr_t d = addr - line->saddr;
if (!line->path) {
kprintf("[0x%lx]\n", addr);
kprintf("[0x%"PRIuPTR"]\n", addr);
}
else if (!line->saddr || !line->sname) {
kprintf("%s(0x%lx) [0x%lx]\n", line->path, addr-line->base_addr, addr);
kprintf("%s(0x%"PRIuPTR") [0x%"PRIuPTR"]\n", line->path, addr-line->base_addr, addr);
}
else if (line->line <= 0) {
kprintf("%s(%s+0x%lx) [0x%lx]\n", line->path, line->sname,
kprintf("%s(%s+0x%"PRIuPTR") [0x%"PRIuPTR"]\n", line->path, line->sname,
d, addr);
}
else if (!line->filename) {
kprintf("%s(%s+0x%lx) [0x%lx] ???:%d\n", line->path, line->sname,
d, addr, line->line);
kprintf("%s(%s+0x%"PRIuPTR") [0x%"PRIuPTR"] ???:%d\n",
line->path, line->sname, d, addr, line->line);
}
else if (line->dirname && line->dirname[0]) {
kprintf("%s(%s+0x%lx) [0x%lx] %s/%s:%d\n", line->path, line->sname,
kprintf("%s(%s+0x%"PRIuPTR") [0x%"PRIuPTR"] %s/%s:%d\n",
line->path, line->sname,
d, addr, line->dirname, line->filename, line->line);
}
else {
kprintf("%s(%s+0x%lx) [0x%lx] %s:%d\n", line->path, line->sname,
kprintf("%s(%s+0x%"PRIuPTR") [0x%"PRIuPTR"] %s:%d\n",
line->path, line->sname,
d, addr, line->filename, line->line);
}
/* FreeBSD's backtrace may show _start and so on */