This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: gdb, c++ & namespaces
"Eli Zaretskii" <eliz@elta.co.il> writes:
| > Date: Wed, 14 Jan 2004 09:17:30 -0500 (EST)
| > From: mec.gnu@mindspring.com (Michael Elizabeth Chastain)
| >
| > (gdb) set print object off
| > (gdb) print *dp
| > (gdb) set print object on
| > (gdb) print *dp
| >
| > When "set print object" is off, gdb will print an object of the type
| > of the pointer (we call this the "static type"). When "set print object"
| > is on, gdb will print the type of the object in memory (we call this
| > the "dynamic type".
|
| The manual doesn't mention "static type" and "dynamic type" in the
| section that describes "set pruint". I think it should, if this
| terminology is to be widely accepted.
The phrases "static type" and "dynamic type" are standard terms with
precise meanings used to describe Standard C++.
"static type" is the type of the expression, as determined by static
analysis (i.e. at compile-time) to access and object.
"dynamic type" is what the C standard would call the "effective type".
It is the type of the object as determined at its construction/creation.
See the first chapter of the C++ standard.
-- Gaby