GDB:观察点固定地址 [英] GDB: Watchpoint a fixed address
问题描述
对于我当前的嵌入式应用程序,我试图将GDB观察点放在固定的内存地址。
For my current embedded application I am trying to put GDB watch point at a fixed memory address.
举个例子,我的应用程序会更新以下地址:0x10793ad0。为了确保代码的哪个部分损坏了这个值,我尝试了
As an example, my application updates the following address: 0x10793ad0. In order to be sure which part of the code is corrupting the value, I tried
观看0x10793ad0
watch 0x10793ad0
甚至虽然GDB不会在此之后打印任何错误,但是在执行期间无法中断,即使我验证了在执行的开始和结束之间修改了值。
Even though GDB does not print any error after this, it is not able to break during execution even though I verified the value is getting modified at between start and end of execution.
问题:
a)我可以真正把手表固定在地址吗?我没有在网上遇到任何这样的例子。
b)这是正确的方法还是我缺少某些东西?
a) Can I really put watch at a fixed address? I didn't come across any such example online. b) Is this the right way or am I missing something?
推荐答案
在地址上设置观察点的正确方法是观看* 0x10793ad0 。请参阅 gdb doc
The right way to set watchpoint on address is watch *0x10793ad0. See gdb doc
这篇关于GDB:观察点固定地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!