* sim-info.c (sim_info): Be verbose when either VERBOSE or STATE_VERBOSE_P.
[deliverable/binutils-gdb.git] / gdb / stabsread.c
index 872e07e456b80401073ffc56c3ba4ce422d1bd8c..bfbcc016c382c8fcd794991ef67c1f47a57b0539 100644 (file)
@@ -1276,7 +1276,7 @@ symbol_reference_defined (string)
       /* Must be a reference.   Either the symbol has already been defined,
          or this is a forward reference to it.  */
       *string = p;
-      return 0;
+      return -1;
     }
 }
 
@@ -1393,7 +1393,8 @@ define_symbol (valu, string, desc, type, objfile)
         defined symbol, so add it to the alias list of the previously
         defined symbol.  */
       s = string;
-      if (refnum = symbol_reference_defined (&s), refnum)
+      refnum = symbol_reference_defined (&s);
+      if (refnum >= 0)
          ref_add (refnum, sym, string, SYMBOL_VALUE (sym));
       else
        resolve_symbol_reference (objfile, sym, string);
@@ -1401,7 +1402,7 @@ define_symbol (valu, string, desc, type, objfile)
       /* S..P contains the name of the symbol.  We need to store
         the correct name into SYMBOL_NAME.  */
       nlen = p - s;
-      if (refnum)
+      if (refnum >= 0)
        {
          if (nlen > 0)
            {
@@ -1606,6 +1607,11 @@ define_symbol (valu, string, desc, type, objfile)
         in GDB.  E.g. "int" is converted to "function returning int".  */
       if (TYPE_CODE (SYMBOL_TYPE (sym)) != TYPE_CODE_FUNC)
        SYMBOL_TYPE (sym) = lookup_function_type (SYMBOL_TYPE (sym));
+
+      /* All functions in C++ have prototypes.  */
+      if (SYMBOL_LANGUAGE (sym) == language_cplus)
+       TYPE_FLAGS (SYMBOL_TYPE (sym)) |= TYPE_FLAG_PROTOTYPED;
+
       /* fall into process_prototype_types */
 
     process_prototype_types:
@@ -1613,10 +1619,15 @@ define_symbol (valu, string, desc, type, objfile)
         about their actual types (FIXME -- we should remember the whole
         function prototype), but the list may define some new types
         that we have to remember, so we must scan it now.  */
-      while (*p == ';') {
-       p++;
-       read_type (&p, objfile);
-      }
+      if (*p == ';')
+       {
+         TYPE_FLAGS (SYMBOL_TYPE (sym)) |= TYPE_FLAG_PROTOTYPED;
+
+         while (*p == ';') {
+           p++;
+           read_type (&p, objfile);
+         }
+       }
       break;
 
     case 'F':
@@ -1867,7 +1878,7 @@ define_symbol (valu, string, desc, type, objfile)
       SYMBOL_CLASS (sym) = LOC_STATIC;
       SYMBOL_VALUE_ADDRESS (sym) = valu;
 #ifdef STATIC_TRANSFORM_NAME
-      if (SYMBOL_NAME (sym)[0] == '$')
+      if (IS_STATIC_TRANSFORM_NAME (SYMBOL_NAME (sym)))
       {
        struct minimal_symbol *msym;
        msym = lookup_minimal_symbol (SYMBOL_NAME (sym), NULL, objfile);
@@ -1995,7 +2006,7 @@ define_symbol (valu, string, desc, type, objfile)
       SYMBOL_CLASS (sym) = LOC_STATIC;
       SYMBOL_VALUE_ADDRESS (sym) = valu;
 #ifdef STATIC_TRANSFORM_NAME
-      if (SYMBOL_NAME (sym)[0] == '$')
+      if (IS_STATIC_TRANSFORM_NAME (SYMBOL_NAME (sym)))
       {
        struct minimal_symbol *msym;
        msym = lookup_minimal_symbol (SYMBOL_NAME (sym), NULL, objfile);
@@ -2108,7 +2119,7 @@ define_symbol (valu, string, desc, type, objfile)
     }
 
   /* Is there more to parse?  For example LRS/alias information?  */
-  while (*p && (*p == ';' || *p == ','))
+  while (*p && *p == ';')
     {
       p++;
       if (*p && *p == 'l')
This page took 0.024358 seconds and 4 git commands to generate.