I have previously modified MQX/mqx/source/tad/tad.c so that the shell "tad stack" command includes the PC in its output. This might help you.
-- 336/tad.c Wed Mar 18 13:16:29 2015
+++ 337/tad.c Wed Mar 18 13:16:16 2015
@@ -323,7 +323,7 @@
char_ptr task_name;
printf ("\nStack Usage:\n");
- printf ("Task Stack Base Stack Limit Stack Used %% Used Overflow?\n");
+ printf ("Task PC Stack Base Stack Limit Stack Used %% Used Overflow?\n");
size = _QUEUE_GET_SIZE(&kernel_data_ptr->TD_LIST);
@@ -352,7 +352,7 @@
{
percent = ((_mqx_uint_ptr)td_ptr->STACK_BASE - stack_used) * 100 / ((_mqx_uint_ptr)td_ptr->STACK_BASE - (_mqx_uint_ptr)td_ptr->STACK_LIMIT);
}
- printf ("%s 0x%lx 0x%lx 0x%lx %ld %% %s\n", task_name, td_ptr->STACK_BASE, td_ptr->STACK_LIMIT, stack_used, percent,percent>=100?"Yes":"No");
+ printf ("%s 0x%lx 0x%lx 0x%lx 0x%lx %ld %% %s\n", task_name, *(uint_32*)(td_ptr->STACK_PTR + 64)-1, td_ptr->STACK_BASE, td_ptr->STACK_LIMIT, stack_used, percent,percent>=100?"Yes":"No");
size--;
td_ptr = (TD_STRUCT_PTR)((uchar_ptr)(td_ptr->TD_LIST_INFO.NEXT) - FIELD_OFFSET(TD_STRUCT,TD_LIST_INFO));
That patch applies to MQX 4.0.1 rather than the latest, but it looks like the source hasn't changed much since then.