This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: how to find where specified variable is declared?
On Tue, Oct 02, 2007 at 02:27:31PM +0200, Bogdan Slusarczyk wrote:
> >> Does gdb have information about source file for specified variable (I want to
> >> find where such variable is declared)?.
> > Try "list varname"?
>
> It works only for function names :(
It works fine for variables here.
(gdb) set listsize 1
(gdb) list inferior_ptid
146 ptid_t inferior_ptid;
(gdb) info source
Current source file is /space/fsf/commit/src/gdb/infcmd.c
--
Daniel Jacobowitz
CodeSourcery