Can anyone share a bit experience of using DIBuilder class to add debug information to a certain language ?
Specifically, what does the “Subscripts” mean in the attributes of the function and what I need to supply for that in order to use this function:
[DICompositeType](http://llvm.org/docs/doxygen/html/classllvm_1_1DICompositeType.html) [DIBuilder::createArrayType](http://llvm.org/docs/doxygen/html/classllvm_1_1DIBuilder.html#a06b1c961b2ad918925e36e95415845b1)(uint64_t Size, uint64_t AlignInBits, [DIType](http://llvm.org/docs/doxygen/html/classllvm_1_1DIType.html) Ty, [DIArray](http://llvm.org/docs/doxygen/html/classllvm_1_1DITypedArray.html) Subscripts)
I don’t find any explanation on that and I’m trying to add debug info for an array type…
1. Can anyone share a bit experience of using DIBuilder class to add debug
information to a certain language ?
Probably - though a great source is the Clang frontend (just see how it
uses the various APIs) and http://llvm.org/docs/SourceLevelDebugging.html
which does describe subscripts in at least a little detail.
2. Specifically, what does the "Subscripts" mean in the attributes of the
function and what I need to supply for that in order to use this function:
DICompositeType <http://llvm.org/docs/doxygen/html/classllvm_1_1DICompositeType.html> DIBuilder::createArrayType <http://llvm.org/docs/doxygen/html/classllvm_1_1DIBuilder.html#a06b1c961b2ad918925e36e95415845b1>\(uint64_t Size, uint64_t AlignInBits, DIType <http://llvm.org/docs/doxygen/html/classllvm_1_1DIType.html> Ty, DIArray <http://llvm.org/docs/doxygen/html/classllvm_1_1DITypedArray.html> Subscripts)
To quote the above docs:
The members of array types (tag = DW_TAG_array_type) are *subrange
representing the range of subscripts at that level of indexing.
(so that tells you the "Subscripts" DIArray in "createArrayType" should be
subrange descriptors, which are...)
[...] descriptors [that] are used to define ranges of array subscripts for
an array *composite type*
low value defines the lower bounds typically zero for C/C++. The high value
is the upper bounds. Values are 64 bit. High - Low + 1 is the size of the
array. If Low > High the array bounds are not included in generated