assert/stack_dump: Output some more information on the premise that sp has it.

gdb may need more information when doing backtrace

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
anjiahao 2023-09-15 11:47:46 +08:00 committed by Xiang Xiao
parent 7fd172d9ff
commit c3fd7f84ad

View File

@ -166,6 +166,14 @@ static void dump_stack(FAR const char *tag, uintptr_t sp,
if (sp != 0)
{
_alert(" sp: %p\n", (FAR void *)sp);
/* Get more information */
if (sp - 32 >= base)
{
sp -= 32;
}
stack_dump(sp, top);
}
else