This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] stabsread.c whitespace tweaks


OK Elena?
2005-01-13  Michael Snyder  <msnyder@redhat.com>

	* stabsread.c: Whitespace tweaks.

Index: stabsread.c
===================================================================
RCS file: /cvs/src/src/gdb/stabsread.c,v
retrieving revision 1.78
diff -p -r1.78 stabsread.c
*** stabsread.c	13 Dec 2004 15:56:47 -0000	1.78
--- stabsread.c	14 Jan 2005 02:25:04 -0000
***************
*** 25,31 ****
     the "stabs" format.  This format is used with many systems that use
     the a.out object file format, as well as some systems that use
     COFF or ELF where the stabs data is placed in a special section.
!    Avoid placing any object file format specific code in this file. */
  
  #include "defs.h"
  #include "gdb_string.h"
--- 25,31 ----
     the "stabs" format.  This format is used with many systems that use
     the a.out object file format, as well as some systems that use
     COFF or ELF where the stabs data is placed in a special section.
!    Avoid placing any object file format specific code in this file.  */
  
  #include "defs.h"
  #include "gdb_string.h"
***************
*** 36,42 ****
  #include "expression.h"
  #include "symfile.h"
  #include "objfiles.h"
! #include "aout/stab_gnu.h"	/* We always use GNU stabs, not native */
  #include "libaout.h"
  #include "aout/aout64.h"
  #include "gdb-stabs.h"
--- 36,42 ----
  #include "expression.h"
  #include "symfile.h"
  #include "objfiles.h"
! #include "aout/stab_gnu.h"	/* We always use GNU stabs, not native.  */
  #include "libaout.h"
  #include "aout/aout64.h"
  #include "gdb-stabs.h"
***************
*** 53,59 ****
  /* Ask stabsread.h to define the vars it normally declares `extern'.  */
  #define	EXTERN
  /**/
! #include "stabsread.h"		/* Our own declarations */
  #undef	EXTERN
  
  extern void _initialize_stabsread (void);
--- 53,59 ----
  /* Ask stabsread.h to define the vars it normally declares `extern'.  */
  #define	EXTERN
  /**/
! #include "stabsread.h"		/* Our own declarations.  */
  #undef	EXTERN
  
  extern void _initialize_stabsread (void);
*************** dbx_lookup_type (int typenums[2])
*** 312,318 ****
     and return the type object.
     This can create an empty (zeroed) type object.
     TYPENUMS may be (-1, -1) to return a new type object that is not
!    put into the type vector, and so may not be referred to by number. */
  
  static struct type *
  dbx_alloc_type (int typenums[2], struct objfile *objfile)
--- 312,318 ----
     and return the type object.
     This can create an empty (zeroed) type object.
     TYPENUMS may be (-1, -1) to return a new type object that is not
!    put into the type vector, and so may not be referred to by number.  */
  
  static struct type *
  dbx_alloc_type (int typenums[2], struct objfile *objfile)
