Don't rely on inferior_ptid in record_full_wait
[deliverable/binutils-gdb.git] / gdb / c-exp.y
index 47e82b698b418e467f114b03dc1400c0a3e297a7..3403a857a8396190b039dd2ae595e258f3c96990 100644 (file)
@@ -1,5 +1,5 @@
 /* YACC parser for C expressions, for GDB.
-   Copyright (C) 1986-2019 Free Software Foundation, Inc.
+   Copyright (C) 1986-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -824,7 +824,6 @@ exp :       SIZEOF '(' type ')'     %prec UNARY
                          write_exp_elt_opcode (pstate, OP_LONG);
                          write_exp_elt_type (pstate, lookup_signed_typename
                                              (pstate->language (),
-                                              pstate->gdbarch (),
                                               "int"));
                          type = check_typedef (type);
 
@@ -1301,117 +1300,89 @@ typebase
                        { $$ = $1.type; }
        |       INT_KEYWORD
                        { $$ = lookup_signed_typename (pstate->language (),
-                                                      pstate->gdbarch (),
                                                       "int"); }
        |       LONG
                        { $$ = lookup_signed_typename (pstate->language (),
-                                                      pstate->gdbarch (),
                                                       "long"); }
        |       SHORT
                        { $$ = lookup_signed_typename (pstate->language (),
-                                                      pstate->gdbarch (),
                                                       "short"); }
        |       LONG INT_KEYWORD
                        { $$ = lookup_signed_typename (pstate->language (),
-                                                      pstate->gdbarch (),
                                                       "long"); }
        |       LONG SIGNED_KEYWORD INT_KEYWORD
                        { $$ = lookup_signed_typename (pstate->language (),
-                                                      pstate->gdbarch (),
                                                       "long"); }
        |       LONG SIGNED_KEYWORD
                        { $$ = lookup_signed_typename (pstate->language (),
-                                                      pstate->gdbarch (),
                                                       "long"); }
        |       SIGNED_KEYWORD LONG INT_KEYWORD
                        { $$ = lookup_signed_typename (pstate->language (),
-                                                      pstate->gdbarch (),
                                                       "long"); }
        |       UNSIGNED LONG INT_KEYWORD
                        { $$ = lookup_unsigned_typename (pstate->language (),
-                                                        pstate->gdbarch (),
                                                         "long"); }
        |       LONG UNSIGNED INT_KEYWORD
                        { $$ = lookup_unsigned_typename (pstate->language (),
-                                                        pstate->gdbarch (),
                                                         "long"); }
        |       LONG UNSIGNED
                        { $$ = lookup_unsigned_typename (pstate->language (),
-                                                        pstate->gdbarch (),
                                                         "long"); }
        |       LONG LONG
                        { $$ = lookup_signed_typename (pstate->language (),
-                                                      pstate->gdbarch (),
                                                       "long long"); }
        |       LONG LONG INT_KEYWORD
                        { $$ = lookup_signed_typename (pstate->language (),
-                                                      pstate->gdbarch (),
                                                       "long long"); }
        |       LONG LONG SIGNED_KEYWORD INT_KEYWORD
                        { $$ = lookup_signed_typename (pstate->language (),
-                                                      pstate->gdbarch (),
                                                       "long long"); }
        |       LONG LONG SIGNED_KEYWORD
                        { $$ = lookup_signed_typename (pstate->language (),
-                                                      pstate->gdbarch (),
                                                       "long long"); }
        |       SIGNED_KEYWORD LONG LONG
                        { $$ = lookup_signed_typename (pstate->language (),
-                                                      pstate->gdbarch (),
                                                       "long long"); }
        |       SIGNED_KEYWORD LONG LONG INT_KEYWORD
                        { $$ = lookup_signed_typename (pstate->language (),
-                                                      pstate->gdbarch (),
                                                       "long long"); }
        |       UNSIGNED LONG LONG
                        { $$ = lookup_unsigned_typename (pstate->language (),
-                                                        pstate->gdbarch (),
                                                         "long long"); }
        |       UNSIGNED LONG LONG INT_KEYWORD
                        { $$ = lookup_unsigned_typename (pstate->language (),
-                                                        pstate->gdbarch (),
                                                         "long long"); }
        |       LONG LONG UNSIGNED
                        { $$ = lookup_unsigned_typename (pstate->language (),
-                                                        pstate->gdbarch (),
                                                         "long long"); }
        |       LONG LONG UNSIGNED INT_KEYWORD
                        { $$ = lookup_unsigned_typename (pstate->language (),
-                                                        pstate->gdbarch (),
                                                         "long long"); }
        |       SHORT INT_KEYWORD
                        { $$ = lookup_signed_typename (pstate->language (),
-                                                      pstate->gdbarch (),
                                                       "short"); }
        |       SHORT SIGNED_KEYWORD INT_KEYWORD
                        { $$ = lookup_signed_typename (pstate->language (),
-                                                      pstate->gdbarch (),
                                                       "short"); }
        |       SHORT SIGNED_KEYWORD
                        { $$ = lookup_signed_typename (pstate->language (),
-                                                      pstate->gdbarch (),
                                                       "short"); }
        |       UNSIGNED SHORT INT_KEYWORD
                        { $$ = lookup_unsigned_typename (pstate->language (),
-                                                        pstate->gdbarch (),
                                                         "short"); }
        |       SHORT UNSIGNED
                        { $$ = lookup_unsigned_typename (pstate->language (),
-                                                        pstate->gdbarch (),
                                                         "short"); }
        |       SHORT UNSIGNED INT_KEYWORD
                        { $$ = lookup_unsigned_typename (pstate->language (),
-                                                        pstate->gdbarch (),
                                                         "short"); }
        |       DOUBLE_KEYWORD
                        { $$ = lookup_typename (pstate->language (),
-                                               pstate->gdbarch (),
                                                "double",
                                                NULL,
                                                0); }
        |       LONG DOUBLE_KEYWORD
                        { $$ = lookup_typename (pstate->language (),
-                                               pstate->gdbarch (),
                                                "long double",
                                                NULL,
                                                0); }
@@ -1483,19 +1454,15 @@ typebase
                        }
        |       UNSIGNED type_name
                        { $$ = lookup_unsigned_typename (pstate->language (),
-                                                        pstate->gdbarch (),
                                                         TYPE_NAME($2.type)); }
        |       UNSIGNED
                        { $$ = lookup_unsigned_typename (pstate->language (),
-                                                        pstate->gdbarch (),
                                                         "int"); }
        |       SIGNED_KEYWORD type_name
                        { $$ = lookup_signed_typename (pstate->language (),
-                                                      pstate->gdbarch (),
                                                       TYPE_NAME($2.type)); }
        |       SIGNED_KEYWORD
                        { $$ = lookup_signed_typename (pstate->language (),
-                                                      pstate->gdbarch (),
                                                       "int"); }
                 /* It appears that this rule for templates is never
                    reduced; template recognition happens by lookahead
@@ -1517,7 +1484,6 @@ type_name:        TYPENAME
                  $$.stoken.ptr = "int";
                  $$.stoken.length = 3;
                  $$.type = lookup_signed_typename (pstate->language (),
-                                                   pstate->gdbarch (),
                                                    "int");
                }
        |       LONG
@@ -1525,7 +1491,6 @@ type_name:        TYPENAME
                  $$.stoken.ptr = "long";
                  $$.stoken.length = 4;
                  $$.type = lookup_signed_typename (pstate->language (),
-                                                   pstate->gdbarch (),
                                                    "long");
                }
        |       SHORT
@@ -1533,7 +1498,6 @@ type_name:        TYPENAME
                  $$.stoken.ptr = "short";
                  $$.stoken.length = 5;
                  $$.type = lookup_signed_typename (pstate->language (),
-                                                   pstate->gdbarch (),
                                                    "short");
                }
        ;
@@ -2490,15 +2454,14 @@ static const struct token ident_tokens[] =
 static void
 scan_macro_expansion (char *expansion)
 {
-  char *copy;
+  const char *copy;
 
   /* We'd better not be trying to push the stack twice.  */
   gdb_assert (! cpstate->macro_original_text);
 
   /* Copy to the obstack, and then free the intermediate
      expansion.  */
