Add watchpoint to stackpointer

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

Add watchpoint to stackpointer

跳至解决方案
2,690 次查看
simonwyss
Contributor III

I would like to add a watchpoint to the stackpointer to monitor the maximum level of the stack.

The following solution didn't work for me (LPCXpresso 8.2.2, Hardware LPC54102):
How to use Watchpoints 
I can attach watchpoints to variables but not to the CPU registers.

1. Add Watch for Stack Pointer:
pastedImage_2.png

2. Want to add Watchpoint, didn't work! - No option for "Add Watchpoint"
pastedImage_3.png

Add Watchpoint works for Variables:

pastedImage_5.png

标记 (2)
1 解答
2,209 次查看
converse
Senior Contributor V

It is not possible to watch registers on Cortex-M cpus.

this thread may be of interest

https://community.nxp.com/thread/428355 

在原帖中查看解决方案

4 回复数
2,210 次查看
converse
Senior Contributor V

It is not possible to watch registers on Cortex-M cpus.

this thread may be of interest

https://community.nxp.com/thread/428355 

2,209 次查看
simonwyss
Contributor III

Thank you for your response.

I already saw the article Monitoring Stack Size 
This works for me.


However, I was mislead by the article How to use Watchpoints 

This article documents that it should be possible to use Watchpoints on the Stackpointer on ARM CPUs !!!

pastedImage_5.png

0 项奖励
回复
2,209 次查看
converse
Senior Contributor V

It doesn't say that at all.

The document states "Since watchpoint 'watch' access to memory...". I.e. It works on memory. So this example is watching a write to address 0x10007D000. I guess they chose this address in case the stack grows that large.

2,209 次查看
simonwyss
Contributor III

Thank you for your explanation.
Now I understand how this mechanism works!

0 项奖励
回复