Newbie question about SP, LR etc. values in debugger

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Newbie question about SP, LR etc. values in debugger

跳至解决方案
899 次查看
sodacan
Contributor I

After having used KEIL's uVision IDE for decades, I've recently begun using MCUXpresso. While debugging and stepping through disassembly code, the way the SP, PC, LR, etc. values behave in the debugger's register window doesn't make sense to me. For example, when doing push or pop operations I expected the value of the SP to change, but it doesn't. Similarly, when looking at a memory monitor window centered around where the stack pointer is pointing, I expected to see values changing there when push operations occurred, but they don't. Is my expectation wrong, or am I [most likely] doing something wrong while stepping through this code, or is it something else?

FWIW, I'm using v11.4.1 [Build6260] of the IDE in a project for an imxrt1062 device.

Confused.

0 项奖励
1 解答
872 次查看
lpcxpresso_supp
NXP Employee
NXP Employee

There are several types of stepping and you do not mention which one you use. SP/PC/LR do update if the instructions being stepped actually have side effects on these registers. For example, in the screenshots below you can see the SP/PC values before and after executing a single step over the "push" instruction seen in Disassembly view. The memory area around SP value also gets updated. Note that I activated single stepping using the highlighted icon from Debug view.

lpcxpresso_supp_0-1669024851501.png

lpcxpresso_supp_1-1669024914238.png

Regards,
MCUXpresso IDE Support

 

 

在原帖中查看解决方案

0 项奖励
4 回复数
843 次查看
funbotix
Contributor I

How can I mark this as closed?

0 项奖励
870 次查看
funbotix
Contributor I

Thanks for the replies. When I step over ASM instructions such as push/pop the value for SP in the registers windows does not change, nor does the memory it points to. I appreciate your response. Not sure what to do next. I'll assume it's some kind of user error on my end. Thanks.

0 项奖励
873 次查看
lpcxpresso_supp
NXP Employee
NXP Employee

There are several types of stepping and you do not mention which one you use. SP/PC/LR do update if the instructions being stepped actually have side effects on these registers. For example, in the screenshots below you can see the SP/PC values before and after executing a single step over the "push" instruction seen in Disassembly view. The memory area around SP value also gets updated. Note that I activated single stepping using the highlighted icon from Debug view.

lpcxpresso_supp_0-1669024851501.png

lpcxpresso_supp_1-1669024914238.png

Regards,
MCUXpresso IDE Support

 

 

0 项奖励
883 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi

When I use MCUXpresso v11.6.1 debug code, I can see registers change when I step over the code. see below in register window

ZhangJennie_0-1668583022947.png

 

Could you please let me know how to reproduce your problem?

Thanks,

Jun Zhang

0 项奖励