contrib/gdb-7/gdb/linespec.c
static void
iterate_over_all_matching_symtabs (const char *name,
				   const domain_enum domain,
				   int (*callback) (struct symbol *, void *),
				   void *data,
				   struct program_space *search_pspace)
{
  struct objfile *objfile;
  struct program_space *pspace;

  ALL_PSPACES (pspace)
  {
    if (search_pspace != NULL && search_pspace != pspace)
      continue;
    if (pspace->executing_startup)
      continue;

    set_current_program_space (pspace);

    ALL_OBJFILES (objfile)
    {
      struct symtab *symtab;

      if (objfile->sf)
	objfile->sf->qf->expand_symtabs_matching (objfile, NULL,
						  iterate_name_matcher,
						  ALL_DOMAIN,
						  &name);

      ALL_OBJFILE_SYMTABS (objfile, symtab)
	{
	  if (symtab->primary)
	    {
	      struct block *block;

	      block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab), STATIC_BLOCK);
	      LA_ITERATE_OVER_SYMBOLS (block, name, domain, callback, data);
	    }
	}
    }
  }
}
/* A helper that walks over all matching symtabs in all objfiles and
   calls CALLBACK for each symbol matching NAME.  If SEARCH_PSPACE is
   not NULL, then the search is restricted to just that program
   space.  */
A helper that walks over all matching symtabs in all objfiles and
calls CALLBACK for each symbol matching NAME.  If SEARCH_PSPACE is
not NULL, then the search is restricted to just that program
space.
A helper that walks over all matching symtabs in all objfiles and calls CALLBACK for each symbol matching NAME . If SEARCH_PSPACE is not NULL then the search is restricted to just that program space .
static void
iterate_over_all_matching_symtabs (const char *name,
				   const domain_enum domain,
				   int (*callback) (struct symbol *, void *),
				   void *data,
				   struct program_space *search_pspace)
{
  struct objfile *objfile;
  struct program_space *pspace;
  ALL_PSPACES (pspace)
  {
    if (search_pspace != NULL && search_pspace != pspace)
      continue;
    if (pspace->executing_startup)
      continue;
    set_current_program_space (pspace);
    ALL_OBJFILES (objfile)
    {
      struct symtab *symtab;
      if (objfile->sf)
	objfile->sf->qf->expand_symtabs_matching (objfile, NULL,
						  iterate_name_matcher,
						  ALL_DOMAIN,
						  &name);
      ALL_OBJFILE_SYMTABS (objfile, symtab)
	{
	  if (symtab->primary)
	    {
	      struct block *block;
	      block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab), STATIC_BLOCK);
	      LA_ITERATE_OVER_SYMBOLS (block, name, domain, callback, data);
	    }
	}
    }
  }
}
static void iterate_over_all_matching_symtabs ( const char * name , const domain_enum domain , int ( * callback ) ( struct symbol * , void * ) , void * data , struct program_space * search_pspace ) { struct objfile * objfile ; struct program_space * pspace ; ALL_PSPACES ( pspace ) { if ( search_pspace != NULL && search_pspace != pspace ) continue ; if ( pspace -> executing_startup ) continue ; set_current_program_space ( pspace ) ; ALL_OBJFILES ( objfile ) { struct symtab * symtab ; if ( objfile -> sf ) objfile -> sf -> qf -> expand_symtabs_matching ( objfile , NULL , iterate_name_matcher , ALL_DOMAIN , & name ) ; ALL_OBJFILE_SYMTABS ( objfile , symtab ) { if ( symtab -> primary ) { struct block * block ; block = BLOCKVECTOR_BLOCK ( BLOCKVECTOR ( symtab ) , STATIC_BLOCK ) ; LA_ITERATE_OVER_SYMBOLS ( block , name , domain , callback , data ) ; } } } } }
A helper that walks over all matching symtabs in all objfiles and
calls CALLBACK for each symbol matching NAME.
A helper that walks over all matching symtabs in all objfiles and calls CALLBACK for each symbol matching NAME .