Correct stacking direction and use of address offset

__archive__
Alan Bowman 2011-05-11 12:12:07 +01:00 committed by Øyvind Harboe
parent 53c0fb6ef5
commit 6349a47ebc
2 changed files with 3 additions and 3 deletions

View File

@ -533,7 +533,7 @@ int rtos_generic_stack_read( struct target * target, const struct rtos_register_
{ {
address -= stacking->stack_registers_size; 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 ) if ( retval != ERROR_OK )
{ {
LOG_OUTPUT("Error reading stack frame from FreeRTOS thread\r\n"); 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 ); *hex_reg_list = (char*)malloc( list_size*2 +1 );
tmp_str_ptr = *hex_reg_list; 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++ ) for( i = 0; i < stacking->num_output_registers; i++ )
{ {
int j; int j;

View 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 = const struct rtos_register_stacking rtos_standard_Cortex_M3_stacking =
{ {
0x40, // stack_registers_size 0x40, // stack_registers_size
1, // stack_growth_direction -1, // stack_growth_direction
26, // num_output_registers 26, // num_output_registers
rtos_standard_Cortex_M3_stack_offsets // register_offsets rtos_standard_Cortex_M3_stack_offsets // register_offsets
}; };