title: setting Watch in GDB not working for me
body: <p>I am facing problem While using <code>watch</code> in gdb . I am trying to keep a 
  watch on variable <code>m</code> in my code . But for some reason i am getting the following message
  <code>no symbol m in current context</code>. I have kept a break point at line 7 so that scope of m is known . </p>
  
  <pre><code>    steps performed by me :-
      1&gt;g++ -g a.cpp
      2&gt;gdb a.out
      3&gt;(gdb)break 7
      4&gt;(gdb)watch m
  </code></pre>
  
  <p>Below is my program :-  </p>
  
  <pre><code>    # include&lt;iostream&gt;
      # include&lt;stdio.h&gt;
      using namespace std;
  
      int main()
      {
  
        int m=10;
        char *abc = (char *)"ritesh";
        cout &lt;&lt; abc &lt;&lt; endl ;
        m=11; 
        m=13;
        abc=NULL;
        cout &lt;&lt; *abc &lt;&lt;endl;
  
       return 0;
      }
  </code></pre>
  
  <p>I have also seen <a href="https://stackoverflow.com/questions/835757/how-can-i-use-watch-gdb">How can I use &quot;watch&quot; GDB?</a> But it did not help me much . Can someone explain this problem i am facing.Below are information related to my GNU</p>
  
  <pre><code>    ritesh@ubuntu:~$ gdb a.out 
      GNU gdb (Ubuntu/Linaro 7.3-0ubuntu2) 7.3-2011.08
      Copyright (C) 2011 Free Software Foundation, Inc.
      License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
      and "show warranty" for details.
      This GDB was configured as "i686-linux-gnu".
      For bug reporting instructions, please see:
      &lt;http://bugs.launchpad.net/gdb-linaro/&gt;...
      Reading symbols from /home/ritesh/a.out...done.
  </code></pre>