Article View: gnu.gdb.bug
Article #8852Re: filename: :variable
From: Fred Fish
Date: Sun, 20 Sep 1992 14:08
Date: Sun, 20 Sep 1992 14:08
54 lines
1783 bytes
1783 bytes
> It seems that (in gdb-4.5) we cannot print variables with the
> following syntax :
>
> filename::variable
The basic problem is that the syntax is ambiguous as the following
example shows. You can use single quotes to force the filename portion
to be treated as a single token.
Script started on Sun Sep 20 06:58:41 1992
$ cat pw.C
static int foo = 5;
class C {
public:
int foo;
};
class D : public C {
public:
int bar;
};
main ()
{
D pw;
pw.C::foo = 1;
}
$ gcc -g -o pw pw.C
$ gdb pw
GDB is free software and you are welcome to distribute copies of it
under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.6.6, Copyright 1992 Free Software Foundation, Inc...
(gdb) b main
Breakpoint 1 at 0x229c: file pw.C, line 17.
(gdb) run
Starting program: /tmp/pw
Breakpoint 1, main () at pw.C:17
17 pw.C::foo = 1;
(gdb) next
18 }
(gdb) p pw.C::foo
$1 = 1
(gdb) p 'pw.C'::foo
$2 = 5
(gdb) quit
The program is running. Quit anyway? (y or n) y
$ exit
exit
script done on Sun Sep 20 06:59:42 1992
Technical Details
Message-ID:
<9209201408.AA20702@fishpond.cygnus.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cygnus.com!fnfReferences:
<9209190223.AA26395@_la.tce.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f5053,41bb9358d67d1bd5 X-Google-Attributes: gidf5053,public X-Google-ArrivalTime: 1992-09-20 11:02:20 PST Newsgroups: gnu.gdb.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cygnus.com!fnf From: fnf@cygnus.com (Fred Fish) Subject: Re: filename: :variable Message-ID: <9209201408.AA20702@fishpond.cygnus.com> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet References: <9209190223.AA26395@_la.tce.com> Distribution: gnu Date: Sun, 20 Sep 1992 14:08:15 GMT Approved: bug-gdb@prep.ai.mit.edu Lines: 56