Viewing Source



When you click on a source file icon in a stack backtrace, OmniObjectAlloc will attempt to contact ProjectBuilder and request that it display the relevant line of source code. The Mach-O debugging format (and probably most others) only specify the filename of the source file and not the directory. Thus, OmniObjectAlloc needs a list of directories to search for source code (just like GDB does).

To simplify the lives of developers, OmniObjectAlloc will look in the directory containing the PB.project for a .gdbinit file. OOA does not know how to generally parse these files, but it makes its best attempt. Currently is understands dir, directory and source commands. Paths may be absolote or relative. Currently all relative paths are interpreted as being relative to the project directory. This includes directories that are found by sourceing gdb initialization files that are not in the current directory. Additionally, paths to gdb initialization files are also relative to the project directory. I'm not currently certain that this is what gdb does. If you run into problems with this, please let me know.

If you have source directories listed in the ProjectBuilder Launch Options panel, OOA will append these to the list of directories determined from the gdb initialization files.

ProjectBuilder version

Different versions of ProjectBuilder seem to react to the request to display source differently. The line of the file that is selected may be off by one (unless you have edited the file since performing a build, in which case it could be off by any amount). In particular, it seems that the Rhapsody/RDR and OpenStep/Mach ProjectBuilders may react differently here. Or, I may just have a bug in my symbol reading code. If you run into any reproducible problems with this, please let me know.

One problem that I know for certain is that under the Rhapsody/RDR or WOF3.5 versions of ProjectBuilder, if you don't have the PB.project open for that project, ProjectBuilder will ignore the request to display that line of source. I'm not sure if this is a bug or a feature, but it is worth noting. Simply open the relevant project and hit the source icon again and all should be well.