[llvm-dev] Emitting output file information in Debug Info Metadata

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

[llvm-dev] Emitting output file information in Debug Info Metadata

Matthias Braun via llvm-dev
Hi all,

In an effort to improve compatibility on the CodeView debug info side, we need to output a few new record types on the backend that don't seem to have the necessary info tracked by the debug info metadata.  Specifically:

1) For each compile unit, we need to emit a record containing the output file name (e.g. foo.obj)
2) For each compile unit, we need to emit a record containing the full command line of the compiler invocation.

AFAICT, none of this information is in the debug info metadata.  I've done a bunch of work on the backend of emitting debug info, but not so much on the front end.  Where would be a good place to get started for looking into this?

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

Re: [llvm-dev] Emitting output file information in Debug Info Metadata

Matthias Braun via llvm-dev

> On Aug 21, 2017, at 3:17 PM, Zachary Turner <[hidden email]> wrote:
>
> Hi all,
>
> In an effort to improve compatibility on the CodeView debug info side, we need to output a few new record types on the backend that don't seem to have the necessary info tracked by the debug info metadata.  Specifically:
>
> 1) For each compile unit, we need to emit a record containing the output file name (e.g. foo.obj)

It would probably be best to add this as new field to DICompileUnit.

> 2) For each compile unit, we need to emit a record containing the full command line of the compiler invocation.

When enabled, the clang codegen option CGOpts::DwarfDebugFlags already adds the command line to the DICompileUnit.
>
> AFAICT, none of this information is in the debug info metadata.  I've done a bunch of work on the backend of emitting debug info, but not so much on the front end.  Where would be a good place to get started for looking into this?

For (1) I would start by looking at the most recent patches that added new fields to DICompileUnit, such as the DebugInfoForProfiling flag.

-- adrian

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

Re: [llvm-dev] Emitting output file information in Debug Info Metadata

Matthias Braun via llvm-dev


On Mon., 21 Aug. 2017, 3:50 pm Adrian Prantl via llvm-dev <[hidden email]> wrote:

> On Aug 21, 2017, at 3:17 PM, Zachary Turner <[hidden email]> wrote:
>
> Hi all,
>
> In an effort to improve compatibility on the CodeView debug info side, we need to output a few new record types on the backend that don't seem to have the necessary info tracked by the debug info metadata.  Specifically:
>
> 1) For each compile unit, we need to emit a record containing the output file name (e.g. foo.obj)

It would probably be best to add this as new field to DICompileUnit.

Like the name of the dwo file, the name of the object isn't known at ir generation time - for example in LTO situations. So this probably should be passed down the same way the dwo name is - an MC option (I think that's what I used) or backend option.

(Though I do have some questions about the need for this cv debug info - as I mentioned on the associated llvm bug - though I don't recall the PR number)

That's my guess.


> 2) For each compile unit, we need to emit a record containing the full command line of the compiler invocation.

When enabled, the clang codegen option CGOpts::DwarfDebugFlags already adds the command line to the DICompileUnit.

Agreed.

>
> AFAICT, none of this information is in the debug info metadata.  I've done a bunch of work on the backend of emitting debug info, but not so much on the front end.  Where would be a good place to get started for looking into this?

For (1) I would start by looking at the most recent patches that added new fields to DICompileUnit, such as the DebugInfoForProfiling flag.

-- adrian

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

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