Emitting full clang command line into Debug Info

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Emitting full clang command line into Debug Info

Anastasia Stulova via cfe-dev
For CodeView compatibility purposes, we need to be able to emit the full command line of the clang driver into the debug info (cc1 command line is fine, at least for CV purposes).

rnk@ tells me that he vaguely recalls some people needing this before, but he can't recall if there's been an actual effort to submit patches to this effect that got blocked on something, or if people are maintaining similar patches downstream, or none of the above / something else.

Has anyone attempted something like this before?

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Emitting full clang command line into Debug Info

Anastasia Stulova via cfe-dev
I did something similar not for the debug info, but for the HTML reports emitted by the analyzer: https://reviews.llvm.org/D42269

> On Feb 8, 2018, at 3:59 PM, Zachary Turner via cfe-dev <[hidden email]> wrote:
>
> For CodeView compatibility purposes, we need to be able to emit the full command line of the clang driver into the debug info (cc1 command line is fine, at least for CV purposes).
>
> rnk@ tells me that he vaguely recalls some people needing this before, but he can't recall if there's been an actual effort to submit patches to this effect that got blocked on something, or if people are maintaining similar patches downstream, or none of the above / something else.
>
> Has anyone attempted something like this before?
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Emitting full clang command line into Debug Info

Anastasia Stulova via cfe-dev
+ Steven who did some work on storing the cc1 options for embedded bitcode.

> On Feb 9, 2018, at 12:15 AM, George Karpenkov via cfe-dev <[hidden email]> wrote:
>
> I did something similar not for the debug info, but for the HTML reports emitted by the analyzer: https://reviews.llvm.org/D42269
>
>> On Feb 8, 2018, at 3:59 PM, Zachary Turner via cfe-dev <[hidden email]> wrote:
>>
>> For CodeView compatibility purposes, we need to be able to emit the full command line of the clang driver into the debug info (cc1 command line is fine, at least for CV purposes).
>>
>> rnk@ tells me that he vaguely recalls some people needing this before, but he can't recall if there's been an actual effort to submit patches to this effect that got blocked on something, or if people are maintaining similar patches downstream, or none of the above / something else.
>>
>> Has anyone attempted something like this before?
>> _______________________________________________
>> cfe-dev mailing list
>> [hidden email]
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Emitting full clang command line into Debug Info

Anastasia Stulova via cfe-dev
In reply to this post by Anastasia Stulova via cfe-dev
GCC produces the full command line in its producer string, Clang doesn't. This may've come up in previous discussions/review threads, but I'm not entirely sure.

There's this: https://reviews.llvm.org/D30760 - -grecord-gcc-switches. So there's already a "flags" field in DICompileUnit you can use, and maybe just add your condition ("if codeview") to the code in clang that conditionally populates that field.

On Thu, Feb 8, 2018 at 4:00 PM Zachary Turner via cfe-dev <[hidden email]> wrote:
For CodeView compatibility purposes, we need to be able to emit the full command line of the clang driver into the debug info (cc1 command line is fine, at least for CV purposes).

rnk@ tells me that he vaguely recalls some people needing this before, but he can't recall if there's been an actual effort to submit patches to this effect that got blocked on something, or if people are maintaining similar patches downstream, or none of the above / something else.

Has anyone attempted something like this before?
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Emitting full clang command line into Debug Info

Anastasia Stulova via cfe-dev
In reply to this post by Anastasia Stulova via cfe-dev
The embed bitcode option does embed all the cc1 command line in the bitcode but there is not a mode to embed only the command line right now. The implementation is in lib/CodeGen/BackendUtil.cpp.

Steven

> On Feb 9, 2018, at 3:53 AM, Jonas Devlieghere <[hidden email]> wrote:
>
> + Steven who did some work on storing the cc1 options for embedded bitcode.
>
>> On Feb 9, 2018, at 12:15 AM, George Karpenkov via cfe-dev <[hidden email]> wrote:
>>
>> I did something similar not for the debug info, but for the HTML reports emitted by the analyzer: https://reviews.llvm.org/D42269
>>
>>> On Feb 8, 2018, at 3:59 PM, Zachary Turner via cfe-dev <[hidden email]> wrote:
>>>
>>> For CodeView compatibility purposes, we need to be able to emit the full command line of the clang driver into the debug info (cc1 command line is fine, at least for CV purposes).
>>>
>>> rnk@ tells me that he vaguely recalls some people needing this before, but he can't recall if there's been an actual effort to submit patches to this effect that got blocked on something, or if people are maintaining similar patches downstream, or none of the above / something else.
>>>
>>> Has anyone attempted something like this before?
>>> _______________________________________________
>>> cfe-dev mailing list
>>> [hidden email]
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>
>> _______________________________________________
>> cfe-dev mailing list
>> [hidden email]
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev