https://bugs.llvm.org/show_bug.cgi?id=52028

            Bug ID: 52028
           Summary: lld-link ignoring /DEBUGTYPE:PDATA,FIXUP
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: COFF
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

Created attachment 25312
  --> https://bugs.llvm.org/attachment.cgi?id=25312&action=edit
MSVC & LLVM Debug Streams in comparison after passing "/DEBUGTYPE:PDATA"

MSVC link.exe has an option called /DEBUGTYPE (see
https://docs.microsoft.com/en-us/cpp/build/reference/debugtype-debug-info-options?view=msvc-160)
which can embed certain sections from the generated PE file into the PDB.
The data is embedded as a so called "Debug Stream" which is simply a raw copy
of the section in the PE file.
This option makes it possible to unwind callstacks in minidumps without the
need of having the original PE file on disk.
Below you can see a cropped comparison between lld-link and link debug-streams:


lld-link debug streams:

*** DEBUG STREAMS

Stream: SECTIONHEADERS(9)
2E 74 65 78 74 00 00 00 - 86 5A 00 00 00 10 00 00 - 00 5C 00 00 00 04 00 00 -
00 00 00 00 00 00 00 00 - 00 00 00 00 20 00 00 60 |
.text....Z.......\.................. ..`
2E 72 64 61 74 61 00 00 - BC 38 00 00 00 70 00 00 - 00 3A 00 00 00 60 00 00 -
00 00 00 00 00 00 00 00 - 00 00 00 00 40 00 00 40 |
.rdata..╝8...p...:...`..............@..@
2E 64 61 74 61 00 00 00 - 30 07 00 00 00 B0 00 00 - 00 02 00 00 00 9A 00 00 -
00 00 00 00 00 00 00 00 - 00 00 00 00 40 00 00 C0 |
.data...0....░......................@..└
2E 70 64 61 74 61 00 00 - E0 0A 00 00 00 C0 00 00 - 00 0C 00 00 00 9C 00 00 -
00 00 00 00 00 00 00 00 - 00 00 00 00 40 00 00 40 |
.pdata..Ó....└......................@..@
2E 30 30 63 66 67 00 00 - 28 00 00 00 00 D0 00 00 - 00 02 00 00 00 A8 00 00 -
00 00 00 00 00 00 00 00 - 00 00 00 00 40 00 00 40 |
.00cfg..(....ð.......¿..............@..@
2E 67 65 68 63 6F 6E 74 - 08 00 00 00 00 E0 00 00 - 00 02 00 00 00 AA 00 00 -
00 00 00 00 00 00 00 00 - 00 00 00 00 40 00 00 40 |
.gehcont.....Ó.......¬..............@..@
2E 76 6F 6C 74 62 6C 00 - 1B 00 00 00 00 F0 00 00 - 00 02 00 00 00 AC 00 00 -
00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 |
.voltbl......­.......¼..................
2E 72 73 72 63 00 00 00 - A8 01 00 00 00 00 01 00 - 00 02 00 00 00 AE 00 00 -
00 00 00 00 00 00 00 00 - 00 00 00 00 40 00 00 40 |
.rsrc...¿............«..............@..@
2E 72 65 6C 6F 63 00 00 - 68 00 00 00 00 10 01 00 - 00 02 00 00 00 B0 00 00 -
00 00 00 00 00 00 00 00 - 00 00 00 00 40 00 00 42 |
.reloc..h............░[email protected]
Summary :
        No of Elems = 9
        Sizeof(Elem) = 40


link debug streams:

*** DEBUG STREAMS

Stream: XDATA(4304)
01 | .
0D | .
05 | .
05 | .
...
00 | .
00 | .
Summary :
        No of Elems = 4304
        Sizeof(Elem) = 1

Stream: PDATA(3360)
00 | .
10 | .
00 | .
00 | .
1F | .
...
D3 | Ó
00 | .
00 | .
Summary :
        No of Elems = 3360
        Sizeof(Elem) = 1

Stream: SECTIONHEADERS(6)
2E 74 65 78 74 00 00 00 - 75 7E 00 00 00 10 00 00 - 00 80 00 00 00 04 00 00 -
00 00 00 00 00 00 00 00 - 00 00 00 00 20 00 00 60 |
.text...u~.......................... ..`
2E 72 64 61 74 61 00 00 - 22 5A 00 00 00 90 00 00 - 00 5C 00 00 00 84 00 00 -
00 00 00 00 00 00 00 00 - 00 00 00 00 40 00 00 40 |
.rdata.."Z.......\..................@..@
2E 64 61 74 61 00 00 00 - 58 07 00 00 00 F0 00 00 - 00 02 00 00 00 E0 00 00 -
00 00 00 00 00 00 00 00 - 00 00 00 00 40 00 00 C0 |
.data...X....ð.......à..............@..À
2E 70 64 61 74 61 00 00 - 20 0D 00 00 00 00 01 00 - 00 0E 00 00 00 E2 00 00 -
00 00 00 00 00 00 00 00 - 00 00 00 00 40 00 00 40 | .pdata..
............â..............@..@
2E 72 73 72 63 00 00 00 - E0 01 00 00 00 10 01 00 - 00 02 00 00 00 F0 00 00 -
00 00 00 00 00 00 00 00 - 00 00 00 00 40 00 00 40 |
.rsrc...à............ð..............@..@
2E 72 65 6C 6F 63 00 00 - C4 00 00 00 00 20 01 00 - 00 02 00 00 00 F2 00 00 -
00 00 00 00 00 00 00 00 - 00 00 00 00 40 00 00 42 | .reloc..Ä....
.......ò[email protected]
Summary :
        No of Elems = 6
        Sizeof(Elem) = 40


Full output of Dia2Dump has been attached to this report.
The data can be extracted from PDB files by compiling Dia2Dump and callin it
with the following command line: "Dia2Dump -dbg TestProject.pdb > dbg".

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to