public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-keiths-expr-cumulative: Merge branch 'remote-archer-keiths-linkage_name-redux' into my-archer-keiths-expr-cumulative
@ 2009-07-21 21:33 kseitz
  0 siblings, 0 replies; only message in thread
From: kseitz @ 2009-07-21 21:33 UTC (permalink / raw)
  To: archer-commits

The branch, archer-keiths-expr-cumulative has been updated
       via  d77e7ab0aa8b761a3a0f2b78443f50d0c6dab4c7 (commit)
       via  abafd74c3ade447b2a6582a60b275a9be1b53197 (commit)
       via  418e9608746bd711949793e6c76b04fe05dd5fdc (commit)
       via  7d695018144b2a87f3adc1fc6588c8892d56f715 (commit)
       via  73710d389342e85ee08029c1f5ecab6f58525d96 (commit)
       via  166e930c48e4cf3d003c6f4c99efa2bec07f61fc (commit)
       via  3a3ee2d5c2509a005e24af5a1975b29c4d9608a4 (commit)
       via  c2a2baa9475fe066d9f7cb6afb5cc1f31f74e541 (commit)
       via  01e983e75fda6f4156350bb49d1c6ee8dbc42d6c (commit)
      from  8248c98f4815b2b9b059d9bd014dd276497508cd (commit)

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

- Log -----------------------------------------------------------------
commit d77e7ab0aa8b761a3a0f2b78443f50d0c6dab4c7
Merge: abafd74c3ade447b2a6582a60b275a9be1b53197 418e9608746bd711949793e6c76b04fe05dd5fdc
Author: keiths <keiths@redhat.com>
Date:   Tue Jul 21 13:42:27 2009 -0700

    Merge branch 'remote-archer-keiths-linkage_name-redux' into my-archer-keiths-expr-cumulative

commit abafd74c3ade447b2a6582a60b275a9be1b53197
Merge: 01e983e75fda6f4156350bb49d1c6ee8dbc42d6c 8248c98f4815b2b9b059d9bd014dd276497508cd
Author: keiths <keiths@redhat.com>
Date:   Tue Jul 21 11:11:16 2009 -0700

    Merge branch 'remote-archer-keiths-expr-cumulative' into my-archer-keiths-expr-cumulative

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

Summary of changes:
 gdb/ada-lang.c                       |    6 +-
 gdb/c-exp.y                          |  165 ++++++++++++-
 gdb/c-typeprint.c                    |   14 +-
 gdb/cp-namespace.c                   |   45 ++---
 gdb/cp-support.c                     |   10 +-
 gdb/cp-support.h                     |    4 -
 gdb/dwarf2read.c                     |  456 +++++++++++++++++-----------------
 gdb/gnu-v3-abi.c                     |    8 +
 gdb/language.h                       |    1 -
 gdb/linespec.c                       |   28 ++-
 gdb/scm-valprint.c                   |    4 +-
 gdb/solib-svr4.c                     |    4 +-
 gdb/solib.c                          |    3 +-
 gdb/solist.h                         |    2 -
 gdb/symmisc.c                        |    4 +-
 gdb/symtab.c                         |  143 ++++-------
 gdb/symtab.h                         |    7 -
 gdb/testsuite/gdb.cp/cp-relocate.exp |    6 +-
 gdb/testsuite/gdb.cp/member-ptr.exp  |    4 +-
 gdb/typeprint.h                      |    3 +-
 gdb/utils.c                          |    7 +-
 gdb/valops.c                         |    4 +-
 22 files changed, 522 insertions(+), 406 deletions(-)

