public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-keiths-expr-cumulative: Merge branch 'archer-keiths-expr-cumulative' of ssh://sourceware.org/git/archer into archer-keiths-expr-cumulative
@ 2010-02-03 19:36 swagiaal
  0 siblings, 0 replies; 2+ messages in thread
From: swagiaal @ 2010-02-03 19:36 UTC (permalink / raw)
  To: archer-commits

The branch, archer-keiths-expr-cumulative has been updated
       via  dcaa152a0d7dc42083e4297cbe66e3cf4781f6d7 (commit)
       via  489b53b15e60762faa0336a4bfcf434508aa4092 (commit)
      from  f8821e77873ce139d3d5387230f7effbb45ecaf5 (commit)

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

- Log -----------------------------------------------------------------
commit dcaa152a0d7dc42083e4297cbe66e3cf4781f6d7
Merge: 489b53b15e60762faa0336a4bfcf434508aa4092 f8821e77873ce139d3d5387230f7effbb45ecaf5
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Wed Feb 3 14:34:20 2010 -0500

    Merge branch 'archer-keiths-expr-cumulative' of ssh://sourceware.org/git/archer into archer-keiths-expr-cumulative

commit 489b53b15e60762faa0336a4bfcf434508aa4092
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Wed Feb 3 14:32:58 2010 -0500

    Adding Koenig Lookup Support.

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

Summary of changes:
 gdb/c-exp.y                               |   32 +++++
 gdb/cp-support.c                          |   93 ++++++++++++---
 gdb/cp-support.h                          |    4 +
 gdb/eval.c                                |   39 ++++++
 gdb/expprint.c                            |    2 +
 gdb/expression.h                          |    4 +
 gdb/parse.c                               |    7 +
 gdb/testsuite/gdb.cp/namespace-koenig.cc  |  188 +++++++++++++++++++++++++++++
 gdb/testsuite/gdb.cp/namespace-koenig.exp |   95 +++++++++++++++
 gdb/valops.c                              |   67 +++++++----
 10 files changed, 491 insertions(+), 40 deletions(-)
 create mode 100644 gdb/testsuite/gdb.cp/namespace-koenig.cc
 create mode 100644 gdb/testsuite/gdb.cp/namespace-koenig.exp

First 500 lines of diff:
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index b86fc8e..459177a 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -186,6 +186,7 @@ static struct stoken operator_stoken (const char *);
 %token <tsval> STRING
 %token <tsval> CHAR
 %token <ssym> NAME /* BLOCKNAME defined below to give it higher precedence. */
+%token <ssym> UNKNOWN_CPP_NAME
 %token <voidval> COMPLETE
 %token <tsym> TYPENAME
 %type <sval> name
@@ -391,6 +392,30 @@ exp	:	exp '('
 			  write_exp_elt_opcode (OP_FUNCALL); }
 	;
 
+exp	:	UNKNOWN_CPP_NAME '('
+			{
+
+			 /* This could potentially be a an argument defined
+			    lookup function (Koenig).  */
+			  write_exp_elt_opcode (OP_ADL_FUNC);
+			  write_exp_elt_block (expression_context_block);
+			  write_exp_elt_sym (NULL); /* Place holder */
+			  write_exp_string ($1.stoken);
+			  write_exp_elt_opcode (OP_ADL_FUNC);
+
+			/* This is to save the value of arglist_len
+			   being accumulated by an outer function call.  */
+
+			  start_arglist ();
+			}
+		arglist ')'	%prec ARROW
+			{
+			  write_exp_elt_opcode (OP_FUNCALL);
+			  write_exp_elt_longcst ((LONGEST) end_arglist ());
+			  write_exp_elt_opcode (OP_FUNCALL);
+			}
+	;
+
 lcurly	:	'{'
 			{ start_arglist (); }
 	;
@@ -1305,6 +1330,7 @@ name	:	NAME { $$ = $1.stoken; }
 	|	BLOCKNAME { $$ = $1.stoken; }
 	|	TYPENAME { $$ = $1.stoken; }
 	|	NAME_OR_INT  { $$ = $1.stoken; }
+	|	UNKNOWN_CPP_NAME  { $$ = $1.stoken; }	
 	|	operator { $$ = $1; }
 	;
 
@@ -1317,6 +1343,7 @@ name_not_typename :	NAME
    context where only a name could occur, this might be useful.
   	|	NAME_OR_INT
  */
