[cfe-dev] lldb data formatters for clang classes

Argyrios Kyrtzidis kyrtzidis at apple.com
Fri Nov 9 15:14:12 PST 2012


FYI, I added "utils/ClangDataFormat.py" which can be used to display clang classes (initially just SourceLocation) in a more user-friendly format from inside lldb, for example:

(lldb) p Tok.Loc
(clang::SourceLocation) $0 = {
  (unsigned int) ID = 123582
}

becomes:

(lldb) p Tok.Loc
(clang::SourceLocation) $4 = "/usr/include/i386/_types.h:37:1" (offset: 123582, file)


This works both in command-line and inside Xcode. Note that it depends on r167629.
To enable it import this file in your ~/.lldbinit by adding this line:

command script import /path/to/ClangDataFormat.py

-Argyrios



More information about the cfe-dev mailing list