First 500 lines of diff:
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 4a45a62..6539204 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -4748,14 +4748,10 @@ ada_lookup_symbol (const char *name, const struct block *block0,
 
 static struct symbol *
 ada_lookup_symbol_nonlocal (const char *name,
-                            const char *linkage_name,
                             const struct block *block,
                             const domain_enum domain)
 {
-  if (linkage_name == NULL)
-    linkage_name = name;
-  return ada_lookup_symbol (linkage_name, block_static_block (block), domain,
-                            NULL);
+  return ada_lookup_symbol (name, block_static_block (block), domain, NULL);
 }
 
 
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index f873944..27aa0d7 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -159,6 +159,7 @@ static struct cleanup *typelist_cleanup;
 %{
 /* YYSTYPE gets defined by %union */
 static int parse_number (char *, int, int, YYSTYPE *);
+static struct stoken operator_stoken (const char *);
 %}
 
 %type <voidval> exp exp1 type_exp start variable qualified_name lcurly
@@ -201,9 +202,12 @@ static int parse_number (char *, int, int, YYSTYPE *);
 
 %token <ssym> NAME_OR_INT 
 
+%token OPERATOR
 %token STRUCT CLASS UNION ENUM SIZEOF UNSIGNED COLONCOLON
 %token TEMPLATE
 %token ERROR
+%token NEW DELETE
+%type <sval> operator
 
 /* Special type cases, put in to allow the parser to distinguish different
    legal basetypes.  */
@@ -234,7 +238,7 @@ static int parse_number (char *, int, int, YYSTYPE *);
 %left '+' '-'
 %left '*' '/' '%'
 %right UNARY INCREMENT DECREMENT
-%right ARROW '.' '[' '('
+%right ARROW ARROW_STAR '.' DOT_STAR '[' '('
 %token <ssym> BLOCKNAME 
 %token <bval> FILENAME
 %type <bval> block
@@ -335,7 +339,7 @@ exp	:	exp ARROW qualified_name
 			  write_exp_elt_opcode (STRUCTOP_MPTR); }
 	;
 
-exp	:	exp ARROW '*' exp
+exp	:	exp ARROW_STAR exp
 			{ write_exp_elt_opcode (STRUCTOP_MPTR); }
 	;
 
@@ -370,7 +374,7 @@ exp	:	exp '.' qualified_name
 			  write_exp_elt_opcode (STRUCTOP_MEMBER); }
 	;
 
-exp	:	exp '.' '*' exp
+exp	:	exp DOT_STAR exp
 			{ write_exp_elt_opcode (STRUCTOP_MEMBER); }
 	;
 
