|< Day Day Up >|
The Linux Cross Reference (LXR) is a tool that is used to cross-reference various source modules that make up Firefox. LXR is hosted on a site external to Mozilla.
With LXR, and using a browser, you can access indexed and cross-referenced source code.
For more information about LXR, visit http://sourceforge.net/projects/lxr. LXR is available for a number of platforms and languages.
You should visit sourceforge.net to learn more about its work and to see what software is available.
Using LXR is relatively painless. Because LXR is indexed, it is much faster than any local disk-based search you might run. You could run Find, a GREP utility, or the Windows Find Files and search for certain text, but the sheer size of the source makes this approach time-consuming.
Instead, go to Mozilla's Developer pages (http://www.mozilla.org/developer/) and click the LXR link (see Figure 17.8).
Figure 17.8. Although I'm searching for text, I could also search for specific filenames or identifiers.
You can do a simple search quite easily. First, establish the search's starting point (such as the Mozilla root, which is the default). Then in the Text Search window, type the text to search for in this example, I searched for nsxreappdata. Finally, click Find.
LXR searches the code and displays a list of all the matching files (see Figure 17.9). For the term I searched for, LXR found 24 matches.
Figure 17.9. If you want to look at a file, just click the file's hyperlink in LXR.
Again, click the file you are interested in, and LXR displays the file formatted with hyperlinks on most identifiers (see Figure 17.10).
Figure 17.10. All the underlined terms in the source can be clicked to see cross-reference information for the item.
If you click the term you originally searched for, LXR displays the cross-reference (see Figure 17.11).
Figure 17.11. The cross-reference shows both where the identifier was defined and where it is used.
The capability to search the source quickly is a valuable tool, but the real value in LXR is the capability to cross-reference identifiers and other objects between all the files.
|< Day Day Up >|