+  	|	UNKNOWN_CPP_NAME 
 	|	operator
 			{
 			  $$.stoken = $1;
@@ -2496,6 +2523,11 @@ yylex (void)
     if (in_parse_field && *lexptr == '\0')
       saw_name_at_eof = 1;
         
+    if (sym == NULL 
+        && parse_language->la_language == language_cplus
+        && !lookup_minimal_symbol (tmp, NULL, NULL))
+      return UNKNOWN_CPP_NAME;
+
     return NAME;
   }
 }
diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index fc294ae..8c5d56f 100644
--- a/gdb/cp-support.c
+++ b/gdb/cp-support.c
@@ -50,7 +50,7 @@ static void demangled_name_complaint (const char *name);
 
 /* Functions/variables related to overload resolution.  */
 
-static int sym_return_val_size;
+static int sym_return_val_size = -1;
 static int sym_return_val_index;
 static struct symbol **sym_return_val;
 
@@ -712,6 +712,82 @@ make_symbol_overload_list (const char *func_name,
 
   return sym_return_val;
 }
+/* Adds the function FUNC_NAME from NAMESPACE to the overload set.  */
+
+static void
+make_symbol_overload_list_namespace (const char *func_name,
+                                     const char *namespace)
+{
+
+  if (namespace[0] == '\0')
+    {
+      make_symbol_overload_list_qualified (func_name);
+    }
+  else
+    {
+      char *concatenated_name
+	= alloca (strlen (namespace) + 2 + strlen (func_name) + 1);
+      strcpy (concatenated_name, namespace);
+      strcat (concatenated_name, "::");
+      strcat (concatenated_name, func_name);
+      make_symbol_overload_list_qualified (concatenated_name);
+    }
+}
+
+/* Search the namespace of the given type and namespace of and public base
+ types.  */
+static void make_symbol_overload_list_adl_namespace (struct type *type,
+						     const char *func_name)
+{
+  char *namespace;
+  char *type_name;
+  int i, prefix_len;
+
+  if (TYPE_CODE (type) == TYPE_CODE_PTR || TYPE_CODE (type) == TYPE_CODE_REF
+      || TYPE_CODE (type) == TYPE_CODE_ARRAY)
+    return make_symbol_overload_list_adl_namespace (TYPE_TARGET_TYPE (type),
+                                                    func_name);
+
+  type_name = TYPE_NAME (type);
+
+  prefix_len = cp_entire_prefix_len (type_name);
+
+  if (prefix_len != 0)
+    {
+      namespace = alloca (prefix_len + 1);
+      strncpy (namespace, type_name, prefix_len);
+      namespace[prefix_len] = '\0';
+
+      make_symbol_overload_list_namespace (func_name, namespace);
+    }
+
+  /* Check public base type */
+  if (TYPE_CODE(type) == TYPE_CODE_CLASS)
+    for (i = 0; i < TYPE_N_BASECLASSES (type); i++)
+      {
+	if (BASETYPE_VIA_PUBLIC (type, i))
+	  make_symbol_overload_list_adl_namespace (TYPE_BASECLASS (type, i),
+						   func_name);
+      }
+
+}
+
+/* Adds the the overload list overload candidates for FUNC_NAME found through
+   argument dependent lookup.  */
+
+struct symbol **
+make_symbol_overload_list_adl (struct type **arg_types, int nargs,
+                               const char *func_name)
+{
+  int i;
+
+  gdb_assert (sym_return_val_size != -1);
+
+  for (i = 1; i <= nargs; i++)
+    make_symbol_overload_list_adl_namespace (arg_types[i - 1], func_name);
+
+  return sym_return_val;
+}
 
 /* This applies the using directives to add namespaces to search in,
    and then searches for overloads in all of those namespaces.  It
@@ -740,20 +816,7 @@ make_symbol_overload_list_using (const char *func_name,
     }
 
   /* Now, add names for this namespace.  */
