February 2008 Archives

Snooping around the frameworks

| | Comments (2) | TrackBacks (0)
Uncharted Frameworks
If you go to your iPhone file system, and look in the directory /System/Library/Frameworks, you'll see a  list of the different frameworks available for iPhone programming.  For ones that are mainly in ObjC (e.g. UIKit, etc), you can find a listing of all the methods on sites like Erica Sadun's. 

For Frameworks that are mainly in C (or C++), assuming there is no available listing somewhere on the Internet, you will have to snoop to discover the method names. 

Here are a few tools that you can use on the binaries within these folders to see what they contain.  These are run from your personal computer, and should be available after you install the toolchain. 
  • arm-apple-darwin-nm : this will print out a list of symbols
  • arm-apple-darwin-otool : this will (among other things) print out a disassembly
  • strings : this will print out the strings in the binary
Example of use:
(I'm on Windows, so I use cygwin for the prompt.)
$ cd /usr/local/share/iphone-filesystem/System/Library/Frameworks/AudioToolbox.framework
$ arm-apple-darwin-nm AudioToolbox > AudioToolboxSymbols.txt
This will put the symbols of the AudioToolbox framework into a new file called AudioToolboxSymbols.txt.

Mangled names
When you look at the raw list of symbols, some of the method names may look garbled.  That's because they are "mangled"...this ensures that every method has a unique name.
Mangled C names will often be preceeded with an underscore. 
Mangled C++ names will look something like this:
__ZN24MeCCA_AudioRoutingPolicy16setRoutingPolicyEPKc

The unmangled version would be:
MeCCA_AudioRoutingPolicy::setRoutingPolicy(char const*)

If you want to unmangle the names in the symbols text file you just created, you can use a command called c++filt
Example of usage:
$ c++filt < MySymbolsFile.txt > MyUnmangledSymbolsFile.txt










Audio dependencies

| | Comments (0) | TrackBacks (0)
Here is a graph of the relationship between audio frameworks on the iPhone.  (Courtesy of Samuel Vinson)

dependencies.png






About this Archive

This page is an archive of entries from February 2008 listed from newest to oldest.

January 2008 is the previous archive.

March 2008 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Categories

Pages

Powered by Movable Type 4.1-en-release-26-r1120-20071224