public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-sami-dwarf-names-branch: Removed kfail from all fixed namespace tests.
@ 2009-08-11 18:58 swagiaal
  0 siblings, 0 replies; only message in thread
From: swagiaal @ 2009-08-11 18:58 UTC (permalink / raw)
  To: archer-commits

The branch, archer-sami-dwarf-names-branch has been updated
       via  c507351b6e638ad326bc10669b41c6ba59bcbcdd (commit)
       via  69c2a6934d01fde7944991b1f3350c99eb3b49c6 (commit)
       via  69cdf32b1c89af017002f8ba4d86687c9de939d0 (commit)
       via  9bd77444afabcaae76cf4c83d7a5d3f0ac696138 (commit)
      from  96b000b2d7d6050755332523d15f16d46aa9d2cd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit c507351b6e638ad326bc10669b41c6ba59bcbcdd
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Fri Jan 23 14:25:09 2009 -0500

    Removed kfail from all fixed namespace tests.
    
    2009-01-23  Sami Wagiaalla  <swagiaal@redhat.com>
    
    	* gdb.cp/namespace.exp: Used cp_test_ptype_class for matching classes.
    	* lib/cp-support.exp: Added support for class names containing '::'.

commit 69c2a6934d01fde7944991b1f3350c99eb3b49c6
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Fri Jan 23 12:01:23 2009 -0500

    Added handling for global names, and removed kfail from test.
    
    2009-01-23  Sami Wagiaalla  <swagiaal@redhat.com>
    
    	* symtab.c (lookup_symbol_in_language): Added handling for global
    	names.
    
    2009-01-23  Sami Wagiaalla  <swagiaal@redhat.com>
    
     	* c-exp.y: Created name_prefix, and used it during lexing.
    
     2009-01-15  Sami Wagiaalla  <swagiaal@redhat.com>

commit 69cdf32b1c89af017002f8ba4d86687c9de939d0
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Fri Jan 23 11:42:10 2009 -0500

    Created name_prefix, and used it during lexing.
    
    2009-01-23  Sami Wagiaalla  <swagiaal@redhat.com>
    
    	* c-exp.y: Created name_prefix, and used it during lexing.

commit 9bd77444afabcaae76cf4c83d7a5d3f0ac696138
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Thu Jan 15 16:03:05 2009 -0500

    Added a parse rule for qualified global references.
    
    2009-01-15  Sami Wagiaalla  <swagiaal@redhat.com>
    
    	* c-exp.y: Added a rule for qualified global references.

-----------------------------------------------------------------------

Summary of changes:
 gdb/c-exp.y                        |   51 +++++++++++++++++++++++++++++++++--
 gdb/symtab.c                       |    5 +++
 gdb/testsuite/gdb.cp/namespace.exp |   23 +++++++++++-----
 gdb/testsuite/lib/cp-support.exp   |    3 +-
 4 files changed, 71 insertions(+), 11 deletions(-)

First 500 lines of diff:
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index d4bbbcc..1f5ff1b 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -713,12 +713,13 @@ qualified_name:	typebase COLONCOLON name
 	;
 
 variable:	qualified_name
