Add a new way to bind a format to a type: by enum type
authorEnrico Granata <egranata@apple.com>
Sat, 28 Dec 2013 08:44:02 +0000 (08:44 +0000)
committerEnrico Granata <egranata@apple.com>
Sat, 28 Dec 2013 08:44:02 +0000 (08:44 +0000)
commit30f287fde5b1e4d871726dccd0aad5913917f4f0
treee5897c00d57db3da41508fff19955a4cf2dab98e
parentffd810525de92bed4d8d197fd3f73fc1897ea0c6
Add a new way to bind a format to a type: by enum type
The "type format add" command gets a new flag --type (-t). If you pass -t <sometype>, upon fetching the value for an object of your type,
LLDB will display it as-if it was of enumeration type <sometype>
This is useful in cases of non-contiguous enums where there are empty gaps of unspecified values, and as such one cannot type their variables as the enum type,
but users would still like to see them as-if they were of the enum type (e.g. DWARF field types with their user-reserved ranges)

The SB API has also been improved to handle both types of formats, and a test case is added

llvm-svn: 198105
lldb/include/lldb/API/SBTypeFormat.h
lldb/include/lldb/DataFormatters/TypeFormat.h
lldb/scripts/Python/interface/SBTypeFormat.i
lldb/source/API/SBTypeFormat.cpp
lldb/source/Commands/CommandObjectType.cpp
lldb/source/Core/ValueObject.cpp
lldb/source/DataFormatters/FormatManager.cpp
lldb/source/DataFormatters/TypeFormat.cpp
lldb/test/functionalities/data-formatter/data-formatter-enum-format/Makefile [new file with mode: 0644]
lldb/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py [new file with mode: 0644]
lldb/test/functionalities/data-formatter/data-formatter-enum-format/main.cpp [new file with mode: 0644]