mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
ANDROID: debugobjects: Make stack check warning more informative
Currently there is a difficult to debug bug where an object on the stack appears to not be on it. Discussing with tglx, he suggests printing the pointers and the location of the stack for the currently running task. Lets do the same, so that the error message is more informative and can help in debugging. After debugging, we can upstream this patch if its useful. Bug: 72009635 Change-Id: Id50518e70a500b850580684e82b999afbf88ee75 Signed-off-by: Joel Fernandes <joelaf@google.com>
This commit is contained in:
@@ -293,10 +293,13 @@ static void debug_object_is_on_stack(void *addr, int onstack)
|
||||
return;
|
||||
|
||||
limit++;
|
||||
if (is_on_stack)
|
||||
pr_warn("object is on stack, but not annotated\n");
|
||||
else
|
||||
pr_warn("object is not on stack, but annotated\n");
|
||||
if (is_on_stack) {
|
||||
pr_warn("object %p is on stack %p, but NOT annotated\n", addr,
|
||||
task_stack_page(current));
|
||||
} else {
|
||||
pr_warn("object %p is NOT on stack %p, but annotated\n", addr,
|
||||
task_stack_page(current));
|
||||
}
|
||||
WARN_ON(1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user