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

Zachary Turner via llvm-dev llvm-dev at lists.llvm.org
Wed Oct 24 07:35:01 PDT 2018


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 <
llvm-dev at lists.llvm.org> 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
> llvm-dev at lists.llvm.org
> http://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/20181024/18c56826/attachment.html>


More information about the llvm-dev mailing list