contrib/gdb-7/gdb/linespec.c
static VEC (symbolp) *
find_function_symbols (char **argptr, char *p, int is_quote_enclosed,
		       char **user_function)
{
  char *p1;
  char *copy;
  VEC (symbolp) *result = NULL;

  p1 = p;
  while (p != *argptr && p[-1] == ' ')
    --p;
  if ((*p == '"') && is_quote_enclosed)
    --p;
  copy = (char *) xmalloc (p - *argptr + 1);
  *user_function = copy;
  memcpy (copy, *argptr, p - *argptr);
  /* It may have the ending quote right after the file name.  */
  if ((is_quote_enclosed && copy[p - *argptr - 1] == '"')
      || copy[p - *argptr - 1] == '\'')
    copy[p - *argptr - 1] = 0;
  else
    copy[p - *argptr] = 0;

  iterate_over_all_matching_symtabs (copy, VAR_DOMAIN,
				     collect_function_symbols, &result, NULL);

  if (VEC_empty (symbolp, result))
    VEC_free (symbolp, result);
  else
    {
      /* Discard the file name from the arg.  */
      *argptr = skip_spaces (p1 + 1);
    }

  return result;
}
/* Look up a function symbol in *ARGPTR.  If found, advance *ARGPTR
   and return the symbol.  If not found, return NULL.  */
Look up a function symbol in *ARGPTR.  If found, advance *ARGPTR
and return the symbol.  If not found, return NULL.
Look up a function symbol in * ARGPTR . If found advance * ARGPTR and return the symbol . If not found return NULL .
static VEC (symbolp) *
find_function_symbols (char **argptr, char *p, int is_quote_enclosed,
		       char **user_function)
{
  char *p1;
  char *copy;
  VEC (symbolp) *result = NULL;
  p1 = p;
  while (p != *argptr && p[-1] == ' ')
    --p;
  if ((*p == '"') && is_quote_enclosed)
    --p;
  copy = (char *) xmalloc (p - *argptr + 1);
  *user_function = copy;
  memcpy (copy, *argptr, p - *argptr);
  if ((is_quote_enclosed && copy[p - *argptr - 1] == '"')
      || copy[p - *argptr - 1] == '\'')
    copy[p - *argptr - 1] = 0;
  else
    copy[p - *argptr] = 0;
  iterate_over_all_matching_symtabs (copy, VAR_DOMAIN,
				     collect_function_symbols, &result, NULL);
  if (VEC_empty (symbolp, result))
    VEC_free (symbolp, result);
  else
    {
      *argptr = skip_spaces (p1 + 1);
    }
  return result;
}
static VEC ( symbolp ) * find_function_symbols ( char * * argptr , char * p , int is_quote_enclosed , char * * user_function ) { char * p1 ; char * copy ; VEC ( symbolp ) * result = NULL ; p1 = p ; while ( p != * argptr && p [ -1 ] == ' ' ) -- p ; if ( ( * p == ' ' ) && is_quote_enclosed ) -- p ; copy = ( char * ) xmalloc ( p - * argptr + 1 ) ; * user_function = copy ; memcpy ( copy , * argptr , p - * argptr ) ; if ( ( is_quote_enclosed && copy [ p - * argptr - 1 ] == ' ' ) || copy [ p - * argptr - 1 ] == ' \' ' ) copy [ p - * argptr - 1 ] = 0 ; else copy [ p - * argptr ] = 0 ; iterate_over_all_matching_symtabs ( copy , VAR_DOMAIN , collect_function_symbols , & result , NULL ) ; if ( VEC_empty ( symbolp , result ) ) VEC_free ( symbolp , result ) ; else { * argptr = skip_spaces ( p1 + 1 ) ; } return result ; }
Look up a function symbol in *ARGPTR.
Look up a function symbol in * ARGPTR .
/* It may have the ending quote right after the file name.  */ /* Discard the file name from the arg.  */