How can I use “watch” GDB?

前端 未结 3 1955
旧巷少年郎
旧巷少年郎 2020-12-20 15:52

I tried to watch the change of the \"int a\" by the command \"watch a\". However, the program does not stop, when it changes to 12. Why?

 /* FILE: test.c */
         


        
3条回答
  •  余生分开走
    2020-12-20 16:41

    The compiler is likely not even generating code to assign 12 to "a", it would be a good idea to disassemble the generated code to confirm. You probably need a slightly more complex test to try this out.

提交回复
热议问题