Checking validity of metadata in an .ll file

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Checking validity of metadata in an .ll file

Seb-22
Hi all,

I was wondering if there is a way to check that metadata emitted in an LLVM file are corrects with respect to debug informations.
My problem is that I emit 'metadata' in an .ll file and then using 'llc' there is no debug information emitted in final assembly.
For now I limit metadata to routines/subprogram/file/block descriptors, is this the problem ?

Thanks for your help
Best Regards
Seb


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Checking validity of metadata in an .ll file

Devang Patel

On Dec 16, 2011, at 8:05 AM, Seb wrote:

> Hi all,
>
> I was wondering if there is a way to check that metadata emitted in an LLVM file are corrects with respect to debug informations.

Right now there is no such check. In fact, 'llc' is trained to silently ignore malformed debug information, because 'opt' is not held reliable to maintain debug info. That said, it would be valuable to write such verification pass.


> My problem is that I emit 'metadata' in an .ll file and then using 'llc' there is no debug information emitted in final assembly.
> For now I limit metadata to routines/subprogram/file/block descriptors, is this the problem ?

It is hard to guess with limited info. Probably it is easier to just single step in llc (DwarfDebug.cpp) and understand what is missing.
-
Devang

>
> Thanks for your help
> Best Regards
> Seb
>
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Checking validity of metadata in an .ll file

Seb-22
Hi Devang,

Thanks for the answer, I eventually found that in  DW_TAG_compile_unit metadata, if field for 'main' compile unit is set to false then no debug info is generated. Can someone explain what is the meaning of this field ?

You wrote:

"Right now there is no such check. In fact, 'llc' is trained to silently ignore malformed debug information, because 'opt' is not held reliable to maintain debug info. That said, it would be valuable to write such verification pass."

Does this means that after opt metadata are not reliable at all ?

Best Regards
Seb


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Checking validity of metadata in an .ll file

Devang Patel

On Jan 2, 2012, at 5:42 AM, Seb wrote:

> Hi Devang,
>
> Thanks for the answer, I eventually found that in  DW_TAG_compile_unit metadata, if field for 'main' compile unit is set to false then no debug info is generated. Can someone explain what is the meaning of this field ?

It is a relic from the days when each include headers where described using its own compile unit. At that time, it was used to identify main source file for the translation unit. It'd be good to clean this up now.

>
> You wrote:
>
> "Right now there is no such check. In fact, 'llc' is trained to silently ignore malformed debug information, because 'opt' is not held reliable to maintain debug info. That said, it would be valuable to write such verification pass."
>
> Does this means that after opt metadata are not reliable at all ?

Yes. For example, it is certainly possible that opt deletes a function. In such cases, the metadata descriptor for the function will have incomplete info. So the dwarf writer should silently ignore such incomplete descriptors.
-
Devang

>
> Best Regards
> Seb
>

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev