I am facing problem While using watch
in gdb . I am trying to keep a
watch on variable m
in my code . But for some reason i am getting the following message
no symbol m in current context
. I have kept a break point at line 7 so that scope of m is known .
steps performed by me :-
1>g++ -g a.cpp
2>gdb a.out
3>(gdb)break 7
4>(gdb)watch m
我的方案如下:
# include<iostream>
# include<stdio.h>
using namespace std;
int main()
{
int m=10;
char *abc = (char *)"ritesh";
cout << abc << endl ;
m=11;
m=13;
abc=NULL;
cout << *abc <<endl;
return 0;
}
我也看到。 我如何使用“监视”的银? 但是,这无助于我。 一个人能够解释这一问题,即它正面临的问题。 以下是与我方联会有关的资料
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 <http://gnu.org/licenses/gpl.html>
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:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /home/ritesh/a.out...done.