in kernel fault handler, show preceeding symbol, not closest

This commit is contained in:
K. Lange 2018-09-25 16:44:20 +09:00
parent 1fe143ebea
commit 4fee088b62

View File

@ -497,15 +497,13 @@ page_fault(
size_t d;
if (a <= r->eip) {
d = r->eip - a;
} else {
d = a - r->eip;
}
if (d < distance) {
closest = key;
distance = d;
addr = a;
}
}
}
free(hash_keys);
debug_print(ERROR, "\033[1;31mClosest symbol to faulting address:\033[0m %s [0x%x]", closest, addr);