public inbox for gdb-prs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org> To: gdb-prs@sourceware.org Subject: [Bug c++/16253] Cannot print an enum var with the same name as tag Date: Mon, 14 Apr 2014 22:56:00 -0000 [thread overview] Message-ID: <bug-16253-4717-uOskpk7avb@http.sourceware.org/bugzilla/> (raw) In-Reply-To: <bug-16253-4717@http.sourceware.org/bugzilla/> https://sourceware.org/bugzilla/show_bug.cgi?id=16253 --- Comment #5 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> --- This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "gdb and binutils". The branch, master has been updated via b50c861487bb7d71185777193a9246bac81e4f26 (commit) from 3d567982aca11c85a7fa31f13046de3271d3afc8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b50c861487bb7d71185777193a9246bac81e4f26 commit b50c861487bb7d71185777193a9246bac81e4f26 Author: Keith Seitz <keiths@redhat.com> Date: Mon Apr 14 15:47:15 2014 -0700 Remove symbol_matches_domain. This fixes PR c++/16253. symbol_matches_domain was permitting searches for a VAR_DOMAIN symbol to also match STRUCT_DOMAIN symbols for languages like C++ where STRUCT_DOMAIN symbols also define a typedef of the same name, e.g., "struct foo {}" introduces a typedef of the name "foo". Problems occur if there exists both a VAR_DOMAIN and STRUCT_DOMAIN symbol of the same name. Then it is essentially a race between which symbol is found first. The other symbol is obscurred. [This is a relatively common idiom: enum e { ... } e;] This patchset moves this "language defines a typedef" logic to lookup_symbol[_in_language], looking first for a symbol in the given domain and falling back to searching STRUCT_DOMAIN when/if appropriate. 2014-04-14 Keith Seitz <keiths@redhat.com> PR c++/16253 * ada-lang.c (ada_symbol_matches_domain): Moved here and renamed from symbol_matches_domain in symtab.c. All local callers of symbol_matches_domain updated. (standard_lookup): If DOMAIN is VAR_DOMAIN and no symbol is found, search STRUCT_DOMAIN. (ada_find_any_type_symbol): Do not search STRUCT_DOMAIN independently. standard_lookup will do that automatically. * cp-namespace.c (cp_lookup_symbol_nonlocal): Explain when/why VAR_DOMAIN searches may return a STRUCT_DOMAIN match. (cp_lookup_symbol_in_namespace): Likewise. If no VAR_DOMAIN symbol is found, search STRUCT_DOMAIN. (cp_lookup_symbol_exports): Explain when/why VAR_DOMAIN searches may return a STRUCT_DOMAIN match. (lookup_symbol_file): Search for the class name in STRUCT_DOMAIN. * cp-support.c: Include language.h. (inspect_type): Explicitly search STRUCT_DOMAIN before searching VAR_DOMAIN. * psymtab.c (match_partial_symbol): Compare the requested domain with the symbol's domain directly. (lookup_partial_symbol): Likewise. * symtab.c (lookup_symbol_in_language): Explain when/why VAR_DOMAIN searches may return a STRUCT_DOMAIN match. If no VAR_DOMAIN symbol is found, search STRUCT_DOMAIN for appropriate languages. (symbol_matches_domain): Renamed `ada_symbol_matches_domain' and moved to ada-lang.c (lookup_block_symbol): Explain that this function only returns symbol matching the requested DOMAIN. Compare the requested domain with the symbol's domain directly. (iterate_over_symbols): Compare the requested domain with the symbol's domain directly. * symtab.h (symbol_matches_domain): Remove. 2014-04-14 Keith Seitz <keiths@redhat.com> PR c++/16253 * gdb.cp/var-tag.cc: New file. * gdb.cp/var-tag.exp: New file. * gdb.dwarf2/dw2-ada-ffffffff.exp: Set the language to C++. * gdb.dwarf2/dw2-anon-mptr.exp: Likewise. * gdb.dwarf2/dw2-double-set-die-type.exp: Likewise. * gdb.dwarf2/dw2-inheritance.exp: Likewise. ----------------------------------------------------------------------- Summary of changes: gdb/ChangeLog | 36 +++++++ gdb/ada-lang.c | 65 ++++++++++--- gdb/cp-namespace.c | 39 +++++++-- gdb/cp-support.c | 25 +++++- gdb/psymtab.c | 15 +-- gdb/symtab.c | 60 ++++++------ gdb/symtab.h | 4 - gdb/testsuite/ChangeLog | 10 ++ gdb/testsuite/gdb.cp/var-tag.cc | 44 +++++++++ gdb/testsuite/gdb.cp/var-tag.exp | 99 ++++++++++++++++++++ gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.exp | 4 + gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.exp | 2 + .../gdb.dwarf2/dw2-double-set-die-type.exp | 1 + gdb/testsuite/gdb.dwarf2/dw2-inheritance.exp | 1 + 14 files changed, 339 insertions(+), 66 deletions(-) create mode 100644 gdb/testsuite/gdb.cp/var-tag.cc create mode 100644 gdb/testsuite/gdb.cp/var-tag.exp -- You are receiving this mail because: You are on the CC list for the bug.
next prev parent reply other threads:[~2014-04-14 22:56 UTC|newest] Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-11-26 14:24 [Bug gdb/16253] New: " polacek at redhat dot com 2013-11-26 14:27 ` [Bug gdb/16253] " polacek at redhat dot com 2013-11-27 18:52 ` keiths at redhat dot com 2013-11-27 23:48 ` polacek at redhat dot com 2014-03-21 18:14 ` [Bug c++/16253] " keiths at redhat dot com 2014-04-14 22:56 ` cvs-commit at gcc dot gnu.org [this message] 2014-04-14 22:57 ` keiths at redhat dot com 2014-05-28 1:51 ` dje at google dot com 2014-05-28 1:54 ` dje at google dot com 2014-05-28 17:25 ` dje at google dot com 2014-06-04 3:32 ` xdje42 at gmail dot com 2014-08-29 13:37 ` lgustavo at codesourcery dot com 2015-06-03 15:36 ` fche at redhat dot com 2015-06-03 16:06 ` jason at redhat dot com 2015-06-03 16:09 ` jason at redhat dot com 2015-06-03 16:10 ` jason at redhat dot com 2015-06-03 16:15 ` dje at google dot com 2015-06-03 16:19 ` mgretton at sourceware dot org 2015-06-03 17:32 ` dje at google dot com 2015-06-04 16:01 ` fweimer at redhat dot com 2015-06-04 17:29 ` dje at google dot com 2015-06-12 15:53 ` keiths at redhat dot com 2015-06-26 18:43 ` cvs-commit at gcc dot gnu.org
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=bug-16253-4717-uOskpk7avb@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=gdb-prs@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: linkBe 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; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).