@@ -735,6 +739,7 @@ variable:	block COLONCOLON name
 qualified_name:	typebase COLONCOLON name
 			{
 			  struct type *type = $1;
+			  CHECK_TYPEDEF (type);
 			  if (TYPE_CODE (type) != TYPE_CODE_STRUCT
 			      && TYPE_CODE (type) != TYPE_CODE_UNION
 			      && TYPE_CODE (type) != TYPE_CODE_NAMESPACE)
@@ -750,6 +755,7 @@ qualified_name:	typebase COLONCOLON name
 			{
 			  struct type *type = $1;
 			  struct stoken tmp_token;
+			  CHECK_TYPEDEF (type);
 			  if (TYPE_CODE (type) != TYPE_CODE_STRUCT
 			      && TYPE_CODE (type) != TYPE_CODE_UNION
 			      && TYPE_CODE (type) != TYPE_CODE_NAMESPACE)
@@ -1149,10 +1155,135 @@ const_or_volatile_noopt:  	const_and_volatile
 			{ push_type (tp_volatile); }
 	;
 
+operator:	OPERATOR NEW
+			{ $$ = operator_stoken (" new"); }
+	|	OPERATOR DELETE
+			{ $$ = operator_stoken (" delete"); }
+	|	OPERATOR NEW '[' ']'
+			{ $$ = operator_stoken (" new[]"); }
+	|	OPERATOR DELETE '[' ']'
+			{ $$ = operator_stoken (" delete[]"); }
+	|	OPERATOR '+'
+			{ $$ = operator_stoken ("+"); }
+	|	OPERATOR '-'
+			{ $$ = operator_stoken ("-"); }
+	|	OPERATOR '*'
+			{ $$ = operator_stoken ("*"); }
+	|	OPERATOR '/'
+			{ $$ = operator_stoken ("/"); }
+	|	OPERATOR '%'
+			{ $$ = operator_stoken ("%"); }
+	|	OPERATOR '^'
+			{ $$ = operator_stoken ("^"); }
+	|	OPERATOR '&'
+			{ $$ = operator_stoken ("&"); }
+	|	OPERATOR '|'
+			{ $$ = operator_stoken ("|"); }
+	|	OPERATOR '~'
+			{ $$ = operator_stoken ("~"); }
+	|	OPERATOR '!'
+			{ $$ = operator_stoken ("!"); }
+	|	OPERATOR '='
+			{ $$ = operator_stoken ("="); }
+	|	OPERATOR '<'
+			{ $$ = operator_stoken ("<"); }
+	|	OPERATOR '>'
+			{ $$ = operator_stoken (">"); }
+	|	OPERATOR ASSIGN_MODIFY
+			{ const char *op = "unknown";
+			  switch ($2)
+			    {
+			    case BINOP_RSH:
+			      op = ">>=";
+			      break;
+			    case BINOP_LSH:
+			      op = "<<=";
+			      break;
+			    case BINOP_ADD:
+			      op = "+=";
+			      break;
+			    case BINOP_SUB:
+			      op = "-=";
+			      break;
+			    case BINOP_MUL:
+			      op = "*=";
+			      break;
+			    case BINOP_DIV:
+			      op = "/=";
+			      break;
+			    case BINOP_REM:
+			      op = "%=";
+			      break;
+			    case BINOP_BITWISE_IOR:
+			      op = "|=";
+			      break;
+			    case BINOP_BITWISE_AND:
+			      op = "&=";
+			      break;
+			    case BINOP_BITWISE_XOR:
+			      op = "^=";
+			      break;
+			    default:
+			      break;
+			    }
+
+			  $$ = operator_stoken (op);
+			}
+	|	OPERATOR LSH
+			{ $$ = operator_stoken ("<<"); }
+	|	OPERATOR RSH
+			{ $$ = operator_stoken (">>"); }
+	|	OPERATOR EQUAL
+			{ $$ = operator_stoken ("=="); }
+	|	OPERATOR NOTEQUAL
+			{ $$ = operator_stoken ("!="); }
+	|	OPERATOR LEQ
+			{ $$ = operator_stoken ("<="); }
+	|	OPERATOR GEQ
+			{ $$ = operator_stoken (">="); }
+	|	OPERATOR ANDAND
+			{ $$ = operator_stoken ("&&"); }
+	|	OPERATOR OROR
+			{ $$ = operator_stoken ("||"); }
+	|	OPERATOR INCREMENT
+			{ $$ = operator_stoken ("++"); }
+	|	OPERATOR DECREMENT
+			{ $$ = operator_stoken ("--"); }
+	|	OPERATOR ','
+			{ $$ = operator_stoken (","); }
+	|	OPERATOR ARROW_STAR
+			{ $$ = operator_stoken ("->*"); }
+	|	OPERATOR ARROW
+			{ $$ = operator_stoken ("->"); }
+	|	OPERATOR '(' ')'
+			{ $$ = operator_stoken ("()"); }
+	|	OPERATOR '[' ']'
+			{ $$ = operator_stoken ("[]"); }
+	|	OPERATOR ptype
+			{ char *name, *canon;
+			  long length;
+			  struct ui_file *buf = mem_fileopen ();
+
+			  c_print_type ($2, NULL, buf, -1, 0);
+			  name = ui_file_xstrdup (buf, &length);
+			  canon = cp_canonicalize_string (name);
+			  if (canon != NULL)
+			    {
+			      xfree (name);
+			      name = canon;
+			    }
+			  ui_file_delete (buf);
+			  $$ = operator_stoken (name);
+			}
+	;
+
+
+
 name	:	NAME { $$ = $1.stoken; }
 	|	BLOCKNAME { $$ = $1.stoken; }
 	|	TYPENAME { $$ = $1.stoken; }
 	|	NAME_OR_INT  { $$ = $1.stoken; }
+	|	operator { $$ = $1; }
 	;
 
 name_not_typename :	NAME
@@ -1168,6 +1299,20 @@ name_not_typename :	NAME
 
 %%
 
+/* Returns a stoken of the operator name given by OP (which does not
+   include the string "operator").  The result is xmalloc'd.  */
+static struct stoken
+operator_stoken (const char *op)
+{
+  static const char *operator_string = "operator";
+  struct stoken st = { NULL, 0 };
+  st.length = strlen (operator_string) + strlen (op);
+  st.ptr = xmalloc (st.length + 1);
+  strcpy (st.ptr, operator_string);
+  strcat (st.ptr, op);
+  return st;
+};
+
 /* Take care of parsing a number (anything that starts with a digit).
    Set yylval and return the token type; update lexptr.
    LEN is the number of characters in it.  */
@@ -1692,7 +1837,8 @@ struct token
 static const struct token tokentab3[] =
   {
     {">>=", ASSIGN_MODIFY, BINOP_RSH, 0},
-    {"<<=", ASSIGN_MODIFY, BINOP_LSH, 0}
+    {"<<=", ASSIGN_MODIFY, BINOP_LSH, 0},
+    {"->*", ARROW_STAR, BINOP_END, 1}
   };
 
 static const struct token tokentab2[] =
@@ -1716,7 +1862,8 @@ static const struct token tokentab2[] =
     {"==", EQUAL, BINOP_END, 0},
     {"!=", NOTEQUAL, BINOP_END, 0},
     {"<=", LEQ, BINOP_END, 0},
-    {">=", GEQ, BINOP_END, 0}
+    {">=", GEQ, BINOP_END, 0},
+    {".*", DOT_STAR, BINOP_END, 0}
   };
 
 /* Identifier-like tokens.  */
@@ -1738,6 +1885,9 @@ static const struct token ident_tokens[] =
     {"long", LONG, OP_NULL, 0},
     {"true", TRUEKEYWORD, OP_NULL, 1},
     {"int", INT_KEYWORD, OP_NULL, 0},
+    {"new", NEW, OP_NULL, 1},
+    {"delete", DELETE, OP_NULL, 1},
+    {"operator", OPERATOR, OP_NULL, 1},
 
     {"and", ANDAND, BINOP_END, 1},
     {"and_eq", ASSIGN_MODIFY, BINOP_BITWISE_AND, 1},
@@ -2137,11 +2287,6 @@ yylex ()
       return 0;
     }
 