-  
-  if (namespace[0] == '\0')
-    {
-      make_symbol_overload_list_qualified (func_name);
-    }
-  else
-    {
-      char *concatenated_name
-	= alloca (strlen (namespace) + 2 + strlen (func_name) + 1);
-      strcpy (concatenated_name, namespace);
-      strcat (concatenated_name, "::");
-      strcat (concatenated_name, func_name);
-      make_symbol_overload_list_qualified (concatenated_name);
-    }
+  make_symbol_overload_list_namespace (func_name, namespace);
 }
 
 /* This does the bulk of the work of finding overloaded symbols.
diff --git a/gdb/cp-support.h b/gdb/cp-support.h
index 50f8fe9..ad1e6b2 100644
--- a/gdb/cp-support.h
+++ b/gdb/cp-support.h
@@ -88,6 +88,10 @@ extern char *cp_remove_params (const char *demangled_name);
 extern struct symbol **make_symbol_overload_list (const char *,
 						  const char *);
 
+extern struct symbol **make_symbol_overload_list_adl (struct type **arg_types,
+                                                      int nargs,
+                                                      const char *func_name);
+
 extern struct type *cp_lookup_rtti_type (const char *name,
 					 struct block *block);
 
diff --git a/gdb/eval.c b/gdb/eval.c
index d60ea8f..bce11fa 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -729,6 +729,7 @@ evaluate_subexp_standard (struct type *expect_type,
       return value_from_decfloat (exp->elts[pc + 1].type,
 				  exp->elts[pc + 2].decfloatconst);
 
+    case OP_ADL_FUNC:
     case OP_VAR_VALUE:
       (*pos) += 3;
       if (noside == EVAL_SKIP)
@@ -1428,6 +1429,17 @@ evaluate_subexp_standard (struct type *expect_type,
 	  /* Now, say which argument to start evaluating from */
 	  tem = 2;
 	}
