Creating a Document


For the purposes of this documentation, we will assume that you are using the example application that comes with OmniObjectAlloc. To get access to this example code, start OOA and select 'Example Code ...' under the Apple menu. This will copy an example application into your temporary directory and display the resulting files in Workspace.

Open the copy of the PB.project in the sample code in ProjectBuilder. Build the application by clicking on the Build Panel button from the toolbar and then clicking on the Build button on the Build Panel. If you are building on OpenStep 4.2/Mach, you will need to comment out the '#define MACOS_X' line in OOAInternalRefCountExample.m. Under MacOS X Server, you should not need to make any changes.

Once you have successfully compiled the application, you can create an ObjectObjectAlloc document. Select Document->New from the menu. A new document window will appear and you will be prompted to select the executable file you want to debug. Select the executable (in /tmp/OOAExample/OOAExample.app/OOAExample) and hit 'OK'. Then save your OOA document to preserve your settings.

If all has gone well, you will be presented with a panel like the following (sans data):


This panel contains an overview of the information that OmniObjectAlloc collects about the application. To start running your application under OOA, press the 'Start' button located in the upper-right corner of the document window. Likewise, to stop your application, press the 'Stop' button. In the example above, the application is already running, so the 'Start' aspect of the Start/Stop button is not visible.

The top pane in the window shows information about the launch of the application and output from the application itself as it runs.

The middle pane displays a list of the classes in the application and summary allocation statisics about each of these classes. The information in this table may be sorted by selecting a column heading. The plus/minus button above the scroller on the class table allows you to customize the columns that are displayed in the table.

The bottom pane contains detail information about the selected class in the middle pane. The left most table contains a list of the hexidecimal addresses of all currently allocated instances of the selected class. If the 'Forget Deallocated Objects' checkbox is not checked, this table will also display addresses for objects that have been deallocated while this setting is in effect. Deallocated objects are displayed in red. When an object is deallocated, the memory that was previously occupied by that object may be reused. Deallocated object entries therefore also display a version number. This table also displays the size of the block and the zone in which is was allocated. The plus/minus button above the scroller on the object table allows you to customize the columns that are displayed.

When an object entry is selected, the middle table will display a list of allocation events associated with that object. These coorespond to roughly to allocation of the object, retain, release and autorelease and finally deallocation.

Finally, when an allocation event is selected, a symbolic stack trace is displayed in the right-most table. A file icon will be display in any frames for which file and line number information is available. Clicking on the icon will open the source in ProjectBuilder.