This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Quoting and the expr parser
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: keiths at redhat dot com
- Cc: gdb at sourceware dot org
- Date: Tue, 5 Aug 2008 21:45:00 +0200 (CEST)
- Subject: Re: Quoting and the expr parser
- References: <4898A8D4.2040100@redhat.com>
> Date: Tue, 05 Aug 2008 12:24:04 -0700
> From: Keith Seitz <keiths@redhat.com>
>
> Hi,
>
> I have a simple question:
>
> Why must one type "my_class::'operator+'" instead of simply
> "my_class::operator+"?
>
> *Should* gdb accept the latter; after all, it's not ambiguous (assuming
> it's not overloaded).
GDB probably should accept that if the selected language is C++. The
problem though is that it is actually pretty difficult to make GDB
accept that wiouout the additional quotes. Normally a '+' sign isn't
allowed in a function name, so you'd have to teach the lexer/parser
that it is allowed but only if there the "operator" keyword is used
right in front of it. This is a fundamental problem with C++. It is
so badly designed that it is almost impossible to write a proper
parser for it.