public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-swagiaal-using-directive: Fixed gdb aliased namespace lookup problem.
@ 2008-11-06 16:28 swagiaal
  0 siblings, 0 replies; only message in thread
From: swagiaal @ 2008-11-06 16:28 UTC (permalink / raw)
  To: archer-commits

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 <swagiaal@redhat.com>
Date:   Thu Nov 6 11:24:45 2008 -0500

    Fixed gdb aliased namespace lookup problem.
    
    +2008-11-06  Sami Wagiaalla  <swagiaal@redhat.com>
    +
    +	* 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  <swagiaal@redhat.com>
    +
    +	* 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  <swagiaal@redhat.com>
+
+	* 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  <swagiaal@redhat.com>
 
 	* 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  <swagiaal@redhat.com>
+
+	* gdb.cp/namespace-using.exp: Removed kfail; test has been fix.
+
 2008-11-04  Sami Wagiaalla  <swagiaal@redhat.com>
 
 	* 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.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-11-06 16:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-06 16:28 [SCM] archer-swagiaal-using-directive: Fixed gdb aliased namespace lookup problem swagiaal

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).