+      else if (op == OP_ADL_FUNC)
+        {
+          /* Save the function position and move pos so that the arguments
+             can be evaluated. */
+          int func_name_len;
+          save_pos1 = *pos;
+          tem = 1;
+
+          func_name_len = longest_to_int (exp->elts[save_pos1 + 3].longconst);
+          (*pos) += 6 + BYTES_TO_EXP_ELEM (func_name_len + 1);
+        }
       else
 	{
 	  /* Non-method function call */
@@ -1459,6 +1471,33 @@ evaluate_subexp_standard (struct type *expect_type,
       /* signal end of arglist */
       argvec[tem] = 0;
 
+      if (op == OP_ADL_FUNC)
+        {
+          struct symbol *symp;
+          char *func_name;
+          int  name_len;
+          int string_pc = save_pos1 + 3;
+
+          /* Extract the function name.  */
+          name_len = longest_to_int (exp->elts[string_pc].longconst);
+          func_name = (char *) alloca (name_len + 1);
+          strcpy (func_name, &exp->elts[string_pc + 1].string);
+
+          /* Prepare list of argument types for overload resolution */
+          arg_types = (struct type **) alloca (nargs * (sizeof (struct type *)));
+          for (ix = 1; ix <= nargs; ix++)
+            arg_types[ix - 1] = value_type (argvec[ix]);
+
+          find_overload_match (arg_types, nargs, func_name,
+                               0 /* not method */ , 0 /* strict match */ ,
+                               NULL, NULL /* pass NULL symbol since symbol is unknown */ ,
+                               NULL, &symp, NULL);
+
+          /* Now fix the expression being evaluated */
+          exp->elts[save_pos1 + 2].symbol = symp;
+          argvec[0] = evaluate_subexp_with_coercion (exp, &save_pos1, noside);
+        }
+
       if (op == STRUCTOP_STRUCT || op == STRUCTOP_PTR)
 	{
 	  int static_memfuncp;
diff --git a/gdb/expprint.c b/gdb/expprint.c
index e378831..45deffe 100644
--- a/gdb/expprint.c
+++ b/gdb/expprint.c
@@ -816,6 +816,8 @@ op_name_standard (enum exp_opcode opcode)
       return "OP_TYPE";
     case OP_LABELED:
       return "OP_LABELED";
+    case OP_ADL_FUNC:
+      return "OP_ADL_FUNC";
     }
 }
 
diff --git a/gdb/expression.h b/gdb/expression.h
index 3700d5c..d01cdf2 100644
--- a/gdb/expression.h
+++ b/gdb/expression.h
@@ -352,6 +352,10 @@ enum exp_opcode
        Then comes another OP_DECFLOAT.  */
     OP_DECFLOAT,
 
+    /* OP_ADL_FUNC specifies that the argument is to be looked up in an
+       Argument Dependent manner (Koenig lookup) */
+    OP_ADL_FUNC,
+
      /* First extension operator.  Individual language modules define
 	extra operators in *.inc include files below always starting with
 	numbering at OP_EXTENDED0:
diff --git a/gdb/parse.c b/gdb/parse.c
index 27fdc6c..1c73d75 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -881,6 +881,13 @@ operator_length_standard (struct expression *expr, int endpos,
       args = 1;
       break;
 
+    case OP_ADL_FUNC:
+      oplen = longest_to_int (expr->elts[endpos - 2].longconst);
+      oplen = 4 + BYTES_TO_EXP_ELEM (oplen + 1);
+      oplen++;
+      oplen++;
+      break;
+
     case OP_LABELED:
     case STRUCTOP_STRUCT:
     case STRUCTOP_PTR:
diff --git a/gdb/testsuite/gdb.cp/namespace-koenig.cc b/gdb/testsuite/gdb.cp/namespace-koenig.cc
new file mode 100644
index 0000000..6c2c01d
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/namespace-koenig.cc
@@ -0,0 +1,188 @@
+namespace A
+{
+  class C
+  {
+  public:
+    static const int x = 11;
+  };
+
+  int
+  first (C c)
+  {
+    return 11;
+  }
+
+  int
+  first (int a, C c)
+  {
+    return 22;
+  }
+
+  int
+  second (int a, int b, C cc, int c, int d)
+  {
+    return 33;
+  }
+
+}
+
+struct B
+{
+  A::C c;
+};
+
+//------------
+
+namespace E
+{
+  class O{};
+  int foo (O o){return 1; }
+  int foo (O o, O o2){return 2; }
+  int foo (O o, O o2, int i){return 3; }
+}
+
+namespace F
+{
+  class O{};
+  int foo (       O fo, ::E::O eo){ return 4;}
+  int foo (int i, O fo, ::E::O eo){ return 5;}
+}
+
+namespace G
+{
+  class O{};
+  int foo (O go, ::F::O fo, ::E::O eo){ return 6; }
+}
+
+//------------
+
+namespace H
+{
+  class O{};
+  int foo (O){ return 7;}
+}
+
+namespace I
+{
+  class O: public H::O {};
+  class X: H::O{};
+}
+
+//------------
+
+namespace J
+{
+  union U{};
+  struct S{};
+  enum E{};
+
+  class A{
+  public:
+    class B{};
+  };
+
+  class C{};
+
+  int foo (U){ return 8;}
+  int foo (S){ return 9;}
+  int foo (E){ return 10;}
+  int foo (A::B){ return 11;}
+  int foo (A*){ return 12;}
+  int foo (A**){ return 13;}
+  int foo (C[]){ return 14;}
+
+}
+//------------
+
+namespace K{
+  class O{};
+
+  int foo(O, int){
+    return 15;
+  }
+
+  int bar(O, int){
+    return 15;
+  }
+}
+
+int foo(K::O, float){
+  return 16;
+}
+
+int bar(K::O, int){
+  return 16;
+}
+//------------
+
+namespace L {
+  namespace A{
+    namespace B{
+    class O {};
+
+    int foo (O){
+      return 17;
+    }
+
+    }
+  }
+}
+
+//------------
+int
+main ()
+{
+  A::C c;
+  B b;
+
+  A::first (c);
+  first (0, c);
+  second (0, 0, c, 0, 0);
+  A::first (b.c);
+
+  E::O eo;
+  F::O fo;
+  G::O go;
+
+  foo (eo);
+  foo (eo, eo);
+  foo (eo, eo, 1);
+  foo (fo, eo);
+  foo (1  ,fo, eo);
+  foo (go, fo, eo);
+
+  I::O io;
+  I::X ix;
+
+  foo (io);
+//foo (ix);
+
+  J::U ju;
+  J::S js;
+  J::E je;
+  J::A::B jab;
+  J::A *jap;
+  J::A **japp;
+  J::C jca[3];
+
+  foo (ju);
+  foo (js);
+  foo (je);
+  foo (jab);
+  foo (jap);
+  foo (japp);
+  foo (jca);
+
+  K::O ko;
+  foo (ko, 1);
+  foo (ko, 1.0f);
+  //bar(ko,1);
+


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [SCM]  archer-keiths-expr-cumulative: Merge branch 'archer-keiths-expr-cumulative' of ssh://sourceware.org/git/archer into archer-keiths-expr-cumulative
@ 2009-09-03 18:08 swagiaal
  0 siblings, 0 replies; 2+ messages in thread
From: swagiaal @ 2009-09-03 18:08 UTC (permalink / raw)
  To: archer-commits

The branch, archer-keiths-expr-cumulative has been updated
       via  7e8fedba51b62d359275cdf29ea218109f49c790 (commit)
       via  108568024684babfeb3876f76064ff9cfced827a (commit)
      from  0d55462d34a25d6f05b71a3ce62762e4803bebd1 (commit)

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

- Log -----------------------------------------------------------------
commit 7e8fedba51b62d359275cdf29ea218109f49c790
Merge: 108568024684babfeb3876f76064ff9cfced827a 0d55462d34a25d6f05b71a3ce62762e4803bebd1
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Thu Sep 3 14:05:59 2009 -0400

    Merge branch 'archer-keiths-expr-cumulative' of ssh://sourceware.org/git/archer into archer-keiths-expr-cumulative

commit 108568024684babfeb3876f76064ff9cfced827a
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Thu Sep 3 10:35:01 2009 -0400

    Eleminated redundant searches performed by cp_lookup_symbol_imports.

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

Summary of changes:
 gdb/cp-namespace.c                        |   46 ++++++++++++++++++----
 gdb/cp-support.h                          |    3 +-
 gdb/symtab.c                              |    2 +-
 gdb/testsuite/gdb.cp/namespace-stress.cc  |   60 +++++++++++++++++++++++++++++
 gdb/testsuite/gdb.cp/namespace-stress.exp |   50 ++++++++++++++++++++++++
 5 files changed, 151 insertions(+), 10 deletions(-)
 create mode 100644 gdb/testsuite/gdb.cp/namespace-stress.cc
 create mode 100644 gdb/testsuite/gdb.cp/namespace-stress.exp

First 500 lines of diff:
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index 5805a30..7672b2e 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -317,7 +317,7 @@ cp_lookup_symbol_namespace (const char *scope,
   /* Search for name in namespaces imported to this and parent blocks.  */
   while (block != NULL)
     {
-      sym = cp_lookup_symbol_imports(scope,name, block, domain,0);
+      sym = cp_lookup_symbol_imports(scope,name, block, domain,0,1);
 
       if (sym)
         return sym;
@@ -407,21 +407,47 @@ cp_lookup_symbol_in_namespace (const char *namespace,
 }
 
 /* Search for NAME by applying all import statements belonging
-   to BLOCK which are applicable in SCOPE.  */
+   to BLOCK which are applicable in SCOPE. If DECLARATION_ONLY the search
+   is restricted to using declarations.
+   Example:
+
+     namespace A{
+       int x;
+     }
+     using A::x;
+
+   If SEARCH_PARENTS the search will include imports which are applicable in
+   parents of scopes.
+   Example:
+
+     namespace A{
+       using namespace X;
+       namespace B{
+         using namespace Y;
+       }
+     }
+
+   If SCOPE is "A::B" and SEARCH_PARENTS is true the imports of namespaces X
+   and Y will be considered. If SEARCH_PARENTS is false only the import of Y
+   is considered.  */
 
 struct symbol *
 cp_lookup_symbol_imports (const char *scope,
                             const char *name,
                             const struct block *block,
                             const domain_enum domain,
-                            int declaration_only)
+                            int declaration_only,
+                            int search_parents)
 {
   struct using_direct *current;
   struct symbol *sym = NULL;
+  int directive_match;
+  int current_line = find_pc_line (get_frame_pc (get_current_frame ()), 0).line;
 
   if(!declaration_only)
-  /* First, try to find the symbol in the given namespace.  */
-  sym = cp_lookup_symbol_in_namespace (scope, name, block, domain);
+    /* First, try to find the symbol in the given namespace.  */
+    sym = cp_lookup_symbol_in_namespace (scope, name, block, domain);
+
   if ( sym != NULL)
     return sym;
 
@@ -433,12 +459,15 @@ cp_lookup_symbol_imports (const char *scope,
        current != NULL;
        current = current->next)
     {
-      int current_line = find_pc_line (get_frame_pc (get_current_frame ()), 0).line;
   
       /* If the import destination is the current scope or one of its ancestors then
          it is applicable.  */
-      if (strncmp (scope, current->import_dest,
-          strlen(current->import_dest)) == 0 &&
+      directive_match = search_parents ?
+                        strncmp (scope, current->import_dest,
+                                 strlen(current->import_dest)) == 0 :
+                        strcmp (scope, current->import_dest) == 0;
+
+      if (directive_match &&
           current->line_number < current_line &&
           !current->searched)
 	{
@@ -485,6 +514,7 @@ cp_lookup_symbol_imports (const char *scope,
 		                                name,
 		                                block,
 		                                domain,
+		                                0,
 		                                0);
 	    }
 
diff --git a/gdb/cp-support.h b/gdb/cp-support.h
index 022f102..3f48f98 100644
--- a/gdb/cp-support.h
+++ b/gdb/cp-support.h
@@ -131,7 +131,8 @@ struct symbol *cp_lookup_symbol_imports (const char *scope,
                                          const char *name,
                                          const struct block *block,
                                          const domain_enum domain,
-                                         int declaration_only);
+                                         int declaration_only,
+                                         int search_parents);
 
 extern struct symbol *cp_lookup_symbol_namespace (const char *namespace,
                                                   const char *name,
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 46cc6de..2a5c990 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -1356,7 +1356,7 @@ lookup_symbol_aux_local (const char *name, const struct block *block,
       if (language == language_cplus )
         {
           sym = cp_lookup_symbol_imports (block_scope (block_iterator), name,
-                                          block_iterator, domain, 1);
+                                          block_iterator, domain, 1, 1);
 
           if (sym != NULL)
             return sym;
diff --git a/gdb/testsuite/gdb.cp/namespace-stress.cc b/gdb/testsuite/gdb.cp/namespace-stress.cc
new file mode 100644
index 0000000..f34083e
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/namespace-stress.cc
@@ -0,0 +1,60 @@
+
+namespace A{ int x; }
+namespace B{ int x; }
+namespace C{ int x; }
+namespace D{ int x; }
+namespace E{ int x; }
+namespace F{ int x; }
+namespace G{ int x; }
+namespace H{ int x; }
+namespace I{ int x; }
+namespace J{ int x; }
+namespace K{ int x; }
+namespace L{ int x; }
+namespace M{ int x; }
+namespace N{ int x; }
+namespace O{ int x; }
+namespace P{ int x; }
+namespace Q{ int x; }
+namespace R{ int x; }
+namespace S{ int x; }
+namespace T{ int x; }
+namespace U{ int x; }
+namespace V{ int x; }
+namespace W{ int x; }
+namespace X{ int x; }
+namespace Y{ int x; }
+namespace Z{ int x; }
+
+
+int main(){
+
+  using namespace A;
+  using namespace B;
+  using namespace C;
+  using namespace D;
+  using namespace E;
+  using namespace F;
+  using namespace G;
+  using namespace H;
+  using namespace I;
+  using namespace J;
+  using namespace K;
+  using namespace L;
+  using namespace M;
+  using namespace N;
+  using namespace O;
+  using namespace P;
+  using namespace Q;
+  using namespace R;
+  using namespace S;
+  using namespace T;
+  using namespace U;
+  using namespace V;
+  using namespace W;
+  using namespace X;
+  using namespace Y;
+  using namespace Z;
+
+  return 0;
+}
\ No newline at end of file
diff --git a/gdb/testsuite/gdb.cp/namespace-stress.exp b/gdb/testsuite/gdb.cp/namespace-stress.exp
new file mode 100644
index 0000000..1806523
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/namespace-stress.exp
@@ -0,0 +1,50 @@
+# Copyright 2008 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+if $tracelevel then {
+    strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile namespace-stress
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+    untested "Couldn't compile test program"
+    return -1
+}
+
+if [get_compiler_info ${binfile}] {
+    return -1;
+}
+
+# Get things started.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto_main] then {
+    perror "couldn't run to breakpoint main"
+    continue
+}
+
+############################################
+# Test that the search can fail efficiently 
+
+gdb_test "print y" "No symbol \"y\" in current context."


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-03 19:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-03 19:36 [SCM] archer-keiths-expr-cumulative: Merge branch 'archer-keiths-expr-cumulative' of ssh://sourceware.org/git/archer into archer-keiths-expr-cumulative swagiaal
  -- strict thread matches above, loose matches on Subject: below --
2009-09-03 18:08 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).