This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: p 'CV::m(int)' vs p CV::m(int)
- From: Keith Seitz <keiths at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>, GDB <gdb at sourceware dot org>
- Date: Thu, 21 Jul 2016 11:17:08 -0700
- Subject: Re: p 'CV::m(int)' vs p CV::m(int)
- Authentication-results: sourceware.org; auth=none
- References: <CAH=s-PMCX9ar6EnMHTjupdPZnMiMNWH4YQeyRtDJJpu9vECmWQ@mail.gmail.com>
On 07/15/2016 06:49 AM, Yao Qi wrote:
> Hi,
> I just notice that p 'CV::m(int)' is different p CV::m(int), (with and
> without single quote). Where do we document p 'CV::m(int)'? I see
> https://sourceware.org/gdb/onlinedocs/gdb/Variables.html
> but it is about using single quote before "::". However, the usage
> like 'CV::m(int)' isn't documented there.
I was hoping someone with more history on this hack would speak up, but
it doesn't appear that anyone is going to fess up to this. Therefore,
having expended a considerable amount of energy on removing this hack, I
offer my $.00002 (USD).
IIRC this originated as a way of bypassing the parser sometime after C++
"support" was added to GDB. Rather like a "literal," the whole token is
taken verbatim. We look for *exactly* that literal in the symbol table.
Much easier than fixing the parser bugs!
I have tried over the past several years to slowly remove the need for
such hacks. [Linespec had a similar hack, which now only exists for
backward "compatibility," i.e., maintaining previous buggy behavior.]
I would really prefer we stop broadcasting this workaround and encourage
users to file bugs, and, of course, for developers to (continue to) fix
them!
Keith