你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

如何定位指针越界的问题所在?有没有哪位大侠有这方面.....

[复制链接]
shenxiaolin_mai 提问时间:2018-8-24 09:20 /
如何定位指针越界的问题所在?有没有哪位大侠有这方面的经验啊,我定义的全局变量,只是声明然后引用,并没有做任何,运行过程中变量被修改了,求教这个问题如何定位最为高效?
收藏 评论8 发布时间:2018-8-24 09:20

举报

8个回答
Mandelbrot_Set 回答时间:2018-8-24 09:52:09
mdk可以下断点,对该变量set access breakpoint
andey 回答时间:2018-8-24 09:54:47
提示: 作者被禁止或删除 内容自动屏蔽
shenxiaolin_mai 回答时间:2018-8-24 10:04:39
andeyqi 发表于 2018-8-24 09:54
记得有个条件断点,监测某段内存,只要内存被修改了就会触发该断点

请问有具体参考的操作手法么?
shenxiaolin_mai 回答时间:2018-8-24 10:05:52
Mandelbrot_Set 发表于 2018-8-24 09:52
mdk可以下断点,对该变量set access breakpoint

谢谢提醒哈!找到官方的支持文档了
http://www.keil.com/support/man/docs/uv4/uv4_cm_breakaccess.htm
shenxiaolin_mai 回答时间:2018-8-24 10:07:14
BreakAccess
Home » Debug Commands » BreakAccess
The BreakAccess command allows you to define an access breakpoint using an address range.
SyntaxDescription
BA READ exp, len, cnt, "cmd"Set a read access breakpoint.
BA WRITE exp, len, cnt, "cmd"Set a write access breakpoint.
BA READWRITE exp, len, cnt, "cmd"Set a read/write access breakpoint.
  • len is an expression that specifies the memory range in which the breakpoint triggers.
BreakAccess inherits the features of the super-set command BreakSet.
Note
  • When an Access Breakpoint (read or write) is set to a peripheral register (SFR) in the Simulator, the breakpoint might trigger even though the application did not access the peripheral register. This happens because the µVision Simulator makes no difference between application-driven and Simulator-internal accesses.
  • Access Breakpoints are sometimes called Watchpoints. Watchpoints are different from watch expressions used in a Watch window. To define watch expressions, use the command WatchSet.


评分

参与人数 1ST金币 +6 收起 理由
MrJiu + 6 赞一个!

查看全部评分

wenyangzeng 回答时间:2018-8-24 10:12:10
__IO uint32_t abc;

int main()
{

}
在main()函数外部定义,这样试试,应该不会被无故修改
shenxiaolin_mai 回答时间:2018-8-24 10:21:12
wenyangzeng 发表于 2018-8-24 10:12
__IO uint32_t abc;

int main()

都是定义的全局变量,定义的一个结构体,
tyhjrwx2011 回答时间:2018-8-24 13:11:04
内存写入、访问断点

所属标签

相似问题

关于意法半导体
我们是谁
投资者关系
意法半导体可持续发展举措
创新和工艺
招聘信息
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
关注我们
st-img 微信公众号
st-img 手机版