iPhoneTools
This page is dedicated to a few
tools I wrote in order to make my life easier while developing for the iPhone/OSX architecture.
Even though many of these tools are specific for the iPhone, others are perfectly working
even in different Unix systems.
This is a memory block allocation tracing library, and it is described
inside the TraceAlloc home page.
This is a very simple tool that work with every symbol dump file
generated by the nm utility.
You pass it an nm symbol dump
file and a series of addresses, and nma2n
finds, for each address, the closest symbol.
To generate an nm symbol dump
file, given a binary or a dynamic library, you simply run:
$ nm -n BINPATH > SYMFILE
Then you can run the nma2n binary to find out which symbols map to a
set of addresses:
$ nma2n -f SYMFILE ADDR ...
The best way to build nma2n is
to run `make` and `sudo make install` from the iPhoneTools
directory.
This is a shell script that is used to extract the set of nm dump files from all relevant iPhone dynamic libraries.
The fill-nmdir.sh
script uses an
auxiliary script named frmk-nmexport.sh
that should be located in the same directory where fill-nmdir.sh is located.
The best way to use this tool is to create a directory inside your home
directory, and populate it using the fill-nmdir.sh
script.
$ mkdir ~/nmdumps
$ cd ~/nmdumps
$ $IPTDIR/fill-nmdir.sh $HEAVENLY
Where $IPTDIR is the path to
the iPhoneTools directory, and $HEAVENLY
is the path to your iPhone root file system.
This will create a number of .nmdump
files inside the current directory.
On top of those system .nmdump
files, you have to remember to drop inside the ~/nmdumps directory even the
current nmdump for your latest build of your application.
Suppose your application latest binary files is $BINPATH, and your application name
is $APP.app, you need to run:
$ nm -n $BINPATH/$APP.app >
~/nmdumps/$APP.nmdump
A failure to remember to update your application nmdump file, will lead
to incorrect symbol detection for symbols inside your application.
This is a utility tool that I use to demangle the cryptic iPhone crash dump files generated
inside the /var/logs/CrashReporter
directory.
Once the iPhoneTools are
correctly installed, given a CRASH.plist
file extracted from the iPhone,
you can get the demangled version by issuing:
$ cat CRASH.plist |
$IPTDIR/crash-demangle.pl -D ~/nmdumps
This Perl script is for the TraceAlloc
library, what crash-demangle.pl
is for the iPhone crashdump generator.
The TraceAlloc
library generate call traces that
contain library/binary names and addresses inside libraries/binaries.
By using memdmp-demangle.pl
you will be able to translate numeric addresses to function names:
$ cat MEMDUMP.mdmp |
$IPTDIR/memdmp-demangle.pl -D ~/nmdumps
The latest iPhoneTools source
package can be downloaded here:
iPhoneTools-0.3.tar.gz