Re: gdb, c++ & namespaces

Gabriel Dos Reis
2004-01-16T22:09:44Z

mec.gnu@mindspring.com (Michael Elizabeth Chastain) writes:

| eli> The manual doesn't mention "static type" and "dynamic type" in the
| eli> section that describes "set pruint". I think it should, if this
| eli> terminology is to be widely accepted.
|
| I don't know what the popular usage in the C++ community is.
| I don't want to invent new phrases if there are existing phrases.

"static type" and "dynamic type" are not new phrases :-)

| I checked "The C++ Programming Language" and it does not have
| any nice phrases to distinguish "the type that the pointer says"
| versus "the type that the object in memory has".

I think GDB maintainers should also consult the C++ standard when they
implement support tools for C+ ;-).

1.3.3 dynamic type
the type of the most derived object (1.8) to which the lvalue
denoted by an lvalue expression refers. [Example: if a pointer
(8.3.1) p whose static type is "pointer to class B" is pointing to
an object of class D, derived from B (clause 10), the dynamic type
of the expression *p is "D". References (8.3.2) are treated
similarly. ] The dynamic type of an rvalue is its static type.

1.3.11 static type
the type of an expression (3.9), which type results from analysis
of the program without considering execution semantics. The static
type of an expression depends only on the form of the program in
which the expression appears, and does not change while the program
is executing.

-- Gaby