+	|	COLONCOLON qualified_name
 	|	COLONCOLON name
 			{
 			  char *name = copy_name ($2);
 			  struct symbol *sym;
 			  struct minimal_symbol *msymbol;
-
+			  
 			  sym =
 			    lookup_symbol (name, (const struct block *) NULL,
 					   VAR_DOMAIN, (int *) NULL);
@@ -1526,6 +1527,13 @@ static int last_was_structop;
 static int
 yylex ()
 {
+  /* name_prefix stores the full qualification of a variable that is
+     specified in the expression. It is used to eleminate confusion 
+     during lookup.*/
+  static char* name_prefix = NULL;
+  static int name_prefix_len = 0;
+  static int terminate_prefix = 0;
+  
   int c;
   int namelen;
   unsigned int i;
@@ -1540,9 +1548,18 @@ yylex ()
   char *copy;
 
   last_was_structop = 0;
-
+  
  retry:
-
+  
+  if(terminate_prefix ||
+     lexptr != name_prefix + name_prefix_len // Some token was skiped so clear name_prefix
+   ){
+    name_prefix = NULL;
+    name_prefix_len = 0;
+  }
+    
+  terminate_prefix = 1;
+  	  	  
   /* Check if this is a macro invocation that we need to expand.  */
   if (! scanning_macro_expansion ())
     {
@@ -1570,10 +1587,19 @@ yylex ()
   for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++)
     if (strncmp (tokstart, tokentab2[i].operator, 2) == 0)
       {
+	
+	if(tokentab2[i].token == COLONCOLON){
+	  name_prefix_len += 2;
+	  terminate_prefix = 0;
+	  if(name_prefix == NULL){
+   	    name_prefix = lexptr;
+          }
+	}
 	lexptr += 2;
 	yylval.opcode = tokentab2[i].opcode;
 	if (in_parse_field && tokentab2[i].token == ARROW)
 	  last_was_structop = 1;
+	
 	return tokentab2[i].token;
       }
 
@@ -1602,6 +1628,8 @@ yylex ()
         return 0;
 
     case ' ':
+      name_prefix_len++;
+      terminate_prefix = 0;
     case '\t':
     case '\n':
       lexptr++;
@@ -1836,11 +1864,13 @@ yylex ()
     error ("Invalid character '%c' in expression.", c);
 
   /* It's a name.  See how long it is.  */
+  
   namelen = 0;
   for (c = tokstart[namelen];
        (c == '_' || c == '$' || (c >= '0' && c <= '9')
 	|| (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '<');)
     {
+    
       /* Template parameter lists are part of the name.
 	 FIXME: This mishandles `print $a<4&&$a>3'.  */
 
@@ -1908,10 +1938,24 @@ yylex ()
     int is_a_field_of_this = 0;
     int hextype;
 
+    if(name_prefix != NULL){
+      copy = savestring (name_prefix, name_prefix_len+namelen);
+    }
+
     sym = lookup_symbol (copy, expression_context_block,
 			 VAR_DOMAIN,
 			 parse_language->la_language == language_cplus
 			 ? &is_a_field_of_this : (int *) NULL);
+			 
+    /* keep this name as prefix for the next name */
+    if(sym){
+      if(name_prefix == NULL){
+        name_prefix = tokstart;
+      }
+      name_prefix_len += namelen;
+      terminate_prefix = 0;
+    }
+
     /* Call lookup_symtab, not lookup_partial_symtab, in case there are
        no psymtabs (coff, xcoff, or some future change to blow away the
        psymtabs once once symbols are read).  */
@@ -1970,6 +2014,7 @@ yylex ()
     yylval.ssym.is_a_field_of_this = is_a_field_of_this;
     if (in_parse_field && *lexptr == '\0')
       saw_name_at_eof = 1;
+        
     return NAME;
   }
 }
diff --git a/gdb/symtab.c b/gdb/symtab.c
index b9befed..796c797 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -1200,6 +1200,11 @@ lookup_symbol_in_language (const char *name, const struct block *block,
   int needtofreename = 0;
   struct symbol *returnval;
 
+  if(strncmp(name, "::", 2) == 0){/* this must be a global name */
+    name = name+2;
+    block = NULL;
+  }
+  
   modified_name = name;
 
   /* If we are using C++ or Java, demangle the name before doing a lookup, so
diff --git a/gdb/testsuite/gdb.cp/namespace.exp b/gdb/testsuite/gdb.cp/namespace.exp
index 76b1b82..2042db2 100644
--- a/gdb/testsuite/gdb.cp/namespace.exp
+++ b/gdb/testsuite/gdb.cp/namespace.exp
@@ -24,6 +24,7 @@
 # for namespaces.
 # Note: As of 2000-06-03, they passed under g++ - djb
 
+load_lib "cp-support.exp"
 
 if $tracelevel then {
         strace $tracelevel
@@ -259,11 +260,16 @@ gdb_test "ptype E" "type = namespace C::D::E"
 gdb_test "ptype CClass" "type = (class C::CClass \{\r\n  public:|struct C::CClass \{)\r\n    int x;\r\n\}"
 gdb_test "ptype CClass::NestedClass" "type = (class C::CClass::NestedClass \{\r\n  public:|struct C::CClass::NestedClass \{)\r\n    int y;\r\n\}"
 gdb_test "ptype NestedClass" "No symbol \"NestedClass\" in current context."
-setup_kfail "gdb/1448" "*-*-*"
-gdb_test "ptype ::C::CClass" "type = class C::CClass \{\r\n  public:\r\n    int x;\r\n\}"
-setup_kfail "gdb/1448" "*-*-*"
-gdb_test "ptype ::C::CClass::NestedClass" "type = class C::CClass::NestedClass \{\r\n  public:\r\n    int y;\r\n\}"
-setup_kfail "gdb/1448" "*-*-*"
+cp_test_ptype_class \
+	"ptype ::C::CClass" "" "class" "C::CClass" \
+	{
+	    { field public "int x;" }
+	}
+cp_test_ptype_class \
+	"ptype ::C::CClass::NestedClass" "" "class" "C::CClass::NestedClass" \
+	{
+	    { field public "int y;" }
+	}
 gdb_test "ptype ::C::NestedClass" "No symbol \"NestedClass\" in namespace \"C\"."
 gdb_test "ptype C::CClass" "No symbol \"CClass\" in namespace \"C::C\"."
 gdb_test "ptype C::CClass::NestedClass" "No type \"CClass\" within class or namespace \"C::C\"."
@@ -273,8 +279,11 @@ gdb_test "ptype C::NestedClass" "No symbol \"NestedClass\" in namespace \"C::C\"
 
 gdb_test "print cOtherFile" "\\$\[0-9\].* = 316"
 gdb_test "ptype OtherFileClass" "type = (class C::OtherFileClass \{\r\n  public:|struct C::OtherFileClass \{)\r\n    int z;\r\n\}"
-setup_kfail "gdb/1448" "*-*-*"
-gdb_test "ptype ::C::OtherFileClass" "type = class C::OtherFileClass \{\r\n  public:\r\n    int z;\r\n\}"
+cp_test_ptype_class \
+	"ptype ::C::OtherFileClass" "" "class" "C::OtherFileClass" \
+	{
+	    { field public "int z;" }
+	}
 gdb_test "ptype C::OtherFileClass" "No symbol \"OtherFileClass\" in namespace \"C::C\"."
 
 # Some anonymous namespace tests.
diff --git a/gdb/testsuite/lib/cp-support.exp b/gdb/testsuite/lib/cp-support.exp
index dbd2f59..44e1b51 100644
--- a/gdb/testsuite/lib/cp-support.exp
+++ b/gdb/testsuite/lib/cp-support.exp
@@ -222,7 +222,7 @@ proc cp_test_ptype_class { in_command in_testname in_key in_tag in_class_table {
 
     set parse_okay 0
     gdb_test_multiple "$in_command" "$in_testname // parse failed" {
-	-re "type = (struct|class)${wsopt}(\[A-Za-z0-9_\]*)${wsopt}((:\[^\{\]*)?)${wsopt}\{(.*)\}${wsopt}(\[^\r\n\]*)\[\r\n\]+$gdb_prompt $" {
+	-re "type = (struct|class)${wsopt}(\[A-Za-z0-9_:\]*)${wsopt}((:\[^\{\]*)?)${wsopt}\{(.*)\}${wsopt}(\[^\r\n\]*)\[\r\n\]+$gdb_prompt $" {
 	    set parse_okay          1
 	    set actual_key          $expect_out(1,string)
 	    set actual_tag          $expect_out(2,string)
@@ -231,6 +231,7 @@ proc cp_test_ptype_class { in_command in_testname in_key in_tag in_class_table {
 	    set actual_tail         $expect_out(6,string)
 	}
     }
+    
     if { ! $parse_okay } then { return }
 
     # Check the actual key.  It would be nice to require that it match


hooks/post-receive
--
Repository for Project Archer.


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

only message in thread, other threads:[~2009-08-11 18:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-11 18:58 [SCM] archer-sami-dwarf-names-branch: Removed kfail from all fixed namespace tests 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).