This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/931: GDB could be more generous when reading types C++ templates on input


>Number:         931
>Category:       c++
>Synopsis:       GDB could be more generous when reading types C++ templates on input
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 14 14:38:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     carlton@math.stanford.edu
>Release:        GNU gdb 2003-01-14-cvs
>Organization:
>Environment:
i686-pc-linux-gnu, GCC 3.1, DWARF-2 (but probably any
environment would work)
>Description:
When the user types a template, GDB frequently requires
the type to be typed in a certain way (e.g. "const char*" as opposed to "const char *" or "char const *" or "char const*").
>How-To-Repeat:
Compile the following file:

template <typename T>
class C {
};

int main()
{
  C<char const *> c;
}

Then, in an ideal world, all of the following ptypes should work:

(gdb) b main
Breakpoint 1 at 0x80484a0: file temp.cc, line 8.
(gdb) r
Starting program: /home/carlton/tmp/a.out 

Breakpoint 1, main () at temp.cc:8
8	}
(gdb) p c
$1 = {<No data fields>}
(gdb) ptype c
type = class C<const char*> {
}
(gdb) ptype C<const char *>
No symbol "C<const char *>" in current context.
(gdb) ptype C<const char*>
type = class C<const char*> {
}
(gdb) ptype C<char const*>
No symbol "C<char const*>" in current context.
(gdb) ptype C<char const *>
No symbol "C<char const *>" in current context.
>Fix:
I think I have a fix for the whitespace issue, but
it will take a while before we are able to allow users to
switch around 'const' and 'char', I fear.
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]