-  copy = (char *) obstack_copy0 (&cpstate->expansion_obstack, expansion,
-                                strlen (expansion));
+  copy = obstack_strdup (&cpstate->expansion_obstack, expansion);
   xfree (expansion);
 
   /* Save the old lexptr value, so we can return to it when we're done
@@ -3292,9 +3255,9 @@ yylex (void)
   if (checkpoint > 0)
     {
       current.value.sval.ptr
-       = (const char *) obstack_copy0 (&cpstate->expansion_obstack,
-                                       current.value.sval.ptr,
-                                       current.value.sval.length);
+       = obstack_strndup (&cpstate->expansion_obstack,
+                          current.value.sval.ptr,
+                          current.value.sval.length);
 
       token_fifo[0] = current;
       if (checkpoint > 1)
@@ -3394,7 +3357,7 @@ c_print_token (FILE *file, int type, YYSTYPE value)
       parser_fprintf (file, "ssym<name=%s, sym=%s, field_of_this=%d>",
                       copy_name (value.ssym.stoken).c_str (),
                       (value.ssym.sym.symbol == NULL
-                       ? "(null)" : SYMBOL_PRINT_NAME (value.ssym.sym.symbol)),
+                       ? "(null)" : value.ssym.sym.symbol->print_name ()),
                       value.ssym.is_a_field_of_this);
       break;
 
This page took 0.02664 seconds and 4 git commands to generate.