contrib/gdb-7/gdb/linespec.c
static void
add_sal_to_sals (struct linespec_state *self,
		 struct symtabs_and_lines *sals,
		 struct symtab_and_line *sal,
		 const char *symname)
{
  add_sal_to_sals_basic (sals, sal);

  if (self->canonical)
    {
      char *canonical_name = NULL;

      self->canonical_names = xrealloc (self->canonical_names,
					sals->nelts * sizeof (char *));
      if (sal->symtab && sal->symtab->filename)
	{
	  char *filename = sal->symtab->filename;

	  /* Note that the filter doesn't have to be a valid linespec
	     input.  We only apply the ":LINE" treatment to Ada for
	     the time being.  */
	  if (symname != NULL && sal->line != 0
	      && current_language->la_language == language_ada)
	    canonical_name = xstrprintf ("%s:%s:%d", filename, symname,
					 sal->line);
	  else if (symname != NULL)
	    canonical_name = xstrprintf ("%s:%s", filename, symname);
	  else
	    canonical_name = xstrprintf ("%s:%d", filename, sal->line);
	}

      self->canonical_names[sals->nelts - 1] = canonical_name;
    }
}
/* Add SAL to SALS, and also update SELF->CANONICAL_NAMES to reflect
   the new sal, if needed.  If not NULL, SYMNAME is the name of the
   symbol to use when constructing the new canonical name.  */
Add SAL to SALS, and also update SELF->CANONICAL_NAMES to reflect
the new sal, if needed.  If not NULL, SYMNAME is the name of the
symbol to use when constructing the new canonical name.
Add SAL to SALS and also update SELF - > CANONICAL_NAMES to reflect the new sal if needed . If not NULL SYMNAME is the name of the symbol to use when constructing the new canonical name .
static void
add_sal_to_sals (struct linespec_state *self,
		 struct symtabs_and_lines *sals,
		 struct symtab_and_line *sal,
		 const char *symname)
{
  add_sal_to_sals_basic (sals, sal);
  if (self->canonical)
    {
      char *canonical_name = NULL;
      self->canonical_names = xrealloc (self->canonical_names,
					sals->nelts * sizeof (char *));
      if (sal->symtab && sal->symtab->filename)
	{
	  char *filename = sal->symtab->filename;
	  if (symname != NULL && sal->line != 0
	      && current_language->la_language == language_ada)
	    canonical_name = xstrprintf ("%s:%s:%d", filename, symname,
					 sal->line);
	  else if (symname != NULL)
	    canonical_name = xstrprintf ("%s:%s", filename, symname);
	  else
	    canonical_name = xstrprintf ("%s:%d", filename, sal->line);
	}
      self->canonical_names[sals->nelts - 1] = canonical_name;
    }
}
static void add_sal_to_sals ( struct linespec_state * self , struct symtabs_and_lines * sals , struct symtab_and_line * sal , const char * symname ) { add_sal_to_sals_basic ( sals , sal ) ; if ( self -> canonical ) { char * canonical_name = NULL ; self -> canonical_names = xrealloc ( self -> canonical_names , sals -> nelts * sizeof ( char * ) ) ; if ( sal -> symtab && sal -> symtab -> filename ) { char * filename = sal -> symtab -> filename ; if ( symname != NULL && sal -> line != 0 && current_language -> la_language == language_ada ) canonical_name = xstrprintf ( " " , filename , symname , sal -> line ) ; else if ( symname != NULL ) canonical_name = xstrprintf ( " " , filename , symname ) ; else canonical_name = xstrprintf ( " " , filename , sal -> line ) ; } self -> canonical_names [ sals -> nelts - 1 ] = canonical_name ; } }
Add SAL to SALS, and also update SELF->CANONICAL_NAMES to reflect
the new sal, if needed.
Add SAL to SALS and also update SELF - > CANONICAL_NAMES to reflect the new sal if needed .
/* Note that the filter doesn't have to be a valid linespec
	     input.  We only apply the ":LINE" treatment to Ada for
	     the time being.  */