]> git.sur5r.net Git - openocd/commitdiff
Correct stacking direction and use of address offset
authorAlan Bowman <alan.michael.bowman@gmail.com>
Wed, 11 May 2011 11:12:07 +0000 (12:12 +0100)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Sat, 14 May 2011 14:59:29 +0000 (16:59 +0200)
src/rtos/rtos.c
src/rtos/rtos_standard_stackings.c

index 9a4af74920ae753735b89a95b935d7f68f8f9074..d69127e5e424d26abd9650b622bfc3616e8b50a3 100644 (file)
@@ -533,7 +533,7 @@ int rtos_generic_stack_read( struct target * target, const struct rtos_register_
        {
                address -=  stacking->stack_registers_size;
        }
-       retval = target_read_buffer( target, stack_ptr, stacking->stack_registers_size, stack_data);
+       retval = target_read_buffer( target, address, stacking->stack_registers_size, stack_data);
        if ( retval != ERROR_OK )
        {
                LOG_OUTPUT("Error reading stack frame from FreeRTOS thread\r\n");
@@ -553,7 +553,7 @@ int rtos_generic_stack_read( struct target * target, const struct rtos_register_
        }
        *hex_reg_list = (char*)malloc( list_size*2 +1 );
        tmp_str_ptr = *hex_reg_list;
-       new_stack_ptr = stack_ptr + stacking->stack_growth_direction * stacking->stack_registers_size;
+       new_stack_ptr = stack_ptr - stacking->stack_growth_direction * stacking->stack_registers_size;
        for( i = 0; i < stacking->num_output_registers; i++ )
        {
                int j;
index e0ae06556caee070f9d1a27eaa687c49d6154664..e15b8b3ce0ba50ae0a922d4c5ccd0ac915f1391a 100644 (file)
@@ -57,7 +57,7 @@ static const struct stack_register_offset rtos_standard_Cortex_M3_stack_offsets
 const struct rtos_register_stacking rtos_standard_Cortex_M3_stacking =
 {
           0x40,                                 // stack_registers_size
-          1,                                    // stack_growth_direction
+          -1,                                   // stack_growth_direction
           26,                                   // num_output_registers
           rtos_standard_Cortex_M3_stack_offsets // register_offsets
 };