*************** dbx_alloc_type (int typenums[2], struct 
*** 338,344 ****
  }
  
  /* for all the stabs in a given stab vector, build appropriate types 
!    and fix their symbols in given symbol vector. */
  
  static void
  patch_block_stabs (struct pending *symbols, struct pending_stabs *stabs,
--- 338,344 ----
  }
  
  /* for all the stabs in a given stab vector, build appropriate types 
!    and fix their symbols in given symbol vector.  */
  
  static void
  patch_block_stabs (struct pending *symbols, struct pending_stabs *stabs,
*************** read_type_number (char **pp, int *typenu
*** 459,465 ****
  #define VISIBILITY_IGNORE	'9'	/* Optimized out or zero length */
  
  /* Structure for storing pointers to reference definitions for fast lookup 
!    during "process_later". */
  
  struct ref_map
  {
--- 459,465 ----
  #define VISIBILITY_IGNORE	'9'	/* Optimized out or zero length */
  
  /* Structure for storing pointers to reference definitions for fast lookup 
!    during "process_later".  */
  
  struct ref_map
  {
*************** struct ref_map
*** 474,488 ****
  
  static struct ref_map *ref_map;
  
! /* Ptr to free cell in chunk's linked list. */
  static int ref_count = 0;
  
! /* Number of chunks malloced. */
  static int ref_chunk = 0;
  
  /* This file maintains a cache of stabs aliases found in the symbol
     table. If the symbol table changes, this cache must be cleared
!    or we are left holding onto data in invalid obstacks. */
  void
  stabsread_clear_cache (void)
  {
--- 474,488 ----
  
  static struct ref_map *ref_map;
  
! /* Ptr to free cell in chunk's linked list.  */
  static int ref_count = 0;
  
! /* Number of chunks malloced.  */
  static int ref_chunk = 0;
  
  /* This file maintains a cache of stabs aliases found in the symbol
     table. If the symbol table changes, this cache must be cleared
!    or we are left holding onto data in invalid obstacks.  */
  void
  stabsread_clear_cache (void)
  {
*************** stabsread_clear_cache (void)
*** 490,499 ****
    ref_chunk = 0;
  }
  
! /* Create array of pointers mapping refids to symbols and stab strings.
!    Add pointers to reference definition symbols and/or their values as we 
!    find them, using their reference numbers as our index. 
!    These will be used later when we resolve references. */
  void
  ref_add (int refnum, struct symbol *sym, char *stabs, CORE_ADDR value)
  {
--- 490,499 ----
    ref_chunk = 0;
  }
  
! /* Create array of pointers mapping refids to symbols and stab
!    strings.  Add pointers to reference definition symbols and/or their
!    values as we find them, using their reference numbers as our index.
!    These will be used later when we resolve references.  */
  void
  ref_add (int refnum, struct symbol *sym, char *stabs, CORE_ADDR value)
  {
*************** process_reference (char **string)
*** 539,545 ****
    /* Advance beyond the initial '#'.  */
    p = *string + 1;
  
!   /* Read number as reference id. */
    while (*p && isdigit (*p))
      {
        refnum = refnum * 10 + *p - '0';
--- 539,545 ----
    /* Advance beyond the initial '#'.  */
    p = *string + 1;
  
!   /* Read number as reference id.  */
    while (*p && isdigit (*p))
      {
        refnum = refnum * 10 + *p - '0';
*************** symbol_reference_defined (char **string)
*** 560,569 ****
  
    refnum = process_reference (&p);
  
!   /* Defining symbols end in '=' */
    if (*p == '=')
      {
!       /* Symbol is being defined here. */
        *string = p + 1;
        return refnum;
      }
--- 560,569 ----
  
    refnum = process_reference (&p);
  
!   /* Defining symbols end in '='.  */
    if (*p == '=')
      {
!       /* Symbol is being defined here.  */
        *string = p + 1;
        return refnum;
      }
*************** define_symbol (CORE_ADDR valu, char *str
*** 586,595 ****
    int synonym = 0;
    int i;
  
!   /* We would like to eliminate nameless symbols, but keep their types.
!      E.g. stab entry ":t10=*2" should produce a type 10, which is a pointer
!      to type 2, but, should not create a symbol to address that type. Since
!      the symbol will be nameless, there is no way any user can refer to it. */
  
    int nameless;
  
--- 586,596 ----
    int synonym = 0;
    int i;
  
!   /* We would like to eliminate nameless symbols, but keep their
!      types.  E.g. stab entry ":t10=*2" should produce a type 10, which
!      is a pointer to type 2, but, should not create a symbol to
!      address that type. Since the symbol will be nameless, there is no
!      way any user can refer to it.  */
  
    int nameless;
  
*************** define_symbol (CORE_ADDR valu, char *str
*** 597,603 ****
    if (string[0] == 0)
      return 0;
  
!   /* Ignore old-style symbols from cc -go  */
    if (p == 0)
      return 0;
  
--- 598,604 ----
    if (string[0] == 0)
      return 0;
  
!   /* Ignore old-style symbols from cc -go.  */
    if (p == 0)
      return 0;
  
*************** define_symbol (CORE_ADDR valu, char *str
*** 630,637 ****
  
    if (processing_gcc_compilation)
      {
!       /* GCC 2.x puts the line number in desc.  SunOS apparently puts in the
!          number of bytes occupied by a type or object, which we ignore.  */
        SYMBOL_LINE (sym) = desc;
      }
    else
--- 631,639 ----
  
    if (processing_gcc_compilation)
      {
!       /* GCC 2.x puts the line number in desc.  SunOS apparently puts
!          in the number of bytes occupied by a type or object, which
!          we ignore.  */
        SYMBOL_LINE (sym) = desc;
      }
    else
*************** define_symbol (CORE_ADDR valu, char *str
*** 645,652 ****
        switch (string[1])
  	{
  	case 't':
! 	  DEPRECATED_SYMBOL_NAME (sym) = obsavestring ("this", strlen ("this"),
! 					    &objfile->objfile_obstack);
  	  break;
  
  	case 'v':		/* $vtbl_ptr_type */
--- 647,655 ----
        switch (string[1])
  	{
  	case 't':
! 	  DEPRECATED_SYMBOL_NAME (sym) = 
! 	    obsavestring ("this", strlen ("this"),
! 			  &objfile->objfile_obstack);
  	  break;
  
  	case 'v':		/* $vtbl_ptr_type */
*************** define_symbol (CORE_ADDR valu, char *str
*** 671,677 ****
  	default:
  	  complaint (&symfile_complaints, "Unknown C++ symbol name `%s'",
  		     string);
! 	  goto normal;		/* Do *something* with it */
  	}
      }
    else
--- 674,680 ----
  	default:
  	  complaint (&symfile_complaints, "Unknown C++ symbol name `%s'",
  		     string);
! 	  goto normal;		/* Do *something* with it.  */
  	}
      }
    else
*************** define_symbol (CORE_ADDR valu, char *str
*** 841,847 ****
           primarily for promotion when calling the function from GDB.  */
        TYPE_FLAGS (SYMBOL_TYPE (sym)) |= TYPE_FLAG_PROTOTYPED;
  
!       /* fall into process_prototype_types */
  
      process_prototype_types:
        /* Sun acc puts declared types of arguments here.  */
--- 844,850 ----
           primarily for promotion when calling the function from GDB.  */
        TYPE_FLAGS (SYMBOL_TYPE (sym)) |= TYPE_FLAG_PROTOTYPED;
  
!       /* Fall into process_prototype_types.  */
  
      process_prototype_types:
        /* Sun acc puts declared types of arguments here.  */
*************** define_symbol (CORE_ADDR valu, char *str
*** 860,866 ****
  		nsemi++;
  	    }
  
! 	  /* Allocate parameter information fields and fill them in. */
  	  TYPE_FIELDS (ftype) = (struct field *)
  	    TYPE_ALLOC (ftype, nsemi * sizeof (struct field));
  	  while (*p++ == ';')
--- 863,869 ----
  		nsemi++;
  	    }
  
! 	  /* Allocate parameter information fields and fill them in.  */
  	  TYPE_FIELDS (ftype) = (struct field *)
  	    TYPE_ALLOC (ftype, nsemi * sizeof (struct field));
  	  while (*p++ == ';')
*************** define_symbol (CORE_ADDR valu, char *str
*** 878,884 ****
  	         a type which references itself. This type is turned into
  	         a TYPE_CODE_VOID type by read_type, and we have to turn
  	         it back into builtin_type_int here.
! 	         FIXME: Do we need a new builtin_type_promoted_int_arg ?  */
  	      if (TYPE_CODE (ptype) == TYPE_CODE_VOID)
  		ptype = builtin_type_int;
  	      TYPE_FIELD_TYPE (ftype, nparams) = ptype;
--- 881,887 ----
  	         a type which references itself. This type is turned into
  	         a TYPE_CODE_VOID type by read_type, and we have to turn
  	         it back into builtin_type_int here.
! 	         FIXME: Do we need a new builtin_type_promoted_int_arg?  */
  	      if (TYPE_CODE (ptype) == TYPE_CODE_VOID)
  		ptype = builtin_type_int;
  	      TYPE_FIELD_TYPE (ftype, nparams) = ptype;
*************** define_symbol (CORE_ADDR valu, char *str
*** 905,915 ****
        SYMBOL_TYPE (sym) = read_type (&p, objfile);
        SYMBOL_CLASS (sym) = LOC_STATIC;
        SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
!       /* Don't add symbol references to global_sym_chain.
!          Symbol references don't have valid names and wont't match up with
           minimal symbols when the global_sym_chain is relocated.
!          We'll fixup symbol references when we fixup the defining symbol.  */
!       if (DEPRECATED_SYMBOL_NAME (sym) && DEPRECATED_SYMBOL_NAME (sym)[0] != '#')
  	{
  	  i = hashname (DEPRECATED_SYMBOL_NAME (sym));
  	  SYMBOL_VALUE_CHAIN (sym) = global_sym_chain[i];
--- 908,920 ----
        SYMBOL_TYPE (sym) = read_type (&p, objfile);
        SYMBOL_CLASS (sym) = LOC_STATIC;
        SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
!       /* Don't add symbol references to global_sym_chain.  Symbol
!          references don't have valid names and wont't match up with
           minimal symbols when the global_sym_chain is relocated.
!          We'll fixup symbol references when we fixup the defining
!          symbol.  */
!       if (DEPRECATED_SYMBOL_NAME (sym) 
! 	  && DEPRECATED_SYMBOL_NAME (sym)[0] != '#')
  	{
  	  i = hashname (DEPRECATED_SYMBOL_NAME (sym));
  	  SYMBOL_VALUE_CHAIN (sym) = global_sym_chain[i];
*************** define_symbol (CORE_ADDR valu, char *str
*** 1106,1112 ****
        SYMBOL_TYPE (sym) = read_type (&p, objfile);
  
        /* For a nameless type, we don't want a create a symbol, thus we
!          did not use `sym'. Return without further processing. */
        if (nameless)
  	return NULL;
  
--- 1111,1117 ----
        SYMBOL_TYPE (sym) = read_type (&p, objfile);
  
        /* For a nameless type, we don't want a create a symbol, thus we
!          did not use `sym'. Return without further processing.  */
        if (nameless)
  	return NULL;
  
*************** define_symbol (CORE_ADDR valu, char *str
*** 1133,1139 ****
  	{
  	  /* gcc-2.6 or later (when using -fvtable-thunks)
  	     emits a unique named type for a vtable entry.
! 	     Some gdb code depends on that specific name. */
  	  extern const char vtbl_ptr_name[];
  
  	  if ((TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_PTR
--- 1138,1144 ----
  	{
  	  /* gcc-2.6 or later (when using -fvtable-thunks)
  	     emits a unique named type for a vtable entry.
! 	     Some gdb code depends on that specific name.  */
  	  extern const char vtbl_ptr_name[];
  
  	  if ((TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_PTR
*************** define_symbol (CORE_ADDR valu, char *str
*** 1174,1180 ****
  		 main () {}
  		 */
  
! 	      /* Pascal accepts names for pointer types. */
  	      if (current_subfile->language == language_pascal)
  		{
  		  TYPE_NAME (SYMBOL_TYPE (sym)) = DEPRECATED_SYMBOL_NAME (sym);
--- 1179,1185 ----
  		 main () {}
  		 */
  
! 	      /* Pascal accepts names for pointer types.  */
  	      if (current_subfile->language == language_pascal)
  		{
  		  TYPE_NAME (SYMBOL_TYPE (sym)) = DEPRECATED_SYMBOL_NAME (sym);
*************** define_symbol (CORE_ADDR valu, char *str
*** 1198,1204 ****
        SYMBOL_TYPE (sym) = read_type (&p, objfile);
   
        /* For a nameless type, we don't want a create a symbol, thus we
!          did not use `sym'. Return without further processing. */
        if (nameless)
  	return NULL;
  
--- 1203,1209 ----
        SYMBOL_TYPE (sym) = read_type (&p, objfile);
   
        /* For a nameless type, we don't want a create a symbol, thus we
!          did not use `sym'. Return without further processing.  */
        if (nameless)
  	return NULL;
  
*************** define_symbol (CORE_ADDR valu, char *str
*** 1207,1227 ****
        SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
        if (TYPE_TAG_NAME (SYMBOL_TYPE (sym)) == 0)
  	TYPE_TAG_NAME (SYMBOL_TYPE (sym))
! 	  = obconcat (&objfile->objfile_obstack, "", "", DEPRECATED_SYMBOL_NAME (sym));
        add_symbol_to_list (sym, &file_symbols);
  
        if (synonym)
  	{
! 	  /* Clone the sym and then modify it. */
  	  struct symbol *typedef_sym = (struct symbol *)
! 	  obstack_alloc (&objfile->objfile_obstack, sizeof (struct symbol));
  	  *typedef_sym = *sym;
  	  SYMBOL_CLASS (typedef_sym) = LOC_TYPEDEF;
  	  SYMBOL_VALUE (typedef_sym) = valu;
  	  SYMBOL_DOMAIN (typedef_sym) = VAR_DOMAIN;
  	  if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
  	    TYPE_NAME (SYMBOL_TYPE (sym))
! 	      = obconcat (&objfile->objfile_obstack, "", "", DEPRECATED_SYMBOL_NAME (sym));
  	  add_symbol_to_list (typedef_sym, &file_symbols);
  	}
        break;
--- 1212,1235 ----
        SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
        if (TYPE_TAG_NAME (SYMBOL_TYPE (sym)) == 0)
  	TYPE_TAG_NAME (SYMBOL_TYPE (sym))
! 	  = obconcat (&objfile->objfile_obstack, "", "", 
! 		      DEPRECATED_SYMBOL_NAME (sym));
        add_symbol_to_list (sym, &file_symbols);
  
        if (synonym)
  	{
! 	  /* Clone the sym and then modify it.  */
  	  struct symbol *typedef_sym = (struct symbol *)
! 	  obstack_alloc (&objfile->objfile_obstack, 
! 			 sizeof (struct symbol));
  	  *typedef_sym = *sym;
  	  SYMBOL_CLASS (typedef_sym) = LOC_TYPEDEF;
  	  SYMBOL_VALUE (typedef_sym) = valu;
  	  SYMBOL_DOMAIN (typedef_sym) = VAR_DOMAIN;
  	  if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
  	    TYPE_NAME (SYMBOL_TYPE (sym))
! 	      = obconcat (&objfile->objfile_obstack, "", "", 
! 			  DEPRECATED_SYMBOL_NAME (sym));
  	  add_symbol_to_list (typedef_sym, &file_symbols);
  	}
        break;
*************** read_type (char **pp, struct objfile *ob
*** 1386,1395 ****
       there is no size attribute.  */
    int type_size = -1;
  
!   /* Used to distinguish string and bitstring from char-array and set. */
    int is_string = 0;
  
!   /* Used to distinguish vector from array. */
    int is_vector = 0;
  
    /* Read type number if present.  The type number may be omitted.
--- 1394,1403 ----
       there is no size attribute.  */
    int type_size = -1;
  
!   /* Used to distinguish string and bitstring from char-array and set.  */
    int is_string = 0;
  
!   /* Used to distinguish vector from array.  */
    int is_vector = 0;
  
    /* Read type number if present.  The type number may be omitted.
*************** again:
*** 1558,1567 ****
        (*pp)--;
  
        /* We deal with something like t(1,2)=(3,4)=... which
!          the Lucid compiler and recent gcc versions (post 2.7.3) use. */
  
        /* Allocate and enter the typedef type first.
!          This handles recursive types. */
        type = dbx_alloc_type (typenums, objfile);
        TYPE_CODE (type) = TYPE_CODE_TYPEDEF;
        {
--- 1566,1575 ----
        (*pp)--;
  
        /* We deal with something like t(1,2)=(3,4)=... which
!          the Lucid compiler and recent gcc versions (post 2.7.3) use.  */
  
        /* Allocate and enter the typedef type first.
!          This handles recursive types.  */
        type = dbx_alloc_type (typenums, objfile);
        TYPE_CODE (type) = TYPE_CODE_TYPEDEF;
        {
*************** again:
*** 1631,1637 ****
        type = make_function_type (type1, dbx_lookup_type (typenums));
        break;
  
!     case 'g':                   /* Prototyped function.  (Sun)  */
        {
          /* Unresolved questions:
  
--- 1639,1645 ----
        type = make_function_type (type1, dbx_lookup_type (typenums));
        break;
  
!     case 'g':                   /* Prototyped function.  (Sun) */
        {
          /* Unresolved questions:
  
*************** again:
*** 1754,1765 ****
  	      break;
  
  	    case 'S':		/* String attribute */
! 	      /* FIXME: check to see if following type is array? */
  	      is_string = 1;
  	      break;
  
  	    case 'V':		/* Vector attribute */
! 	      /* FIXME: check to see if following type is array? */
  	      is_vector = 1;
  	      break;
  
--- 1762,1773 ----
  	      break;
  
  	    case 'S':		/* String attribute */
! 	      /* FIXME: check to see if following type is array?  */
  	      is_string = 1;
  	      break;
  
  	    case 'V':		/* Vector attribute */
! 	      /* FIXME: check to see if following type is array?  */
  	      is_vector = 1;
  	      break;
  
*************** again:
*** 1879,1886 ****
        break;
  
      default:
!       --*pp;			/* Go back to the symbol in error */
!       /* Particularly important if it was \0! */
        return error_type (pp, objfile);
      }
  
--- 1887,1894 ----
        break;
  
      default:
!       --*pp;			/* Go back to the symbol in error.  */
!       /* Particularly important if it was \0!  */
        return error_type (pp, objfile);
      }
  
*************** again:
*** 1898,1904 ****
  }
  
  /* RS/6000 xlc/dbx combination uses a set of builtin types, starting from -1.
!    Return the proper type node for a given builtin type number. */
  
  static struct type *
  rs6000_builtin_type (int typenum)
--- 1906,1912 ----
  }
  
  /* RS/6000 xlc/dbx combination uses a set of builtin types, starting from -1.
!    Return the proper type node for a given builtin type number.  */
  
  static struct type *
  rs6000_builtin_type (int typenum)
*************** rs6000_builtin_type (int typenum)
*** 1978,1986 ****
        rettype = init_type (TYPE_CODE_FLT, 8, 0, "double", NULL);
        break;
      case 14:
!       /* This is an IEEE double on the RS/6000, and different machines with
!          different sizes for "long double" should use different negative
!          type numbers.  See stabs.texinfo.  */
        rettype = init_type (TYPE_CODE_FLT, 8, 0, "long double", NULL);
        break;
      case 15:
--- 1986,1994 ----
        rettype = init_type (TYPE_CODE_FLT, 8, 0, "double", NULL);
        break;
      case 14:
!       /* This is an IEEE double on the RS/6000, and different machines
!          with different sizes for "long double" should use different
!          negative type numbers.  See stabs.texinfo.  */
        rettype = init_type (TYPE_CODE_FLT, 8, 0, "long double", NULL);
        break;
      case 15:
*************** update_method_name_from_physname (char *
*** 2089,2096 ****
      xfree (method_name);
  }
  
! /* Read member function stabs info for C++ classes.  The form of each member
!    function data is:
  
     NAME :: TYPENUM[=type definition] ARGS : PHYSNAME ;
  
--- 2097,2104 ----
      xfree (method_name);
  }
  
! /* Read member function stabs info for C++ classes.  The form of each
!    member function data is:
  
     NAME :: TYPENUM[=type definition] ARGS : PHYSNAME ;
  
*************** update_method_name_from_physname (char *
*** 2098,2118 ****
  
     afunc1::20=##15;:i;2A.;afunc2::20:i;2A.;
  
!    For the case of overloaded operators, the format is op$::*.funcs, where
!    $ is the CPLUS_MARKER (usually '$'), `*' holds the place for an operator
!    name (such as `+=') and `.' marks the end of the operator name.
  
     Returns 1 for success, 0 for failure.  */
  
  static int
! read_member_functions (struct field_info *fip, char **pp, struct type *type,
! 		       struct objfile *objfile)
  {
    int nfn_fields = 0;
    int length = 0;
!   /* Total number of member functions defined in this class.  If the class
!      defines two `f' functions, and one `g' function, then this will have
!      the value 3.  */
    int total_length = 0;
    int i;
    struct next_fnfield
--- 2106,2127 ----
  
     afunc1::20=##15;:i;2A.;afunc2::20:i;2A.;
  
!    For the case of overloaded operators, the format is op$::*.funcs,
!    where $ is the CPLUS_MARKER (usually '$'), `*' holds the place for
!    an operator name (such as `+=') and `.' marks the end of the
!    operator name.
  
     Returns 1 for success, 0 for failure.  */
  
  static int
! read_member_functions (struct field_info *fip, char **pp,
! 		       struct type *type, struct objfile *objfile)
  {
    int nfn_fields = 0;
    int length = 0;
!   /* Total number of member functions defined in this class.  If the
!      class defines two `f' functions, and one `g' function, then this
!      will have the value 3.  */
    int total_length = 0;
    int i;
    struct next_fnfield
*************** read_member_functions (struct field_info
*** 2128,2140 ****
    char *p;
  
    /* Process each list until we find something that is not a member function
!      or find the end of the functions. */
  
    while (**pp != ';')
      {
        /* We should be positioned at the start of the function name.
           Scan forward to find the first ':' and if it is not the
!          first of a "::" delimiter, then this is not a member function. */
        p = *pp;
        while (*p != ':')
  	{
--- 2137,2149 ----
    char *p;
  
    /* Process each list until we find something that is not a member function
!      or find the end of the functions.  */
  
    while (**pp != ';')
      {
        /* We should be positioned at the start of the function name.
           Scan forward to find the first ':' and if it is not the
!          first of a "::" delimiter, then this is not a member function.  */
        p = *pp;
        while (*p != ':')
  	{
*************** read_member_functions (struct field_info
*** 2199,2205 ****
  	  /* Check for and handle cretinous dbx symbol name continuation!  */
  	  if (look_ahead_type == NULL)
  	    {
! 	      /* Normal case. */
  	      STABS_CONTINUE (pp, objfile);
  
  	      new_sublist->fn_field.type = read_type (pp, objfile);
--- 2208,2214 ----
  	  /* Check for and handle cretinous dbx symbol name continuation!  */
  	  if (look_ahead_type == NULL)
  	    {
! 	      /* Normal case.  */
  	      STABS_CONTINUE (pp, objfile);
  
  	      new_sublist->fn_field.type = read_type (pp, objfile);
*************** read_member_functions (struct field_info
*** 2211,2217 ****
  	    }
  	  else
  	    {
! 	      /* g++ version 1 kludge */
  	      new_sublist->fn_field.type = look_ahead_type;
  	      look_ahead_type = NULL;
  	    }
--- 2220,2226 ----
  	    }
  	  else
  	    {
! 	      /* g++ version 1 kludge.  */
  	      new_sublist->fn_field.type = look_ahead_type;
  	      look_ahead_type = NULL;
  	    }
*************** read_member_functions (struct field_info
*** 2223,2229 ****
  	      p++;
  	    }
  
! 	  /* If this is just a stub, then we don't have the real name here. */
  
  	  if (TYPE_STUB (new_sublist->fn_field.type))
  	    {
--- 2232,2239 ----
  	      p++;
  	    }
  
! 	  /* If this is just a stub, then we don't have the real name
! 	     here.  */
  
  	  if (TYPE_STUB (new_sublist->fn_field.type))
  	    {
*************** read_member_functions (struct field_info
*** 2248,2274 ****
  	  STABS_CONTINUE (pp, objfile);
  	  switch (**pp)
  	    {
! 	    case 'A':		/* Normal functions. */
  	      new_sublist->fn_field.is_const = 0;
  	      new_sublist->fn_field.is_volatile = 0;
  	      (*pp)++;
  	      break;
! 	    case 'B':		/* `const' member functions. */
  	      new_sublist->fn_field.is_const = 1;
  	      new_sublist->fn_field.is_volatile = 0;
  	      (*pp)++;
  	      break;
! 	    case 'C':		/* `volatile' member function. */
  	      new_sublist->fn_field.is_const = 0;
  	      new_sublist->fn_field.is_volatile = 1;
  	      (*pp)++;
  	      break;
! 	    case 'D':		/* `const volatile' member function. */
  	      new_sublist->fn_field.is_const = 1;
  	      new_sublist->fn_field.is_volatile = 1;
  	      (*pp)++;
  	      break;
! 	    case '*':		/* File compiled with g++ version 1 -- no info */
  	    case '?':
  	    case '.':
  	      break;
--- 2258,2285 ----
  	  STABS_CONTINUE (pp, objfile);
  	  switch (**pp)
  	    {
! 	    case 'A':		/* Normal functions.  */
  	      new_sublist->fn_field.is_const = 0;
  	      new_sublist->fn_field.is_volatile = 0;
  	      (*pp)++;
  	      break;
! 	    case 'B':		/* `const' member functions.  */
  	      new_sublist->fn_field.is_const = 1;
  	      new_sublist->fn_field.is_volatile = 0;
  	      (*pp)++;
  	      break;
! 	    case 'C':		/* `volatile' member function.  */
  	      new_sublist->fn_field.is_const = 0;
  	      new_sublist->fn_field.is_volatile = 1;
  	      (*pp)++;
  	      break;
! 	    case 'D':		/* `const volatile' member function.  */
  	      new_sublist->fn_field.is_const = 1;
  	      new_sublist->fn_field.is_volatile = 1;
  	      (*pp)++;
  	      break;
! 	    case '*':		/* File compiled with g++ version 1 -- 
! 				   no info.  */
  	    case '?':
  	    case '.':
  	      break;
*************** read_member_functions (struct field_info
*** 2309,2315 ****
  		    look_ahead_type = read_type (pp, objfile);
  		    if (**pp == ':')
  		      {
! 			/* g++ version 1 overloaded methods. */
  		      }
  		    else
  		      {
--- 2320,2326 ----
  		    look_ahead_type = read_type (pp, objfile);
  		    if (**pp == ':')
  		      {
! 			/* g++ version 1 overloaded methods.  */
  		      }
  		    else
  		      {
*************** read_member_functions (struct field_info
*** 2328,2334 ****
  		break;
  	      }
  	    case '?':
! 	      /* static member function.  */
  	      {
  		int slen = strlen (main_fn_name);
  
--- 2339,2345 ----
  		break;
  	      }
  	    case '?':
! 	      /* Static member function.  */
  	      {
  		int slen = strlen (main_fn_name);
  
*************** read_member_functions (struct field_info
*** 2361,2367 ****
  	      /* Fall through into normal member function.  */
  
  	    case '.':
! 	      /* normal member function.  */
  	      new_sublist->fn_field.voffset = 0;
  	      new_sublist->fn_field.fcontext = 0;
  	      break;
--- 2372,2378 ----
  	      /* Fall through into normal member function.  */
  
  	    case '.':
! 	      /* Normal member function.  */
  	      new_sublist->fn_field.voffset = 0;
  	      new_sublist->fn_field.fcontext = 0;
  	      break;
*************** read_member_functions (struct field_info
*** 2516,2526 ****
  	  else if (is_v3)
  	    {
  	      /* v3 mangling prevents the use of abbreviated physnames,
! 		 so we can do this here.  There are stubbed methods in v3
! 		 only:
  		 - in -gstabs instead of -gstabs+
! 		 - or for static methods, which are output as a function type
! 		   instead of a method type.  */
  
  	      update_method_name_from_physname (&new_fnlist->fn_fieldlist.name,
  						sublist->fn_field.physname);
--- 2527,2537 ----
  	  else if (is_v3)
  	    {
  	      /* v3 mangling prevents the use of abbreviated physnames,
! 		 so we can do this here.  There are stubbed methods in
! 		 v3 only:
  		 - in -gstabs instead of -gstabs+
! 		 - or for static methods, which are output as a
! 		   function type instead of a method type.  */
  
  	      update_method_name_from_physname (&new_fnlist->fn_fieldlist.name,
  						sublist->fn_field.physname);
*************** read_member_functions (struct field_info
*** 2579,2586 ****
  
  /* Special GNU C++ name.
  
!    Returns 1 for success, 0 for failure.  "failure" means that we can't
!    keep parsing and it's time for error_type().  */
  
  static int
  read_cpp_abbrev (struct field_info *fip, char **pp, struct type *type,
--- 2590,2597 ----
  
  /* Special GNU C++ name.
  
!    Returns 1 for success, 0 for failure.  "failure" means that we
!    can't keep parsing and it's time for error_type().  */
  
  static int
  read_cpp_abbrev (struct field_info *fip, char **pp, struct type *type,
*************** read_cpp_abbrev (struct field_info *fip,
*** 2602,2608 ****
        /* At this point, *pp points to something like "22:23=*22...",
           where the type number before the ':' is the "context" and
           everything after is a regular type definition.  Lookup the
!          type, find it's name, and construct the field name. */
  
        context = read_type (pp, objfile);
  
--- 2613,2619 ----
        /* At this point, *pp points to something like "22:23=*22...",
           where the type number before the ':' is the "context" and
           everything after is a regular type definition.  Lookup the
!          type, find it's name, and construct the field name.  */
  
        context = read_type (pp, objfile);
  
*************** read_cpp_abbrev (struct field_info *fip,
*** 2640,2646 ****
  	}
  
        /* At this point, *pp points to the ':'.  Skip it and read the
!          field type. */
  
        p = ++(*pp);
        if (p[-1] != ':')
--- 2651,2657 ----
  	}
  
        /* At this point, *pp points to the ':'.  Skip it and read the
!          field type.  */
  
        p = ++(*pp);
        if (p[-1] != ':')
*************** read_cpp_abbrev (struct field_info *fip,
*** 2668,2676 ****
    else
      {
        invalid_cpp_abbrev_complaint (*pp);
!       /* We have no idea what syntax an unrecognized abbrev would have, so
!          better return 0.  If we returned 1, we would need to at least advance
!          *pp to avoid an infinite loop.  */
        return 0;
      }
    return 1;
--- 2679,2687 ----
    else
      {
        invalid_cpp_abbrev_complaint (*pp);
!       /* We have no idea what syntax an unrecognized abbrev would
!          have, so better return 0.  If we returned 1, we would need to
!          at least advance *pp to avoid an infinite loop.  */
        return 0;
      }
    return 1;
*************** read_one_struct_field (struct field_info
*** 2684,2690 ****
      obsavestring (*pp, p - *pp, &objfile->objfile_obstack);
    *pp = p + 1;
  
!   /* This means we have a visibility for a field coming. */
    if (**pp == '/')
      {
        (*pp)++;
--- 2695,2701 ----
      obsavestring (*pp, p - *pp, &objfile->objfile_obstack);
    *pp = p + 1;
  
!   /* This means we have a visibility for a field coming.  */
    if (**pp == '/')
      {
        (*pp)++;
*************** read_one_struct_field (struct field_info
*** 2692,2698 ****
      }
    else
      {
!       /* normal dbx-style format, no explicit visibility */
        fip->list->visibility = VISIBILITY_PUBLIC;
      }
  
--- 2703,2709 ----
      }
    else
      {
!       /* Normal dbx-style format, no explicit visibility.  */
        fip->list->visibility = VISIBILITY_PUBLIC;
      }
  
*************** read_one_struct_field (struct field_info
*** 2701,2707 ****
      {
        p = ++(*pp);
  #if 0
!       /* Possible future hook for nested types. */
        if (**pp == '!')
  	{
  	  fip->list->field.bitpos = (long) -2;	/* nested type */
--- 2712,2718 ----
      {
        p = ++(*pp);
  #if 0
!       /* Possible future hook for nested types.  */
        if (**pp == '!')
  	{
  	  fip->list->field.bitpos = (long) -2;	/* nested type */
*************** read_struct_fields (struct field_info *f
*** 2825,2835 ****
  
    p = *pp;
  
!   /* Read each data member type until we find the terminating ';' at the end of
!      the data member list, or break for some other reason such as finding the
!      start of the member function list. */
    /* Stab string for structure/union does not end with two ';' in
!      SUN C compiler 5.3 i.e. F6U2, hence check for end of string. */
  
    while (**pp != ';' && **pp != '\0')
      {
--- 2836,2846 ----
  
    p = *pp;
  
!   /* Read each data member type until we find the terminating ';' at
!      the end of the data member list, or break for some other reason
!      such as finding the start of the member function list.  */
    /* Stab string for structure/union does not end with two ';' in
!      SUN C compiler 5.3 i.e. F6U2, hence check for end of string.  */
  
    while (**pp != ';' && **pp != '\0')
      {
*************** read_struct_fields (struct field_info *f
*** 2857,2865 ****
  	}
  
        /* Look for the ':' that separates the field name from the field
!          values.  Data members are delimited by a single ':', while member
!          functions are delimited by a pair of ':'s.  When we hit the member
!          functions (if any), terminate scan loop and return. */
  
        while (*p != ':' && *p != '\0')
  	{
--- 2868,2877 ----
  	}
  
        /* Look for the ':' that separates the field name from the field
!          values.  Data members are delimited by a single ':', while
!          member functions are delimited by a pair of ':'s.  When we
!          hit the member functions (if any), terminate scan loop and
!          return.  */
  
        while (*p != ':' && *p != '\0')
  	{
*************** read_struct_fields (struct field_info *f
*** 2877,2885 ****
      }
    if (p[0] == ':' && p[1] == ':')
      {
!       /* (the deleted) chill the list of fields: the last entry (at
           the head) is a partially constructed entry which we now
!          scrub. */
        fip->list = fip->list->next;
      }
    return 1;
--- 2889,2897 ----
      }
    if (p[0] == ':' && p[1] == ':')
      {
!       /* (The deleted) chill the list of fields: the last entry (at
           the head) is a partially constructed entry which we now
!          scrub.  */
        fip->list = fip->list->next;
      }
    return 1;
*************** read_baseclasses (struct field_info *fip
*** 2925,2931 ****
      }
    else
      {
!       /* Skip the '!' baseclass information marker. */
        (*pp)++;
      }
  
--- 2937,2943 ----
      }
    else
      {
!       /* Skip the '!' baseclass information marker.  */
        (*pp)++;
      }
  
*************** read_baseclasses (struct field_info *fip
*** 2961,2973 ****
        memset (new, 0, sizeof (struct nextfield));
        new->next = fip->list;
        fip->list = new;
!       FIELD_BITSIZE (new->field) = 0;	/* this should be an unpacked field! */
  
        STABS_CONTINUE (pp, objfile);
        switch (**pp)
  	{
  	case '0':
! 	  /* Nothing to do. */
  	  break;
  	case '1':
  	  SET_TYPE_FIELD_VIRTUAL (type, i);
--- 2973,2986 ----
        memset (new, 0, sizeof (struct nextfield));
        new->next = fip->list;
        fip->list = new;
!       /* This should be an unpacked field!  */
!       FIELD_BITSIZE (new->field) = 0;
  
        STABS_CONTINUE (pp, objfile);
        switch (**pp)
  	{
  	case '0':
! 	  /* Nothing to do.  */
  	  break;
  	case '1':
  	  SET_TYPE_FIELD_VIRTUAL (type, i);
*************** read_baseclasses (struct field_info *fip
*** 3013,3024 ****
  
        /* The last piece of baseclass information is the type of the
           base class.  Read it, and remember it's type name as this
!          field's name. */
  
        new->field.type = read_type (pp, objfile);
        new->field.name = type_name_no_tag (new->field.type);
  
!       /* skip trailing ';' and bump count of number of fields seen */
        if (**pp == ';')
  	(*pp)++;
        else
--- 3026,3037 ----
  
        /* The last piece of baseclass information is the type of the
           base class.  Read it, and remember it's type name as this
!          field's name.  */
  
        new->field.type = read_type (pp, objfile);
        new->field.name = type_name_no_tag (new->field.type);
  
!       /* Skip trailing ';' and bump count of number of fields seen.  */
        if (**pp == ';')
  	(*pp)++;
        else
*************** read_tilde_fields (struct field_info *fi
*** 3043,3049 ****
  
    STABS_CONTINUE (pp, objfile);
  
!   /* If we are positioned at a ';', then skip it. */
    if (**pp == ';')
      {
        (*pp)++;
--- 3056,3062 ----
  
    STABS_CONTINUE (pp, objfile);
  
!   /* If we are positioned at a ';', then skip it.  */
    if (**pp == ';')
      {
        (*pp)++;
*************** read_tilde_fields (struct field_info *fi
*** 3056,3062 ****
        if (**pp == '=' || **pp == '+' || **pp == '-')
  	{
  	  /* Obsolete flags that used to indicate the presence
! 	     of constructors and/or destructors. */
  	  (*pp)++;
  	}
  
--- 3069,3075 ----
        if (**pp == '=' || **pp == '+' || **pp == '-')
  	{
  	  /* Obsolete flags that used to indicate the presence
! 	     of constructors and/or destructors.  */
  	  (*pp)++;
  	}
  
*************** read_tilde_fields (struct field_info *fi
*** 3085,3091 ****
  	    }
  
  	  TYPE_VPTR_BASETYPE (type) = t;
! 	  if (type == t)	/* Our own class provides vtbl ptr */
  	    {
  	      for (i = TYPE_NFIELDS (t) - 1;
  		   i >= TYPE_N_BASECLASSES (t);
--- 3098,3104 ----
  	    }
  
  	  TYPE_VPTR_BASETYPE (type) = t;
! 	  if (type == t)	/* Our own class provides vtbl ptr.  */
  	    {
  	      for (i = TYPE_NFIELDS (t) - 1;
  		   i >= TYPE_N_BASECLASSES (t);
*************** attach_fn_fields_to_type (struct field_i
*** 3126,3132 ****
         fip->fnlist != NULL;
         fip->fnlist = fip->fnlist->next)
      {
!       --n;			/* Circumvent Sun3 compiler bug */
        TYPE_FN_FIELDLISTS (type)[n] = fip->fnlist->fn_fieldlist;
      }
    return 1;
--- 3139,3145 ----
         fip->fnlist != NULL;
         fip->fnlist = fip->fnlist->next)
      {
!       --n;			/* Circumvent Sun3 compiler bug.  */
        TYPE_FN_FIELDLISTS (type)[n] = fip->fnlist->fn_fieldlist;
      }
    return 1;
*************** attach_fields_to_type (struct field_info
*** 3144,3153 ****
    int non_public_fields = 0;
    struct nextfield *scan;
  
!   /* Count up the number of fields that we have, as well as taking note of
!      whether or not there are any non-public fields, which requires us to
!      allocate and build the private_field_bits and protected_field_bits
!      bitfields. */
  
    for (scan = fip->list; scan != NULL; scan = scan->next)
      {
--- 3157,3166 ----
    int non_public_fields = 0;
    struct nextfield *scan;
  
!   /* Count up the number of fields that we have, as well as taking
!      note of whether or not there are any non-public fields, which
!      requires us to allocate and build the private_field_bits and
!      protected_field_bits bitfields.  */
  
    for (scan = fip->list; scan != NULL; scan = scan->next)
      {
*************** attach_fields_to_type (struct field_info
*** 3158,3166 ****
  	}
      }
  
!   /* Now we know how many fields there are, and whether or not there are any
!      non-public fields.  Record the field count, allocate space for the
!      array of fields, and create blank visibility bitfields if necessary. */
  
    TYPE_NFIELDS (type) = nfields;
    TYPE_FIELDS (type) = (struct field *)
--- 3171,3180 ----
  	}
      }
  
!   /* Now we know how many fields there are, and whether or not there
!      are any non-public fields.  Record the field count, allocate
!      space for the array of fields, and create blank visibility
!      bitfields if necessary.  */
  
    TYPE_NFIELDS (type) = nfields;
    TYPE_FIELDS (type) = (struct field *)
*************** attach_fields_to_type (struct field_info
*** 3184,3192 ****
        B_CLRALL (TYPE_FIELD_IGNORE_BITS (type), nfields);
      }
  
!   /* Copy the saved-up fields into the field vector.  Start from the head
!      of the list, adding to the tail of the field array, so that they end
!      up in the same order in the array in which they were added to the list. */
  
    while (nfields-- > 0)
      {
--- 3198,3207 ----
        B_CLRALL (TYPE_FIELD_IGNORE_BITS (type), nfields);
      }
  
!   /* Copy the saved-up fields into the field vector.  Start from the
!      head of the list, adding to the tail of the field array, so that
!      they end up in the same order in the array in which they were
!      added to the list.  */
  
    while (nfields-- > 0)
      {
*************** attach_fields_to_type (struct field_info
*** 3211,3217 ****
  	default:
  	  /* Unknown visibility.  Complain and treat it as public.  */
  	  {
! 	    complaint (&symfile_complaints, "Unknown visibility `%c' for field",
  		       fip->list->visibility);
  	  }
  	  break;
--- 3226,3233 ----
  	default:
  	  /* Unknown visibility.  Complain and treat it as public.  */
  	  {
! 	    complaint (&symfile_complaints, 
! 		       "Unknown visibility `%c' for field",
  		       fip->list->visibility);
  	  }
  	  break;
*************** complain_about_struct_wipeout (struct ty
*** 3257,3274 ****
  }
  
  
! /* Read the description of a structure (or union type) and return an object
!    describing the type.
  
!    PP points to a character pointer that points to the next unconsumed token
!    in the the stabs string.  For example, given stabs "A:T4=s4a:1,0,32;;",
!    *PP will point to "4a:1,0,32;;".
  
     TYPE points to an incomplete type that needs to be filled in.
  
!    OBJFILE points to the current objfile from which the stabs information is
!    being read.  (Note that it is redundant in that TYPE also contains a pointer
!    to this same objfile, so it might be a good idea to eliminate it.  FIXME). 
   */
  
  static struct type *
--- 3273,3291 ----
  }
  
  
! /* Read the description of a structure (or union type) and return an
!    object describing the type.
  
!    PP points to a character pointer that points to the next unconsumed
!    token in the the stabs string.  For example, given stabs
!    "A:T4=s4a:1,0,32;;", *PP will point to "4a:1,0,32;;".
  
     TYPE points to an incomplete type that needs to be filled in.
  
!    OBJFILE points to the current objfile from which the stabs
!    information is being read.  (Note that it is redundant in that TYPE
!    also contains a pointer to this same objfile, so it might be a good
!    idea to eliminate it.  FIXME).
   */
  
  static struct type *
*************** read_struct_type (char **pp, struct type
*** 3316,3325 ****
        return error_type (pp, objfile);
    }
  
!   /* Now read the baseclasses, if any, read the regular C struct or C++
!      class member fields, attach the fields to the type, read the C++
!      member functions, attach them to the type, and then read any tilde
!      field (baseclass specifier for the class holding the main vtable). */
  
    if (!read_baseclasses (&fi, pp, type, objfile)
        || !read_struct_fields (&fi, pp, type, objfile)
--- 3333,3343 ----
        return error_type (pp, objfile);
    }
  
!   /* Now read the baseclasses, if any, read the regular C struct or
!      C++ class member fields, attach the fields to the type, read the
!      C++ member functions, attach them to the type, and then read any
!      tilde field (baseclass specifier for the class holding the main
!      vtable).  */
  
    if (!read_baseclasses (&fi, pp, type, objfile)
        || !read_struct_fields (&fi, pp, type, objfile)
*************** read_sun_builtin_type (char **pp, int ty
*** 3569,3580 ****
    if (nbits != 0)
      return error_type (pp, objfile);
  
!   /* The second number is always 0, so ignore it too. */
    read_huge_number (pp, ';', &nbits, 0);
    if (nbits != 0)
      return error_type (pp, objfile);
  
!   /* The third number is the number of bits for this type. */
    type_bits = read_huge_number (pp, 0, &nbits, 0);
    if (nbits != 0)
      return error_type (pp, objfile);
--- 3587,3598 ----
    if (nbits != 0)
      return error_type (pp, objfile);
  
!   /* The second number is always 0, so ignore it too.  */
    read_huge_number (pp, ';', &nbits, 0);
    if (nbits != 0)
      return error_type (pp, objfile);
  
!   /* The third number is the number of bits for this type.  */
    type_bits = read_huge_number (pp, 0, &nbits, 0);
    if (nbits != 0)
      return error_type (pp, objfile);
*************** read_sun_floating_type (char **pp, int t
*** 3612,3618 ****
    if (nbits != 0)
      return error_type (pp, objfile);
  
!   /* The second number is the number of bytes occupied by this type */
    nbytes = read_huge_number (pp, ';', &nbits, 0);
    if (nbits != 0)
      return error_type (pp, objfile);
--- 3630,3636 ----
    if (nbits != 0)
      return error_type (pp, objfile);
  
!   /* The second number is the number of bytes occupied by this type.  */
    nbytes = read_huge_number (pp, ';', &nbits, 0);
    if (nbits != 0)
      return error_type (pp, objfile);
*************** read_huge_number (char **pp, int end, in
*** 3705,3718 ****
              {
                /* unsigned representation */
                n *= radix;
!               n += c - '0';		/* FIXME this overflows anyway */
              }
          }
        else
          overflow = 1;
  
        /* This depends on large values being output in octal, which is
!          what GCC does. */
        if (radix == 8)
  	{
  	  if (nbits == 0)
--- 3723,3736 ----
              {
                /* unsigned representation */
                n *= radix;
!               n += c - '0';		/* FIXME this overflows anyway.  */
              }
          }
        else
          overflow = 1;
  
        /* This depends on large values being output in octal, which is
!          what GCC does.  */
        if (radix == 8)
  	{
  	  if (nbits == 0)
*************** read_range_type (char **pp, int typenums
*** 3840,3848 ****
  	  got_unsigned = 1;
  	  nbits = n3bits;
  	}
!       /* Range from <large number> to <large number>-1 is a large signed
!          integral type.  Take care of the case where <large number> doesn't
!          fit in a long but <large number>-1 does.  */
        else if ((n2bits != 0 && n3bits != 0 && n2bits == n3bits + 1)
  	       || (n2bits != 0 && n3bits == 0
  		   && (n2bits == sizeof (long) * HOST_CHAR_BIT)
--- 3858,3866 ----
  	  got_unsigned = 1;
  	  nbits = n3bits;
  	}
!       /* Range from <large number> to <large number>-1 is a large
!          signed integral type.  Take care of the case where <large
!          number> doesn't fit in a long but <large number> -1 does.  */
        else if ((n2bits != 0 && n3bits != 0 && n2bits == n3bits + 1)
  	       || (n2bits != 0 && n3bits == 0
  		   && (n2bits == sizeof (long) * HOST_CHAR_BIT)
*************** read_range_type (char **pp, int typenums
*** 3876,3882 ****
  
       Also note that for complexes, g77 sets n2 to the size of one of
       the member floats, not the whole complex beast.  My guess is that
!      this was to work well with pre-COMPLEX versions of gdb. */
  
    if (n3 == 0 && n2 > 0)
      {
--- 3894,3900 ----
  
       Also note that for complexes, g77 sets n2 to the size of one of
       the member floats, not the whole complex beast.  My guess is that
!      this was to work well with pre-COMPLEX versions of gdb.  */
  
    if (n3 == 0 && n2 > 0)
      {
*************** handle_true_range:
*** 3983,3998 ****
    return (result_type);
  }
  
! /* Read in an argument list.  This is a list of types, separated by commas
!    and terminated with END.  Return the list of types read in, or (struct type
!    **)-1 if there is an error.  */
  
  static struct field *
! read_args (char **pp, int end, struct objfile *objfile, int *nargsp,
! 	   int *varargsp)
  {
    /* FIXME!  Remove this arbitrary limit!  */
!   struct type *types[1024];	/* allow for fns of 1023 parameters */
    int n = 0, i;
    struct field *rval;
  
--- 4001,4017 ----
    return (result_type);
  }
  
! /* Read in an argument list.  This is a list of types, separated by
!    commas and terminated with END.  Return the list of types read in,
!    or (struct type **) -1 if there is an error.  */
  
  static struct field *
! read_args (char **pp, int end, 
! 	   struct objfile *objfile, 
! 	   int *nargsp, int *varargsp)
  {
    /* FIXME!  Remove this arbitrary limit!  */
!   struct type *types[1024];	/* Allow for fns of 1023 parameters.  */
    int n = 0, i;
    struct field *rval;
  
*************** common_block_end (struct objfile *objfil
*** 4081,4087 ****
    sym = (struct symbol *)
      obstack_alloc (&objfile->objfile_obstack, sizeof (struct symbol));
    memset (sym, 0, sizeof (struct symbol));
!   /* Note: common_block_name already saved on objfile_obstack */
    DEPRECATED_SYMBOL_NAME (sym) = common_block_name;
    SYMBOL_CLASS (sym) = LOC_BLOCK;
  
--- 4100,4106 ----
    sym = (struct symbol *)
      obstack_alloc (&objfile->objfile_obstack, sizeof (struct symbol));
    memset (sym, 0, sizeof (struct symbol));
!   /* Note: common_block_name already saved on objfile_obstack.  */
    DEPRECATED_SYMBOL_NAME (sym) = common_block_name;
    SYMBOL_CLASS (sym) = LOC_BLOCK;
  
*************** cleanup_undefined_types (void)
*** 4182,4188 ****
  	      {
  		struct pending *ppt;
  		int i;
! 		/* Name of the type, without "struct" or "union" */
  		char *typename = TYPE_TAG_NAME (*type);
  
  		if (typename == NULL)
--- 4201,4207 ----
  	      {
  		struct pending *ppt;
  		int i;
! 		/* Name of the type, without "struct" or "union".  */
  		char *typename = TYPE_TAG_NAME (*type);
  
  		if (typename == NULL)
*************** scan_file_globals (struct objfile *objfi
*** 4276,4282 ****
  	  prev = NULL;
  
  	  /* Get the hash index and check all the symbols
! 	     under that hash index. */
  
  	  hash = hashname (DEPRECATED_SYMBOL_NAME (msymbol));
  
--- 4295,4301 ----
  	  prev = NULL;
  
  	  /* Get the hash index and check all the symbols
! 	     under that hash index.  */
  
  	  hash = hashname (DEPRECATED_SYMBOL_NAME (msymbol));
  
*************** scan_file_globals (struct objfile *objfi
*** 4286,4292 ****
  		  strcmp (DEPRECATED_SYMBOL_NAME (msymbol) + 1, DEPRECATED_SYMBOL_NAME (sym) + 1) == 0)
  		{
  		  /* Splice this symbol out of the hash chain and
! 		     assign the value we have to it. */
  		  if (prev)
  		    {
  		      SYMBOL_VALUE_CHAIN (prev) = SYMBOL_VALUE_CHAIN (sym);
--- 4305,4311 ----
  		  strcmp (DEPRECATED_SYMBOL_NAME (msymbol) + 1, DEPRECATED_SYMBOL_NAME (sym) + 1) == 0)
  		{
  		  /* Splice this symbol out of the hash chain and
! 		     assign the value we have to it.  */
  		  if (prev)
  		    {
  		      SYMBOL_VALUE_CHAIN (prev) = SYMBOL_VALUE_CHAIN (sym);
*************** scan_file_globals (struct objfile *objfi
*** 4361,4369 ****
    memset (global_sym_chain, 0, sizeof (global_sym_chain));
  }
  
! /* Initialize anything that needs initializing when starting to read
!    a fresh piece of a symbol file, e.g. reading in the stuff corresponding
!    to a psymtab.  */
  
  void
  stabsread_init (void)
--- 4380,4388 ----
    memset (global_sym_chain, 0, sizeof (global_sym_chain));
  }
  
! /* Initialize anything that needs initializing when starting to read a
!    fresh piece of a symbol file, e.g. reading in the stuff
!    corresponding to a psymtab.  */
  
  void
  stabsread_init (void)
*************** stabsread_new_init (void)
*** 4382,4388 ****
  }
  
  /* Initialize anything that needs initializing at the same time as
!    start_symtab() is called. */
  
  void
  start_stabs (void)
--- 4401,4407 ----
  }
  
  /* Initialize anything that needs initializing at the same time as
!    start_symtab() is called.  */
  
  void
  start_stabs (void)
*************** start_stabs (void)
*** 4393,4403 ****
    type_vector_length = 0;
    type_vector = (struct type **) 0;
  
!   /* FIXME: If common_block_name is not already NULL, we should complain().  */
    common_block_name = NULL;
  }
  
! /* Call after end_symtab() */
  
  void
  end_stabs (void)
--- 4412,4423 ----
    type_vector_length = 0;
    type_vector = (struct type **) 0;
  
!   /* FIXME: If common_block_name is not already NULL, we should
!      complain().  */
    common_block_name = NULL;
  }
  
! /* Call after end_symtab().  */
  
  void
  end_stabs (void)
*************** find_name_end (char *name)
*** 4448,4454 ****
      }
  }
  
! /* Initializer for this module */
  
  void
  _initialize_stabsread (void)
--- 4468,4474 ----
      }
  }
  
! /* Initializer for this module.  */
  
  void
  _initialize_stabsread (void)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]