Ejemplo n.º 1
0
//--------------------------------------------------------------------------
static bool find_module(ea_t ea, module_info_t *mi)
{
  bool ok;
  for ( ok=get_first_module(mi); ok; ok=get_next_module(mi) )
  {
    if ( area_t(mi->base, mi->base+mi->size).contains(ea) )
      break;
  }
  return ok;
}
Ejemplo n.º 2
0
void write_map_file( void )
{
    char *filename;
    FILE *file;
    SymbolHash *map_symtab;

    /* use first module filename to create global map file */
    filename = get_map_filename( get_first_module( NULL )->filename ); /* set '.map' extension */

    /* Create MAP file */
    file = myfopen( filename, "w" );           
	if (file)
	{
		if (opts.verbose)
			puts("Creating map...");

		/* BUG_0036, BUG_0051 */
		map_symtab = select_symbols(cond_all_symbols);

		if (SymbolHash_empty(map_symtab))
		{
			fputs("None.\n", file);
		}
		else
		{
			/* Write map symbols alphabetically */
			SymbolHash_sort(map_symtab, SymbolHash_by_name);
			write_map_syms(file, map_symtab);

			fputs("\n\n", file);

			/* Write map symbols numerically */
			SymbolHash_sort(map_symtab, SymbolHash_by_value);
			write_map_syms(file, map_symtab);
		}

		OBJ_DELETE(map_symtab);

		myfclose(file);
	}
}