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 */
When you want to debug a program you should always build with -O0 -g3 (i take that you are using gcc, if you are not your compiler will probably support other flags to turn down optimization and enable debug information).
On my system (x86_64 running Gentoo GNU/Linux) i am unable to get at the 'int a = 12' line when i use any optimization greater or equal to -O as the compiler will then apply dead code elimination. (Taken from here, it is the -fdce flag in the -O section)
Always keep this in mind when you are debugging! Verify your code by either disassembling it with objdump -D or tell your compiler to show you the generated assembly (on gcc with the -S flag)