Newbie question about SP, LR etc. values in debugger

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

Newbie question about SP, LR etc. values in debugger

ソリューションへジャンプ
1,187件の閲覧回数
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 解決策
1,160件の閲覧回数
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 返答(返信)
1,131件の閲覧回数
funbotix
Contributor I

How can I mark this as closed?

0 件の賞賛
返信
1,158件の閲覧回数
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 件の賞賛
返信
1,161件の閲覧回数
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 件の賞賛
返信
1,171件の閲覧回数
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 件の賞賛
返信