[llvm-dev] Microsoft SourceLink equivalent for LLVM/Clang

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

[llvm-dev] Microsoft SourceLink equivalent for LLVM/Clang

韩玉 via llvm-dev
I made an interesting discovery today, SourceLink [https://docs.microsoft.com/en-us/cpp/build/reference/sourcelink?view=vs-2017]

It would appear it is information describing where to fetch the source code for a particular built object file or image.

My research indicates no search format exists for DWARF and/or neither Clang nor GCC emit this sort of information.

Are there DWARF gods here who would like to introduce this in DWARF?

As an aside could Clang be taught such a trick for Windows in its PDB generation process? I've not been tracking the PDB progress closely recently but having this parity with PDBs generated by MSVC would be nifty.

_______________________________________________
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] Microsoft SourceLink equivalent for LLVM/Clang

韩玉 via llvm-dev
I was made aware of this recently when talking to the Microsoft people at cppcon.  I haven't added PDB support for this yet, but I don't think it would be difficult.  It's low priority simply because the number of people currently using this is probably close to zero just because Its discoverability is also close to zero.  It was also only introduced in the Microsoft Linker within the past couple of months, so it's very new.

Anyway, it's in my backlog and I'll probably implement it soonish just for the sake of parity as you said.

I haven't looked at the schema in too much detail, but my understanding is that it's some JSON that you embed in the PDB file describes source file locations.  Neither the compiler nor the linker have to do any work to construct this JSON at all, it's purely up to the developer to pass a hand-written JSON file on the command line to the linker, but the paths in the JSON can refer to arbitrary URLs, including -- for example -- to something like Github URLs.  

On Tue, Oct 23, 2018 at 11:54 PM Jordan Frost via llvm-dev <[hidden email]> wrote:
I made an interesting discovery today, SourceLink [https://docs.microsoft.com/en-us/cpp/build/reference/sourcelink?view=vs-2017]

It would appear it is information describing where to fetch the source code for a particular built object file or image.

My research indicates no search format exists for DWARF and/or neither Clang nor GCC emit this sort of information.

Are there DWARF gods here who would like to introduce this in DWARF?

As an aside could Clang be taught such a trick for Windows in its PDB generation process? I've not been tracking the PDB progress closely recently but having this parity with PDBs generated by MSVC would be nifty.
_______________________________________________
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