From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sourceware.org
Subject: FYI: fix spelling of "delete" in c-exp.y
Date: Mon, 18 Jun 2012 20:22:00 -0000 [thread overview]
Message-ID: <87k3z4pdzg.fsf@fleche.redhat.com> (raw)
I'm checking this in.
Running the test suite with a modified compiler (jason/comdat-debug in
gcc git) shows a few regressions.
Debugging one of these showed that there were some extra spaces in
c-exp.y, that caused problems in this test case. This patch removes the
spaces.
psymtab_search_name will not remove a trailing space; but it will remove
a trailing " ()". That is the core of the problem. That plus the fact
that, with an unmodified compiler, all the methods end up in the same
CU, so we bypass the psymtab bits for the particular lookup.
I was also surprised to find the call to value_maybe_namespace_elt in
from value_struct_elt_for_reference doing a lot of work here.
I suspect this is basically a consequence of not doing type interning;
we end up with different copies of the enclosing type in different CUs,
and each one has a different set of methods attached depending on
which CU contains a method's body.
IOW, symbol tables are a crazy mess, see
http://sourceware.org/gdb/wiki/SymbolHandling
Built and regtested on x86-64 Fedora 16, with the comdat-debug gcc and
the system gcc.
Tom
2012-06-18 Tom Tromey <tromey@redhat.com>
* c-exp.y (operator): Remove trailing space after "delete" and
"delete[]".
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 1e14337..bf53fbc 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -1224,11 +1224,11 @@ const_or_volatile_noopt: const_and_volatile
operator: OPERATOR NEW
{ $$ = operator_stoken (" new"); }
| OPERATOR DELETE
- { $$ = operator_stoken (" delete "); }
+ { $$ = operator_stoken (" delete"); }
| OPERATOR NEW '[' ']'
{ $$ = operator_stoken (" new[]"); }
| OPERATOR DELETE '[' ']'
- { $$ = operator_stoken (" delete[] "); }
+ { $$ = operator_stoken (" delete[]"); }
| OPERATOR '+'
{ $$ = operator_stoken ("+"); }
| OPERATOR '-'
next reply other threads:[~2012-06-18 20:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-18 20:22 Tom Tromey [this message]
2012-06-19 10:49 ` Regression for -gstabs+ [Re: FYI: fix spelling of "delete" in c-exp.y] Jan Kratochvil
2012-06-19 14:10 ` Tom Tromey
2012-06-19 15:05 ` Jan Kratochvil
2012-06-19 17:24 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k3z4pdzg.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox