So what is DXR? DXR is a smart code browser that works by using instrumented compilers to use what the compiler knows about the code to provide a database of the code. For C and C++ in particular, using an instrumented compiler is necessary, since it is the only reliable way to fix the issue of macros. Take, for instance,
RecursiveASTVistor in the Clang codebase. Most of the almost 1200 functions are defined via macros as opposed to in raw code; as a consequence, the doxygen output for this class is useless: as far as I can tell, there are only five methods I can override to visit AST nodes. On the other hand, DXR neatly tells me all of the methods that are defined, and can point me to the place where that function is defined (within the macro, of course).
The following is a list of known problems:
- Links occur at odd boundaries
- Some lines have id="l234"/> prepended
- Non-root installs (i.e., installing to http://dxr.mozilla.org/clang/) cause issues. Interestingly, refreshing the page often causes things to work.
- There is a long list of scrolling text when compiling code. Ignore it.
- HTML generation produces IndexErrors
- .csv files are created in the source directory and HTML code is generated.
- Inheritance searches don't match the full hierarchy, only one or two levels.