Spotlights

This is a collection of Spotlight importers I have built.

Forth Spotlighter

This spotlight will index all Forth source code of text files with the following extensions:

fo of fs fas 4th fth

Installation

To install, simply drop the bundle into your Library/Spotlight/ folder.

Modifications
The default extensions can be changed by editing the Info.plist embdded in the importer.  Change the CFBundleTypeExtensions and the public.filename-extensions accordingly and make sure they match. DO NOT change any other settings or it may blow up.

To reindex, execute 

mdimport -r $HOME/Library/Spotlight/Forth\ Spotlighter.mdimporter

Object File Spotlight

Coming Soon!

This spotlight will find all the exported and imported symbols from library object files. It will collect the information from the following file extensions.

.o .a .dylib

From the command line you can search for symbols using the mdfind command. For example, your trying to compile a project and are notified undefined symbol _get_segprot_from_flag. To locate the object file the symbol is located in you could enter the following command.

mdfind 'com_polymicrosystems_objectfile_export_symbols = _get_segprot_from_flag'

and volia!

/Volumes/leopard/Sources/XCode/Spotlights/LibSpotlight/Test/test.o

You can see the exported symbols with the mdls command (or of course the nm command)

mdls -name com_polymicrosystems_objectfile_export_symbols test.o

com_polymicrosystems_objectfile_export_symbols = (
    "_force_cpusubtype_ALL_for_cputype",
    "_force_cpusubtype_ALL_for_cputype.eh",
    "_get_arch_family_from_cputype",
    "_get_arch_family_from_cputype.eh",
    "_get_arch_flags",
    "_get_arch_flags.eh",
    "_get_arch_from_flag",
    "_get_arch_from_flag.eh",
    "_get_arch_name_from_types",
    "_get_arch_name_from_types.eh",
    "_get_byte_sex_from_flag",
    "_get_byte_sex_from_flag.eh",
    "_get_segalign_from_flag",
    "_get_segalign_from_flag.eh",
    "_get_segprot_from_flag",
    "_get_segprot_from_flag.eh",
    "_get_shared_region_size_from_flag",
)

Included, is an application to quickly locate symbols and display which object files they are located in.

© 2005 PolyMicro Systems, All Rights Reserved