⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 partial-stab.h

📁 早期freebsd实现
💻 H
📖 第 1 页 / 共 2 页
字号:
	case N_NBSTS:           /* Gould nobase.  */	case N_NBLCS:           /* symbols.  */	  SET_NAMESTRING();	  p = (char *) strchr (namestring, ':');	  /* Skip if there is no :.  */	  if (!p) continue;	  switch (p[1])	    {	    case 'T':	      if (p != namestring)	/* a name is there, not just :T... */		{		  ADD_PSYMBOL_TO_LIST (namestring, p - namestring,				       STRUCT_NAMESPACE, LOC_TYPEDEF,				       objfile->static_psymbols, CUR_SYMBOL_VALUE);		  if (p[2] == 't')		    {		      /* Also a typedef with the same name.  */		      ADD_PSYMBOL_TO_LIST (namestring, p - namestring,					   VAR_NAMESPACE, LOC_TYPEDEF,					   objfile->static_psymbols, CUR_SYMBOL_VALUE);		      p += 1;		    }		}	      goto check_enum;	    case 't':	      if (p != namestring)	/* a name is there, not just :T... */		{		  ADD_PSYMBOL_TO_LIST (namestring, p - namestring,				       VAR_NAMESPACE, LOC_TYPEDEF,				       objfile->static_psymbols, CUR_SYMBOL_VALUE);		}	    check_enum:	      /* If this is an enumerated type, we need to		 add all the enum constants to the partial symbol		 table.  This does not cover enums without names, e.g.		 "enum {a, b} c;" in C, but fortunately those are		 rare.  There is no way for GDB to find those from the		 enum type without spending too much time on it.  Thus		 to solve this problem, the compiler needs to put out separate		 constant symbols ('c' N_LSYMS) for enum constants in		 enums without names, or put out a dummy type.  */	      /* We are looking for something of the form		 <name> ":" ("t" | "T") [<number> "="] "e"		 {<constant> ":" <value> ","} ";".  */	      /* Skip over the colon and the 't' or 'T'.  */	      p += 2;	      /* This type may be given a number.  Also, numbers can come		 in pairs like (0,26).  Skip over it.  */	      while ((*p >= '0' && *p <= '9')		     || *p == '(' || *p == ',' || *p == ')'		     || *p == '=')		p++;	      if (*p++ == 'e')		{		  /* We have found an enumerated type.  */		  /* According to comments in read_enum_type		     a comma could end it instead of a semicolon.		     I don't know where that happens.		     Accept either.  */		  while (*p && *p != ';' && *p != ',')		    {		      char *q;		      /* Check for and handle cretinous dbx symbol name			 continuation!  */		      if (*p == '\\')			p = next_symbol_text ();		      /* Point to the character after the name			 of the enum constant.  */		      for (q = p; *q && *q != ':'; q++)			;		      /* Note that the value doesn't matter for			 enum constants in psymtabs, just in symtabs.  */		      ADD_PSYMBOL_TO_LIST (p, q - p,					   VAR_NAMESPACE, LOC_CONST,					   objfile->static_psymbols, 0);		      /* Point past the name.  */		      p = q;		      /* Skip over the value.  */		      while (*p && *p != ',')			p++;		      /* Advance past the comma.  */		      if (*p)			p++;		    }		}	      continue;	    case 'c':	      /* Constant, e.g. from "const" in Pascal.  */	      ADD_PSYMBOL_TO_LIST (namestring, p - namestring,				   VAR_NAMESPACE, LOC_CONST,				   objfile->static_psymbols, CUR_SYMBOL_VALUE);	      continue;	    default:	      /* Skip if the thing following the : is	         not a letter (which indicates declaration of a local	         variable, which we aren't interested in).  */	      continue;	    }	case N_FUN:	case N_GSYM:		/* Global (extern) variable; can be				   data or bss (sigh FIXME).  */	/* Following may probably be ignored; I'll leave them here	   for now (until I do Pascal and Modula 2 extensions).  */	case N_PC:		/* I may or may not need this; I				   suspect not.  */	case N_M2C:		/* I suspect that I can ignore this here. */	case N_SCOPE:		/* Same.   */	  SET_NAMESTRING();	  p = (char *) strchr (namestring, ':');	  if (!p)	    continue;		/* Not a debugging symbol.   */	  /* Main processing section for debugging symbols which	     the initial read through the symbol tables needs to worry	     about.  If we reach this point, the symbol which we are	     considering is definitely one we are interested in.	     p must also contain the (valid) index into the namestring	     which indicates the debugging type symbol.  */	  switch (p[1])	    {	    case 'c':	      ADD_PSYMBOL_TO_LIST (namestring, p - namestring,				   VAR_NAMESPACE, LOC_CONST,				   objfile->static_psymbols, CUR_SYMBOL_VALUE);	      continue;	    case 'S':	      CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_DATA);	      ADD_PSYMBOL_ADDR_TO_LIST (namestring, p - namestring,				   VAR_NAMESPACE, LOC_STATIC,				   objfile->static_psymbols, CUR_SYMBOL_VALUE);	      continue;	    case 'G':	      CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_DATA);	      /* The addresses in these entries are reported to be		 wrong.  See the code that reads 'G's for symtabs. */	      ADD_PSYMBOL_ADDR_TO_LIST (namestring, p - namestring,				   VAR_NAMESPACE, LOC_STATIC,				   objfile->global_psymbols, CUR_SYMBOL_VALUE);	      continue;	    case 't':	      ADD_PSYMBOL_TO_LIST (namestring, p - namestring,				   VAR_NAMESPACE, LOC_TYPEDEF,				   objfile->static_psymbols, CUR_SYMBOL_VALUE);	      continue;	    case 'f':#ifdef DBXREAD_ONLY	      /* Kludges for ELF/STABS with Sun ACC */	      last_function_name = namestring;	      if (pst && pst->textlow == 0)		pst->textlow = CUR_SYMBOL_VALUE;#if 0	      if (startup_file_end == 0)		startup_file_end = CUR_SYMBOL_VALUE;#endif	      /* End kludge.  */#endif /* DBXREAD_ONLY */	      ADD_PSYMBOL_TO_LIST (namestring, p - namestring,				   VAR_NAMESPACE, LOC_BLOCK,				   objfile->static_psymbols, CUR_SYMBOL_VALUE);	      continue;	      /* Global functions were ignored here, but now they	         are put into the global psymtab like one would expect.		 They're also in the misc fn vector... 		 FIXME, why did it used to ignore these?  That broke		 "i fun" on these functions.  */	    case 'F':#ifdef DBXREAD_ONLY	      /* Kludges for ELF/STABS with Sun ACC */	      last_function_name = namestring;	      if (pst && pst->textlow == 0)		pst->textlow = CUR_SYMBOL_VALUE;#if 0	      if (startup_file_end == 0)		startup_file_end = CUR_SYMBOL_VALUE;#endif	      /* End kludge.  */#endif /* DBXREAD_ONLY */	      ADD_PSYMBOL_TO_LIST (namestring, p - namestring,				   VAR_NAMESPACE, LOC_BLOCK,				   objfile->global_psymbols, CUR_SYMBOL_VALUE);	      continue;	      /* Two things show up here (hopefully); static symbols of		 local scope (static used inside braces) or extensions		 of structure symbols.  We can ignore both.  */	    case 'V':	    case '(':	    case '0':	    case '1':	    case '2':	    case '3':	    case '4':	    case '5':	    case '6':	    case '7':	    case '8':	    case '9':	      continue;	    default:	      /* Unexpected symbol.  Ignore it; perhaps it is an extension		 that we don't know about.		 Someone says sun cc puts out symbols like		 /foo/baz/maclib::/usr/local/bin/maclib,		 which would get here with a symbol type of ':'.  */	      continue;	    }	case N_EXCL:#ifdef DBXREAD_ONLY	  SET_NAMESTRING();	  /* Find the corresponding bincl and mark that psymtab on the	     psymtab dependency list */	  {	    struct partial_symtab *needed_pst =	      find_corresponding_bincl_psymtab (namestring, CUR_SYMBOL_VALUE);	    /* If this include file was defined earlier in this file,	       leave it alone.  */	    if (needed_pst == pst) continue;	    if (needed_pst)	      {		int i;		int found = 0;		for (i = 0; i < dependencies_used; i++)		  if (dependency_list[i] == needed_pst)		    {		      found = 1;		      break;		    }		/* If it's already in the list, skip the rest.  */		if (found) continue;		dependency_list[dependencies_used++] = needed_pst;		if (dependencies_used >= dependencies_allocated)		  {		    struct partial_symtab **orig = dependency_list;		    dependency_list =		      (struct partial_symtab **)			alloca ((dependencies_allocated *= 2)				* sizeof (struct partial_symtab *));		    memcpy ((PTR)dependency_list, (PTR)orig,			   (dependencies_used			    * sizeof (struct partial_symtab *)));#ifdef DEBUG_INFO		    fprintf (stderr, "Had to reallocate dependency list.\n");		    fprintf (stderr, "New dependencies allocated: %d\n",			     dependencies_allocated);#endif		  }	      }	    else	      error ("Invalid symbol data: \"repeated\" header file not previously seen, at symtab pos %d.",		     symnum);	  }#endif /* DBXREAD_ONLY */	  continue;	case N_RBRAC:#ifdef HANDLE_RBRAC	  HANDLE_RBRAC(CUR_SYMBOL_VALUE);	  continue;#endif	case N_EINCL:	case N_DSLINE:	case N_BSLINE:	case N_SSYM:		/* Claim: Structure or union element.				   Hopefully, I can ignore this.  */	case N_ENTRY:		/* Alternate entry point; can ignore. */	case N_MAIN:		/* Can definitely ignore this.   */	case N_CATCH:		/* These are GNU C++ extensions */	case N_EHDECL:		/* that can safely be ignored here. */	case N_LENG:	case N_BCOMM:	case N_ECOMM:	case N_ECOML:	case N_FNAME:	case N_SLINE:	case N_RSYM:	case N_PSYM:	case N_LBRAC:	case N_NSYMS:		/* Ultrix 4.0: symbol count */	case N_DEFD:		/* GNU Modula-2 */	case N_OBJ:		/* useless types from Solaris */	case N_OPT:	case N_ENDM:	  /* These symbols aren't interesting; don't worry about them */	  continue;	default:	  /* If we haven't found it yet, ignore it.  It's probably some	     new type we don't know about yet.  */	  complain (&unknown_symtype_complaint, local_hex_string(CUR_SYMBOL_TYPE));	  continue;	}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -