|
|
@ -3,14 +3,8 @@ function decode_stack(sp)
|
|
|
|
var i;
|
|
|
|
var i;
|
|
|
|
var a = new Array();
|
|
|
|
var a = new Array();
|
|
|
|
|
|
|
|
|
|
|
|
var current_task;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
current_task = Debug.evaluate("pxCurrentTCB");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( current_task == 0 )
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sp += 4; /* skip stored ulCriticalNesting */
|
|
|
|
sp += 4; /* skip stored ulCriticalNesting */
|
|
|
|
|
|
|
|
|
|
|
|
a[16] = Debug.evaluate("*(unsigned long*)" + sp);
|
|
|
|
a[16] = Debug.evaluate("*(unsigned long*)" + sp);
|
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i <= 15; i++)
|
|
|
|
for (i = 0; i <= 15; i++)
|
|
|
@ -24,42 +18,44 @@ function decode_stack(sp)
|
|
|
|
|
|
|
|
|
|
|
|
function add_task(task, state)
|
|
|
|
function add_task(task, state)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var tcb, task_name;
|
|
|
|
var tcb, task_name, current_task, regs;
|
|
|
|
|
|
|
|
|
|
|
|
var current_task;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
current_task = Debug.evaluate("pxCurrentTCB");
|
|
|
|
current_task = Debug.evaluate("pxCurrentTCB");
|
|
|
|
|
|
|
|
|
|
|
|
if( current_task == 0 )
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tcb = Debug.evaluate("*(tskTCB *)" + task);
|
|
|
|
tcb = Debug.evaluate("*(tskTCB *)" + task);
|
|
|
|
|
|
|
|
|
|
|
|
task_name = Debug.evaluate("(char*)&(*(tskTCB *)" + task + ").pcTaskName[0]");
|
|
|
|
task_name = Debug.evaluate("(char*)&(*(tskTCB *)" + task + ").pcTaskName[0]");
|
|
|
|
Threads.add("#" + tcb.uxTCBNumber + " \"" + task_name + "\"", tcb.uxPriority, state, decode_stack(tcb.pxTopOfStack));
|
|
|
|
task_name = "#" + tcb.uxTCBNumber + " \"" + task_name + "\"";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function add_list(list, state, current_task)
|
|
|
|
if (task == current_task)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var i, index, item, end;
|
|
|
|
state = "executing";
|
|
|
|
var current_task;
|
|
|
|
regs = [];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
regs = decode_stack(tcb.pxTopOfStack);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
current_task = Debug.evaluate("pxCurrentTCB");
|
|
|
|
Threads.add(task_name, tcb.uxPriority, state, regs);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if( current_task == 0 )
|
|
|
|
function add_list(list, state)
|
|
|
|
return;
|
|
|
|
{
|
|
|
|
|
|
|
|
var i, index, item, task;
|
|
|
|
|
|
|
|
|
|
|
|
if (list.uxNumberOfItems)
|
|
|
|
if (list && list.uxNumberOfItems>0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
index = list.pxIndex;
|
|
|
|
index = list.xListEnd.pxNext;
|
|
|
|
end = list.xListEnd;
|
|
|
|
|
|
|
|
for (i = 0; i < list.uxNumberOfItems; i++)
|
|
|
|
for (i = 0; i < list.uxNumberOfItems; i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
item = Debug.evaluate("*(xListItem *)" + index);
|
|
|
|
item = Debug.evaluate("*(xListItem *)" + index);
|
|
|
|
if (index != end)
|
|
|
|
|
|
|
|
{
|
|
|
|
task = item ? item.pvOwner : 0;
|
|
|
|
task = item.pvOwner;
|
|
|
|
|
|
|
|
if (task) add_task(task, (task == current_task) ? "executing" : state);
|
|
|
|
if (task)
|
|
|
|
}
|
|
|
|
add_task(task, state);
|
|
|
|
|
|
|
|
|
|
|
|
index = item.pxNext;
|
|
|
|
index = item.pxNext;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -67,52 +63,43 @@ function add_list(list, state, current_task)
|
|
|
|
|
|
|
|
|
|
|
|
function update()
|
|
|
|
function update()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var i, current_task, list, lists, max_priority;
|
|
|
|
var i, list, lists, max_priority;
|
|
|
|
|
|
|
|
|
|
|
|
Threads.clear();
|
|
|
|
Threads.clear();
|
|
|
|
|
|
|
|
|
|
|
|
current_task = Debug.evaluate("pxCurrentTCB");
|
|
|
|
if( Debug.evaluate("pxCurrentTCB") == 0 )
|
|
|
|
|
|
|
|
|
|
|
|
if( current_task == 0 )
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
Threads.newqueue("Ready");
|
|
|
|
max_priority = Debug.evaluate("uxTopUsedPriority");
|
|
|
|
lists = Debug.evaluate("pxReadyTasksLists");
|
|
|
|
|
|
|
|
if (lists)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
max_priority = Debug.evaluate("uxTopUsedPriority");
|
|
|
|
|
|
|
|
max_priority = Debug.evaluate("*(long *)" + max_priority);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i <= max_priority; i++)
|
|
|
|
Threads.newqueue("Ready");
|
|
|
|
{
|
|
|
|
for (i = max_priority; i >= 0; i--)
|
|
|
|
list = Debug.evaluate("((xList*)" + lists + ")[" + (max_priority - i) + "]");
|
|
|
|
{
|
|
|
|
add_list(list, "ready", current_task);
|
|
|
|
list = Debug.evaluate("pxReadyTasksLists[" + i + "]");
|
|
|
|
}
|
|
|
|
add_list(list, "ready");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Threads.newqueue("Blocked");
|
|
|
|
Threads.newqueue("Blocked");
|
|
|
|
|
|
|
|
|
|
|
|
list = Debug.evaluate("pxDelayedTaskList");
|
|
|
|
list = Debug.evaluate("pxDelayedTaskList");
|
|
|
|
if (list)
|
|
|
|
if (list)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
list = Debug.evaluate("**(xList **)" + list);
|
|
|
|
list = Debug.evaluate("*(xList *)" + list);
|
|
|
|
add_list(list, "blocked");
|
|
|
|
add_list(list, "blocked");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
list = Debug.evaluate("pxOverflowDelayedTaskList");
|
|
|
|
list = Debug.evaluate("pxOverflowDelayedTaskList");
|
|
|
|
if (list)
|
|
|
|
if (list)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
list = Debug.evaluate("**(xList **)" + list);
|
|
|
|
list = Debug.evaluate("*(xList *)" + list);
|
|
|
|
add_list(list, "blocked");
|
|
|
|
add_list(list, "blocked");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Threads.newqueue("Suspended");
|
|
|
|
Threads.newqueue("Suspended");
|
|
|
|
|
|
|
|
|
|
|
|
list = Debug.evaluate("xSuspendedTaskList");
|
|
|
|
list = Debug.evaluate("xSuspendedTaskList");
|
|
|
|
if (list)
|
|
|
|
if (list)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
list = Debug.evaluate("*(xList *)" + list);
|
|
|
|
|
|
|
|
add_list(list, "suspended");
|
|
|
|
add_list(list, "suspended");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|