gdb: remove BLOCK_NAMESPACE macro
[binutils-gdb.git] / gdb / p-exp.y
index c7fa0dc882dcfef9c0e3764edf449d2cbd7421eb..ffa82f6e42c34f1b0006d259f31150e5856c4f21 100644 (file)
@@ -612,15 +612,16 @@ exp       :       THIS
 block  :       BLOCKNAME
                        {
                          if ($1.sym.symbol != 0)
-                             $$ = SYMBOL_BLOCK_VALUE ($1.sym.symbol);
+                             $$ = $1.sym.symbol->value_block ();
                          else
                            {
                              std::string copy = copy_name ($1.stoken);
                              struct symtab *tem =
                                  lookup_symtab (copy.c_str ());
                              if (tem)
-                               $$ = BLOCKVECTOR_BLOCK (tem->blockvector (),
-                                                       STATIC_BLOCK);
+                               $$ = BLOCKVECTOR_BLOCK
+                                 (tem->compunit ()->blockvector (),
+                                  STATIC_BLOCK);
                              else
                                error (_("No file or function \"%s\"."),
                                       copy.c_str ());
@@ -638,7 +639,7 @@ block       :       block COLONCOLON name
                          if (!tem || tem->aclass () != LOC_BLOCK)
                            error (_("No function \"%s\" in specified context."),
                                   copy.c_str ());
-                         $$ = SYMBOL_BLOCK_VALUE (tem); }
+                         $$ = tem->value_block (); }
        ;
 
 variable:      block COLONCOLON name
@@ -690,7 +691,7 @@ variable:   name_not_typename
                                pstate->block_tracker->update (sym);
 
                              pstate->push_new<var_value_operation> (sym);
-                             current_type = sym.symbol->type; }
+                             current_type = sym.symbol->type (); }
                          else if ($1.is_a_field_of_this)
                            {
                              struct value * this_val;
@@ -802,10 +803,8 @@ static int
 parse_number (struct parser_state *par_state,
              const char *p, int len, int parsed_float, YYSTYPE *putithere)
 {
-  /* FIXME: Shouldn't these be unsigned?  We don't deal with negative values
-     here, and we do kind of silly things like cast to unsigned.  */
-  LONGEST n = 0;
-  LONGEST prevn = 0;
+  ULONGEST n = 0;
+  ULONGEST prevn = 0;
   ULONGEST un;
 
   int i = 0;
@@ -854,7 +853,7 @@ parse_number (struct parser_state *par_state,
     }
 
   /* Handle base-switching prefixes 0x, 0t, 0d, 0.  */
-  if (p[0] == '0')
+  if (p[0] == '0' && len > 1)
     switch (p[1])
       {
       case 'x':
@@ -932,7 +931,7 @@ parse_number (struct parser_state *par_state,
         on 0x123456789 when LONGEST is 32 bits.  */
       if (c != 'l' && c != 'u' && n != 0)
        {
-         if ((unsigned_p && (ULONGEST) prevn >= (ULONGEST) n))
+         if (unsigned_p && prevn >= n)
            error (_("Numeric constant too large."));
        }
       prevn = n;
@@ -950,7 +949,7 @@ parse_number (struct parser_state *par_state,
      the case where it is we just always shift the value more than
      once, with fewer bits each time.  */
 
-  un = (ULONGEST)n >> 2;
+  un = n >> 2;
   if (long_p == 0
       && (un >> (gdbarch_int_bit (par_state->gdbarch ()) - 2)) == 0)
     {
@@ -1640,9 +1639,9 @@ yylex (void)
                break;
            }
 
-         yylval.tsym.type = SYMBOL_TYPE (best_sym);
+         yylval.tsym.type = best_sym->type ();
 #else /* not 0 */
-         yylval.tsym.type = SYMBOL_TYPE (sym);
+         yylval.tsym.type = sym->type ();
 #endif /* not 0 */
          free (uptokstart);
          return TYPENAME;