-  /* Check for C++ operator */
-  if (parse_language->la_language == language_cplus
-      && strncmp (tokstart,"operator", 8) == 0)
-    namelen = cp_validate_operator (tokstart);
-
   lexptr += namelen;
 
   tryname:
diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index 9e419fc..9248656 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -32,6 +32,7 @@
 #include "c-lang.h"
 #include "typeprint.h"
 #include "cp-abi.h"
+#include "jv-lang.h"
 
 #include "gdb_string.h"
 #include <errno.h>
@@ -370,11 +371,13 @@ c_type_print_modifier (struct type *type, struct ui_file *stream,
 /* Print out the arguments of TYPE, which should have TYPE_CODE_METHOD
    or TYPE_CODE_FUNC, to STREAM.  Artificial arguments, such as "this"
    in non-static methods, are displayed if SHOW_ARTIFICIAL is
-   non-zero.  */
+   non-zero. LANGUAGE is the language in which TYPE was defined.  This is
+   a necessary evil since this code is used by the C, C++, and Java
+   backends. */
 
 void
 c_type_print_args (struct type *type, struct ui_file *stream,
-		   int show_artificial)
+		   int show_artificial, enum language language)
 {
   int i, len;
   struct field *args;
@@ -395,7 +398,10 @@ c_type_print_args (struct type *type, struct ui_file *stream,
 	  wrap_here ("    ");
 	}
 
-      c_print_type (TYPE_FIELD_TYPE (type, i), "", stream, -1, 0);
+      if (language == language_java)
+	java_print_type (TYPE_FIELD_TYPE (type, i), "", stream, -1, 0);
+      else
+	c_print_type (TYPE_FIELD_TYPE (type, i), "", stream, -1, 0);
       printed_any = 1;
     }
 
@@ -612,7 +618,7 @@ c_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
       if (passed_a_ptr)
 	fprintf_filtered (stream, ")");
       if (!demangled_args)
-	c_type_print_args (type, stream, 1);
+	c_type_print_args (type, stream, 1, language_c);
       c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, show,
 				   passed_a_ptr, 0);
       break;
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index b914d59..2719033 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -38,7 +38,6 @@ static struct using_direct *cp_copy_usings (struct using_direct *using,
 					    struct obstack *obstack);
 
 static struct symbol *lookup_symbol_file (const char *name,
-					  const char *linkage_name,
 					  const struct block *block,
 					  const domain_enum domain,
 					  int anonymous_namespace);
@@ -266,7 +265,6 @@ cp_copy_usings (struct using_direct *using,
 
 struct symbol *
 cp_lookup_symbol_nonlocal (const char *name,
-			   const char *linkage_name,
 			   const struct block *block,
 			   const domain_enum domain)
 {
@@ -278,8 +276,7 @@ cp_lookup_symbol_nonlocal (const char *name,
   while (block != global_block)
     while (block != global_block)
       {
-      sym = lookup_namespace_scope(name, linkage_name, block,
-            domain, scope, 0, 0);
+      sym = lookup_namespace_scope(name, block, domain, scope, 0, 0);
 
       if (sym != NULL)
         return sym;
@@ -291,7 +288,7 @@ cp_lookup_symbol_nonlocal (const char *name,
   if (sym != NULL)
     return sym;
 
-  return lookup_symbol_file(name, linkage_name, block, domain, 0);
+  return lookup_symbol_file(name, block, domain, 0);
 }
 
 /* Lookup NAME at namespace scope (or, in C terms, in static and
@@ -311,7 +308,6 @@ cp_lookup_symbol_nonlocal (const char *name,
 
 struct symbol *
 lookup_namespace_scope (const char *name,
-			const char *linkage_name,
 			const struct block *block,
 			const domain_enum domain,
 			const char *scope,
@@ -334,8 +330,8 @@ lookup_namespace_scope (const char *name,
 	  new_scope_len += 2;
 	}
       new_scope_len += cp_find_first_component (scope + new_scope_len);
-      sym = lookup_namespace_scope (name, linkage_name, block,
-				    domain, scope, new_scope_len, declaration_only);
+      sym = lookup_namespace_scope (name, block, domain, scope, new_scope_len,
+				    declaration_only);
       if (sym != NULL)
 	return sym;
     }
@@ -346,8 +342,8 @@ lookup_namespace_scope (const char *name,
   namespace = alloca (scope_len + 1);
   strncpy (namespace, scope, scope_len);
   namespace[scope_len] = '\0';
-  return cp_lookup_symbol_namespace (namespace, name, linkage_name,
-				     block, domain, declaration_only);
+  return cp_lookup_symbol_namespace (namespace, name, block, domain,
+				     declaration_only);
 }
 
 /* Searches the for the given NAME in the given NAMESPACE, using import 
@@ -355,7 +351,6 @@ lookup_namespace_scope (const char *name,
 struct symbol *
 cp_lookup_symbol_namespace_incremental (const char *namespace,
                                         const char *name,
-                                        const char *linkage_name,
                                         const struct block *block,
                                         const domain_enum domain,
                                         int declaration_only)
@@ -370,7 +365,8 @@ cp_lookup_symbol_namespace_incremental (const char *namespace,
 
   while (block != global_block)
     {
-      sym = cp_lookup_symbol_namespace (namespace, name, linkage_name, block, domain, declaration_only);
+      sym = cp_lookup_symbol_namespace (namespace, name, block, domain,
+					declaration_only);
 
       if (sym != NULL)
         return sym;
@@ -391,7 +387,6 @@ cp_lookup_symbol_namespace_incremental (const char *namespace,
 struct symbol *
 cp_lookup_symbol_namespace (const char *namespace,
 			    const char *name,
-			    const char *linkage_name,
 			    const struct block *block,
 			    const domain_enum domain,
 			    int declaration_only)
@@ -423,7 +418,6 @@ cp_lookup_symbol_namespace (const char *namespace,
 	      {
 	        sym = cp_lookup_symbol_namespace (current->inner,
 	                                          name,
-	                                          linkage_name,
 	                                          block,
 	                                          domain,
 	                                          declaration_only);
@@ -447,7 +441,6 @@ cp_lookup_symbol_namespace (const char *namespace,
 	    {
 	    sym = cp_lookup_symbol_namespace (namespace,
 	                                      current->inner,
-	                                      linkage_name,
 	                                      block,
 	                                      domain,
                                               declaration_only);
@@ -456,7 +449,6 @@ cp_lookup_symbol_namespace (const char *namespace,
 	       NAMESPACE to direct the search towards the imported namespace. */
 	      sym = cp_lookup_symbol_namespace (current->inner,
 		                                name,
-		                                linkage_name,
 		                                block,
 		                                domain,
                                                 declaration_only);
@@ -474,9 +466,8 @@ cp_lookup_symbol_namespace (const char *namespace,
   
   if (namespace[0] == '\0' && !declaration_only)
     {
-      sym = lookup_symbol_file (name, linkage_name,
-                                     block, domain, 
-                                     cp_is_anonymous (namespace));
+      sym = lookup_symbol_file (name, block, domain,
+				cp_is_anonymous (namespace));
       return sym;
     }
   else
@@ -486,8 +477,7 @@ cp_lookup_symbol_namespace (const char *namespace,
       strcpy (concatenated_name, namespace);
       strcat (concatenated_name, "::");
       strcat (concatenated_name, name);
-      sym = lookup_symbol_file (concatenated_name, linkage_name,
-				block, domain, 
+      sym = lookup_symbol_file (concatenated_name, block, domain, 
 				cp_is_anonymous (namespace));
       return sym;
     }
@@ -500,14 +490,13 @@ cp_lookup_symbol_namespace (const char *namespace,
 
 static struct symbol *
 lookup_symbol_file (const char *name,
-		    const char *linkage_name,
 		    const struct block *block,
 		    const domain_enum domain,
 		    int anonymous_namespace)
 {
   struct symbol *sym = NULL;
 
-  sym = lookup_symbol_static (name, linkage_name, block, domain);
+  sym = lookup_symbol_static (name, block, domain);
   if (sym != NULL)
     return sym;
 
@@ -520,12 +509,11 @@ lookup_symbol_file (const char *name,
       const struct block *global_block = block_global_block (block);
       
       if (global_block != NULL)
-	sym = lookup_symbol_aux_block (name, linkage_name, global_block,
-				       domain);
+	sym = lookup_symbol_aux_block (name, global_block, domain);


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


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

only message in thread, other threads:[~2009-07-21 21:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-21 21:33 [SCM] archer-keiths-expr-cumulative: Merge branch 'remote-archer-keiths-linkage_name-redux' into my-archer-keiths-expr-cumulative kseitz

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