From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31192 invoked by alias); 6 Nov 2008 16:28:19 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 31063 invoked by uid 9561); 6 Nov 2008 16:28:18 -0000 Date: Thu, 06 Nov 2008 16:28:00 -0000 Message-ID: <20081106162818.31048.qmail@sourceware.org> From: swagiaal@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-swagiaal-using-directive: Fixed gdb aliased namespace lookup problem. X-Git-Refname: refs/heads/archer-swagiaal-using-directive X-Git-Reftype: branch X-Git-Oldrev: ffe76bc7287c5fb6ab510e6b569ad8a0dc80d24f X-Git-Newrev: 4a0d9e9faa4624f280248066977d7d903032b1a4 X-SW-Source: 2008-q4/txt/msg00071.txt.bz2 List-Id: The branch, archer-swagiaal-using-directive has been updated via 4a0d9e9faa4624f280248066977d7d903032b1a4 (commit) from ffe76bc7287c5fb6ab510e6b569ad8a0dc80d24f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 4a0d9e9faa4624f280248066977d7d903032b1a4 Author: Sami Wagiaalla Date: Thu Nov 6 11:24:45 2008 -0500 Fixed gdb aliased namespace lookup problem. +2008-11-06 Sami Wagiaalla + + * cp-namespace.c (cp_lookup_symbol_namespace): Check for aliases. + lookup unqualified names without namespace concatenation. + * dwarf2read.c (read_import_statement): Figure out local alias for + the import and pass it on cp_add_using. + +2008-11-06 Sami Wagiaalla + + * gdb.cp/namespace-using.exp: Removed kfail; test has been fix. + ----------------------------------------------------------------------- Summary of changes: gdb/ChangeLog | 7 +++++++ gdb/cp-namespace.c | 30 +++++++++++++++++++++++------- gdb/dwarf2read.c | 9 +++++++-- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.cp/namespace-using.exp | 1 - 5 files changed, 41 insertions(+), 10 deletions(-) First 500 lines of diff: diff --git a/gdb/ChangeLog b/gdb/ChangeLog index be655ff..93c26ef 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2008-11-06 Sami Wagiaalla + + * cp-namespace.c (cp_lookup_symbol_namespace): Check for aliases. + lookup unqualified names without namespace concatenation. + * dwarf2read.c (read_import_statement): Figure out local alias for + the import and pass it on cp_add_using. + 2008-11-04 Sami Wagiaalla * cp-namespace.c (lookup_namespace_scope): Use diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c index 885af88..d5db551 100644 --- a/gdb/cp-namespace.c +++ b/gdb/cp-namespace.c @@ -379,15 +379,28 @@ cp_lookup_symbol_namespace (const char *namespace, current != NULL; current = current->next) { + if (strcmp (namespace, current->outer) == 0) { - sym = cp_lookup_symbol_namespace (current->inner, - name, - linkage_name, - block, - domain); - if (sym != NULL) + + /* Check for aliases */ + if(strcmp (name, current->alias) == 0){ + sym = cp_lookup_symbol_namespace (namespace, + current->inner, + linkage_name, + block, + domain); + }else{ + sym = cp_lookup_symbol_namespace (current->inner, + name, + linkage_name, + block, + domain); + } + + if (sym != NULL){ return sym; + } } } @@ -397,7 +410,10 @@ cp_lookup_symbol_namespace (const char *namespace, if (namespace[0] == '\0') { - return NULL; + sym = lookup_symbol_file (name, linkage_name, + block, domain, + cp_is_anonymous (namespace)); + return sym; } else { diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index e244655..b0f7b69 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -2821,6 +2821,7 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) const char *imported_name; const char *imported_name_prefix; char *canonical_name; + char *import_alias; const char *import_prefix; @@ -2842,7 +2843,11 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) return; } - /* FIXME: dwarf2_name (die); for the local name after import. */ + /* Figure out the local name after import. */ + import_alias = dwarf2_name(die, cu); + if(import_alias == NULL){ + import_alias = ""; + } /* Figure out where the statement is being imported to */ import_prefix = determine_prefix (die, cu); @@ -2864,7 +2869,7 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) strcpy (canonical_name, imported_name); } - using_directives = cp_add_using (import_prefix,canonical_name, "", using_directives); + using_directives = cp_add_using (import_prefix,canonical_name, import_alias, using_directives); } static void diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index d1c1375..34d7bb5 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2008-11-06 Sami Wagiaalla + + * gdb.cp/namespace-using.exp: Removed kfail; test has been fix. + 2008-11-04 Sami Wagiaalla * gdb.cp/namespace-using.exp: New test. diff --git a/gdb/testsuite/gdb.cp/namespace-using.exp b/gdb/testsuite/gdb.cp/namespace-using.exp index 70564bf..fa0010f 100644 --- a/gdb/testsuite/gdb.cp/namespace-using.exp +++ b/gdb/testsuite/gdb.cp/namespace-using.exp @@ -102,7 +102,6 @@ gdb_load ${binfile} ############################################ # Test printing of namespace aliases -setup_kfail "gdb/380" "*-*-*" if ![runto marker2] then { perror "couldn't run to breakpoint marker2" continue hooks/post-receive -- Repository for Project Archer.