Vivien Millet via llvm-dev
2019-Feb-05 21:40 UTC
[llvm-dev] [DebugInfo][DIBuilder] Good way to pass arguments to createClassType/createMemberType
Hi, I'm trying to use DIBuilder to build my debug info and export it into a PDB, but I don't understand the way some DIBuilder method work. My question might have a straightforward answer but I don't see it ... (and I can't find any example code using these methods anywhere). Indeed createClassType takes an "Elements" argument, and createMemberType takes a "Scope" argument. Like the "who's first, egg or hen", I don't know If I need to create my members first using le compilation unit as the scope, put them in an array and give them to createClassType Elements parameter. Or forget the Elements parameter, call createClassType first then give it as "Scope" of createMemberType.. Thanks ! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190205/df09ac70/attachment.html>
David Blaikie via llvm-dev
2019-Feb-06 18:24 UTC
[llvm-dev] [DebugInfo][DIBuilder] Good way to pass arguments to createClassType/createMemberType
A good rough rule of thumb here is "what would/does Clang do?" & it looks (to me, on a very cursory glance) like Clang mostly passes the unit's DIFile as the scope parameter for a member - so perhaps it's just ignored? not sure. On Tue, Feb 5, 2019 at 1:38 PM Vivien Millet via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi, > I'm trying to use DIBuilder to build my debug info and export it into a > PDB, but I don't understand the way some DIBuilder method work. > My question might have a straightforward answer but I don't see it ... > (and I can't find any example code using these methods anywhere). > Indeed createClassType takes an "Elements" argument, and createMemberType > takes a "Scope" argument. Like the "who's first, egg or hen", I don't know > If I need to create my members first using le compilation unit as the > scope, put them in an array and give them to createClassType Elements > parameter. Or forget the Elements parameter, call createClassType first > then give it as "Scope" of createMemberType.. > Thanks ! > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190206/e89199bc/attachment.html>
Adrian Prantl via llvm-dev
2019-Feb-06 18:26 UTC
[llvm-dev] [DebugInfo][DIBuilder] Good way to pass arguments to createClassType/createMemberType
At least for generating DWARF the scope of of a composite type member should be irrelevant since it will always be nested inside its parent. -- adrian> On Feb 6, 2019, at 10:24 AM, David Blaikie <dblaikie at gmail.com> wrote: > > A good rough rule of thumb here is "what would/does Clang do?" & it looks (to me, on a very cursory glance) like Clang mostly passes the unit's DIFile as the scope parameter for a member - so perhaps it's just ignored? not sure. > > On Tue, Feb 5, 2019 at 1:38 PM Vivien Millet via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote: > Hi, > I'm trying to use DIBuilder to build my debug info and export it into a PDB, but I don't understand the way some DIBuilder method work. > My question might have a straightforward answer but I don't see it ... (and I can't find any example code using these methods anywhere). > Indeed createClassType takes an "Elements" argument, and createMemberType takes a "Scope" argument. Like the "who's first, egg or hen", I don't know If I need to create my members first using le compilation unit as the scope, put them in an array and give them to createClassType Elements parameter. Or forget the Elements parameter, call createClassType first then give it as "Scope" of createMemberType.. > Thanks ! > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org> > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev <https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev>-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190206/c5657cce/attachment.html>