Hello, You are right, it's a bug, it must be 0x40. LR at 0x28 describes HW state before switch but not LR register. Obviously I will need to pay more attention of testing.
Marian 2015-03-11 12:41 GMT+01:00 Richard Braun <rbr...@sceen.net>: > On Wed, Mar 11, 2015 at 01:01:23AM +0100, Marian Cingel wrote: >> I have found the problem. SYSTEM_TD member of kernel_data has type >> TD_STRUCT and not (as I would expect) TD_STRUCT_PTR. SYSTEM_TD member >> exists before TD_LIST and because TD_STRUCT has different size >> depending on configuration it makes impossible to use static offset. I >> think there might be a way to loop indirectly by ACTIVE_PTR. I will >> try to make it work in next few days. > > Great, I'll be ready to test your change. > > Another point I wanted to discuss was stack tracing in non-running > tasks. Here is the comment you wrote about the stack layout : > > * standard exception stack > * ( stack base, higher memory address ) > * - xpsr - 0x48 > * - pc - 0x44 > * - lr - 0x40 > * - r12 - 0x3C > * - r3 - 0x38 > * - r2 - 0x34 > * - r1 - 0x30 > * - r0 - 0x2C > * extended stack in svc_pending handler > * - lr - 0x28 > * - r11 - 0x24 > * - r10 - 0x20 > * - r9 - 0x1C > * - r8 - 0x18 > * - r7 - 0x14 > * - r6 - 0x10 > * - r5 - 0x0C > * - r4 - 0x08 > * - BASEPRI - 0x04 > * - SHPR3 - 0x00 ( contains pend_svc exception priority ) > * ( stack head, lower address, stored in 'task->STACK_PTR' ) > > The rtos_mqx_arm_v7m_stack_offsets structure reports that lr is at > 0x28, but this is the value from the MQX handler. It seems to me > that we should be using the value from the exception stack frame > at 0x40 instead. When doing this, I get consistent traces. Any reason > why you used the other lr value ? > > -- > Richard Braun ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ OpenOCD-devel mailing list OpenOCD-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openocd-devel