我可以在 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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章