contrib/gdb-7/gdb/linespec.c
static void
search_minsyms_for_name (struct collect_info *info, const char *name,
			 struct program_space *search_pspace)
{
  struct objfile *objfile;
  struct program_space *pspace;

  ALL_PSPACES (pspace)
  {
    struct collect_minsyms local;
    struct cleanup *cleanup;

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

    set_current_program_space (pspace);

    memset (&local, 0, sizeof (local));
    local.funfirstline = info->state->funfirstline;
    local.list_mode = info->state->list_mode;

    cleanup = make_cleanup (VEC_cleanup (minsym_and_objfile_d),
			    &local.msyms);

    ALL_OBJFILES (objfile)
    {
      local.objfile = objfile;
      iterate_over_minimal_symbols (objfile, name, add_minsym, &local);
    }

    if (!VEC_empty (minsym_and_objfile_d, local.msyms))
      {
	int classification;
	int ix;
	minsym_and_objfile_d *item;

	qsort (VEC_address (minsym_and_objfile_d, local.msyms),
	       VEC_length (minsym_and_objfile_d, local.msyms),
	       sizeof (minsym_and_objfile_d),
	       compare_msyms);

	/* Now the minsyms are in classification order.  So, we walk
	   over them and process just the minsyms with the same
	   classification as the very first minsym in the list.  */
	item = VEC_index (minsym_and_objfile_d, local.msyms, 0);
	classification = classify_mtype (MSYMBOL_TYPE (item->minsym));

	for (ix = 0;
	     VEC_iterate (minsym_and_objfile_d, local.msyms, ix, item);
	     ++ix)
	  {
	    if (classify_mtype (MSYMBOL_TYPE (item->minsym)) != classification)
	      break;

	    minsym_found (info->state, item->objfile, item->minsym,
			  &info->result);
	  }
      }

    do_cleanups (cleanup);
  }
}
/* Search minimal symbols in all objfiles for NAME.  If SEARCH_PSPACE
   is not NULL, the search is restricted to just that program
   space.  */
Search minimal symbols in all objfiles for NAME.  If SEARCH_PSPACE
is not NULL, the search is restricted to just that program
space.
Search minimal symbols in all objfiles for NAME . If SEARCH_PSPACE is not NULL the search is restricted to just that program space .
static void
search_minsyms_for_name (struct collect_info *info, const char *name,
			 struct program_space *search_pspace)
{
  struct objfile *objfile;
  struct program_space *pspace;
  ALL_PSPACES (pspace)
  {
    struct collect_minsyms local;
    struct cleanup *cleanup;
    if (search_pspace != NULL && search_pspace != pspace)
      continue;
    if (pspace->executing_startup)
      continue;
    set_current_program_space (pspace);
    memset (&local, 0, sizeof (local));
    local.funfirstline = info->state->funfirstline;
    local.list_mode = info->state->list_mode;
    cleanup = make_cleanup (VEC_cleanup (minsym_and_objfile_d),
			    &local.msyms);
    ALL_OBJFILES (objfile)
    {
      local.objfile = objfile;
      iterate_over_minimal_symbols (objfile, name, add_minsym, &local);
    }
    if (!VEC_empty (minsym_and_objfile_d, local.msyms))
      {
	int classification;
	int ix;
	minsym_and_objfile_d *item;
	qsort (VEC_address (minsym_and_objfile_d, local.msyms),
	       VEC_length (minsym_and_objfile_d, local.msyms),
	       sizeof (minsym_and_objfile_d),
	       compare_msyms);
	item = VEC_index (minsym_and_objfile_d, local.msyms, 0);
	classification = classify_mtype (MSYMBOL_TYPE (item->minsym));
	for (ix = 0;
	     VEC_iterate (minsym_and_objfile_d, local.msyms, ix, item);
	     ++ix)
	  {
	    if (classify_mtype (MSYMBOL_TYPE (item->minsym)) != classification)
	      break;
	    minsym_found (info->state, item->objfile, item->minsym,
			  &info->result);
	  }
      }
    do_cleanups (cleanup);
  }
}
static void search_minsyms_for_name ( struct collect_info * info , const char * name , struct program_space * search_pspace ) { struct objfile * objfile ; struct program_space * pspace ; ALL_PSPACES ( pspace ) { struct collect_minsyms local ; struct cleanup * cleanup ; if ( search_pspace != NULL && search_pspace != pspace ) continue ; if ( pspace -> executing_startup ) continue ; set_current_program_space ( pspace ) ; memset ( & local , 0 , sizeof ( local ) ) ; local . funfirstline = info -> state -> funfirstline ; local . list_mode = info -> state -> list_mode ; cleanup = make_cleanup ( VEC_cleanup ( minsym_and_objfile_d ) , & local . msyms ) ; ALL_OBJFILES ( objfile ) { local . objfile = objfile ; iterate_over_minimal_symbols ( objfile , name , add_minsym , & local ) ; } if ( ! VEC_empty ( minsym_and_objfile_d , local . msyms ) ) { int classification ; int ix ; minsym_and_objfile_d * item ; qsort ( VEC_address ( minsym_and_objfile_d , local . msyms ) , VEC_length ( minsym_and_objfile_d , local . msyms ) , sizeof ( minsym_and_objfile_d ) , compare_msyms ) ; item = VEC_index ( minsym_and_objfile_d , local . msyms , 0 ) ; classification = classify_mtype ( MSYMBOL_TYPE ( item -> minsym ) ) ; for ( ix = 0 ; VEC_iterate ( minsym_and_objfile_d , local . msyms , ix , item ) ; ++ ix ) { if ( classify_mtype ( MSYMBOL_TYPE ( item -> minsym ) ) != classification ) break ; minsym_found ( info -> state , item -> objfile , item -> minsym , & info -> result ) ; } } do_cleanups ( cleanup ) ; } }
Search minimal symbols in all objfiles for NAME.
Search minimal symbols in all objfiles for NAME .
/* Now the minsyms are in classification order.  So, we walk
	   over them and process just the minsyms with the same
	   classification as the very first minsym in the list.  */