On 12/06/2010 12:03 PM, Devang Patel wrote:> As I understand, you are not interested in 'how to use DIFactory'. Do you want > to know what are the fields of metadata to encode debug info for a local variable ? > That'd be > > !7 = metadata !{ > i32, ;; Tag (see below) > metadata, ;; Context > metadata, ;; Name > metadata, ;; Reference to file where defined > i32, ;; Line number where defined > metadata ;; Type descriptor > } > > > - > DevangCorrect: I'm not interested in 'how to use DIFactory', and yes, I do want to know what the fields of metadata encode in somewhat more detail. For example, I am struggling with the 'DW_TAG_subroutine_type' now. There is a field that is labeled: metadata, ;; Reference to array of member descriptors Now I figured out that this array contains the types of the formal parameters, but it also appears the first (and only the first) in the array is the returned value type of the function. Since LLVM supports functions that return multiple values (as does my language), and DW_TAG_subroutine_type implementation currently supports, at most, a single returned value, this might be a bug. Looking at the code in lib/CodeGen/AsmPrinter/DwarfDebug.cpp around line 1035, this does appear to be the case. thanks, bagel
On Mon, Dec 6, 2010 at 12:50 PM, Bagel <bagel99 at gmail.com> wrote:> On 12/06/2010 12:03 PM, Devang Patel wrote: > > As I understand, you are not interested in 'how to use DIFactory'. Do you > want > > to know what are the fields of metadata to encode debug info for a local > variable ? > > That'd be > > > > !7 = metadata !{ > > i32, ;; Tag (see below) > > metadata, ;; Context > > metadata, ;; Name > > metadata, ;; Reference to file where defined > > i32, ;; Line number where defined > > metadata ;; Type descriptor > > } > > > > > > - > > Devang > > Correct: I'm not interested in 'how to use DIFactory', and yes, I do want > to > know what the fields of metadata encode in somewhat more detail. > > For example, I am struggling with the 'DW_TAG_subroutine_type' now. There > is a > field that is labeled: > metadata, ;; Reference to array of member descriptors > Now I figured out that this array contains the types of the formal > parameters, > but it also appears the first (and only the first) in the array is the > returned > value type of the function. Since LLVM supports functions that return > multiple > values (as does my language), and DW_TAG_subroutine_type implementation > currently supports, at most, a single returned value, this might be a bug. > Looking at the code in lib/CodeGen/AsmPrinter/DwarfDebug.cpp around line > 1035, > this does appear to be the case. > > If you haven't already read the DWARF specification documents, then Irecommend looking at them if you're not going to be using DIFactory. You can find them here: http://dwarfstd.org/Download.php thanks, bagel> _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-- -- Talin -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101209/c33e6d4f/attachment.html>
On 12/09/2010 04:47 PM, Talin wrote:> If you haven't already read the DWARF specification documents, then I recommend > looking at them if you're not going to be using DIFactory. You can find them > here: http://dwarfstd.org/Download.php > -- > -- TalinI have 'looked' at them. I fear that probably the only people that understand them are the people that wrote them :-) And that still leaves the 'magic' that maps the metadata structures into DWARF information to be learned. Bagel
On Dec 6, 2010, at 12:50 PM, Bagel wrote:> On 12/06/2010 12:03 PM, Devang Patel wrote: >> As I understand, you are not interested in 'how to use DIFactory'. Do you want >> to know what are the fields of metadata to encode debug info for a local variable ? >> That'd be >> >> !7 = metadata !{ >> i32, ;; Tag (see below) >> metadata, ;; Context >> metadata, ;; Name >> metadata, ;; Reference to file where defined >> i32, ;; Line number where defined >> metadata ;; Type descriptor >> } >> >> >> - >> Devang > > Correct: I'm not interested in 'how to use DIFactory', and yes, I do want to know what the fields of metadata encode in somewhat more detail. > > For example, I am struggling with the 'DW_TAG_subroutine_type' now. There is a field that is labeled: > metadata, ;; Reference to array of member descriptors > Now I figured out that this array contains the types of the formal parameters, but it also appears the first (and only the first) in the array is the returned value type of the function. Since LLVM supports functions that return multiple values (as does my language), and DW_TAG_subroutine_type implementation currently supports, at most, a single returned value, this might be a bug. Looking at the code in lib/CodeGen/AsmPrinter/DwarfDebug.cpp around line 1035, this does appear to be the case.Indeed, it is a bug/missing feature. Please file a bugzilla PR to track this. One approach to solve this would be to use DIArray as return type in case of multiple return values. - Devang
On 12/10/2010 01:23 PM, Devang Patel wrote:> Indeed, it is a bug/missing feature. Please file a bugzilla PR to track this. One approach to solve this would be to use DIArray as return type in case of multiple return values. > > - > DevangDone. http://llvm.org/bugs/show_bug.cgi?id=8772 Bagel