| ... | ... | @@ -120,7 +120,15 @@ pub const Coff = struct { |
| 120 | 120 | |
| 121 | 121 | pub fn getPdbPath(self: *Coff, buffer: []u8) !usize { |
| 122 | 122 | try self.loadSections(); |
| 123 | | const header = (self.getSection(".rdata") orelse return error.MissingCoffSection).header; |
| 123 | const header = blk: { |
| 124 | if (self.getSection(".buildid")) |section| { |
| 125 | break :blk section.header; |
| 126 | } else if (self.getSection(".rdata")) |section| { |
| 127 | break :blk section.header; |
| 128 | } else { |
| 129 | return error.MissingCoffSection; |
| 130 | } |
| 131 | }; |
| 124 | 132 | |
| 125 | 133 | // The linker puts a chunk that contains the .pdb path right after the |
| 126 | 134 | // debug_directory. |