Skip to content
Snippets Groups Projects
Commit c9b5d315 authored by patacongo's avatar patacongo
Browse files

Add special handling for idle task stack dump

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@85 42af7a65-404d-4744-a932-0658087f49c3
parent 5a8969b0
No related branches found
No related tags found
No related merge requests found
......@@ -83,14 +83,26 @@ static inline uint32 up_getsp(void)
static void up_stackdump(void)
{
_TCB *rtcb = (_TCB*)g_readytorun.head;
uint32 stack_base = (uint32)rtcb->adj_stack_ptr;
uint32 sp = up_getsp();
uint32 stack_base;
uint32 stack_size;
if (rtcb->pid == 0)
{
stack_base = g_heapbase - CONFIG_PROC_STACK_SIZE;
stack_size = CONFIG_PROC_STACK_SIZE;
}
else
{
stack_base = (uint32)rtcb->adj_stack_ptr;
stack_size = (uint32)rtcb->adj_stack_size;
}
lldbg("stack_base: %08x\n", stack_base);
lldbg("stack_size: %08x\n", rtcb->adj_stack_size);
lldbg("stack_size: %08x\n", stack_size);
lldbg("sp: %08x\n", sp);
if (sp >= stack_base || sp < stack_base - rtcb->adj_stack_size)
if (sp >= stack_base || sp < stack_base - stack_size)
{
lldbg("ERROR: Stack pointer is not within allocated stack\n");
return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment