Stack top overwritten while single-stepping

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Stack top overwritten while single-stepping

617件の閲覧回数
implicit
Contributor II

As the title suggests I'm having trouble with the stack seemingly getting trashed by the debugger. This happens with the built-in SofTec debugger of my DEMO9S12XSFAME board and a freshly installed Code Warrior 5.1.

More specifically it only happens with interrupts globally enabled in the MCU and the debugger set to ignore maskable interrupts.

 

Here's a repro case. Install it as the main file of a default 9S12XS128 C project, select the SofTec debugger, configure it to disable maskable ISR's, and try stepping through the loop.

 

#include "hidef.h"void failure(void *__far ptr, char stay) { volatile int dummy = (unsigned long) ptr >> 16; do  ++dummy; while(stay); // Generated code: /* STAB 3,-SP <- Stores the argument at $20F4 LDX  7,SP LDAB 6,SP CLRA STD  1,SPloop: INCW 1,SP <- Trashes $20F4 w. $C4 LDAB 0,SP BNE  loop LEAS 3,SP RTC */}void main(void) { EnableInterrupts; failure(NULL, 0);}
ラベル(1)
0 件の賞賛
返信
0 返答(返信)