我可以在 GDB 中的“内存访问”上设置断点吗? - Can I set a breakpoint on 'memory access' in GDB?

问题:

I am running an application through gdb and I want to set a breakpoint for any time a specific variable is accessed / changed.我正在通过 gdb 运行一个应用程序,我想在任何时候访问/更改特定变量时设置一个断点。 Is there a good method for doing this?有没有好的方法可以做到这一点? I would also be interested in other ways to monitor a variable in C/C++ to see if/when it changes.我也对在 C/C++ 中监视变量以查看它是否/何时更改的其他方法感兴趣。


解决方案:

参考一: https://en.stackoom.com/question/FJD
参考二: https://stackoom.com/question/FJD
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章