Speed up stack dumping by looking for freespace 4 bytes at a time

Conflicts:
	mavlink/include/mavlink/v1.0
This commit is contained in:
Kevin Hester 2013-08-10 12:57:52 -10:00 committed by Lorenz Meier
parent d70ed8ad12
commit 2e1ac72b59
1 changed files with 3 additions and 2 deletions

View File

@ -178,9 +178,10 @@ define showtaskstack
printf "can't measure idle stack\n"
else
set $stack_free = 0
while ($stack_free < $task->adj_stack_size) && *(uint8_t *)($task->stack_alloc_ptr + $stack_free)
while ($stack_free < $task->adj_stack_size) && ((uint32_t *)($task->stack_alloc_ptr))[$stack_free] == 0xffffffff
set $stack_free = $stack_free + 1
end
set $stack_free = $stack_free * 4
printf" stack 0x%08x-0x%08x (%d) %d free\n", $task->stack_alloc_ptr, $task->adj_stack_ptr, $task->adj_stack_size, $stack_free
end
end
@ -278,4 +279,4 @@ define my_mem
set $cursor = $cursor - 4
end
end
end
end