xiaoshen-372360 发表于 2018-8-24 09:20:11

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

如何定位指针越界的问题所在?有没有哪位大侠有这方面的经验啊,我定义的全局变量,只是声明然后引用,并没有做任何,运行过程中变量被修改了,求教这个问题如何定位最为高效?

Mandelbrot_Set 发表于 2018-8-24 09:52:09

mdk可以下断点,对该变量set access breakpoint

andeyqi 发表于 2018-8-24 09:54:47

记得有个条件断点,监测某段内存,只要内存被修改了就会触发该断点

xiaoshen-372360 发表于 2018-8-24 10:04:39

andeyqi 发表于 2018-8-24 09:54
记得有个条件断点,监测某段内存,只要内存被修改了就会触发该断点

请问有具体参考的操作手法么?

xiaoshen-372360 发表于 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

xiaoshen-372360 发表于 2018-8-24 10:07:14

BreakAccessHome » Debug Commands » BreakAccessThe 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.http://www.keil.com/support/man/docs/images/note.gif 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.
[*]

wenyangzeng 发表于 2018-8-24 10:12:10

__IO uint32_t abc;

int main()
{

}
在main()函数外部定义,这样试试,应该不会被无故修改

xiaoshen-372360 发表于 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

内存写入、访问断点
页: [1]
查看完整版本: 如何定位指针越界的问题所在?有没有哪位大侠有这方面.....