| ... | ... | @@ -310,6 +310,10 @@ pub const SymbolKind = enum(u16) { |
| 310 | 310 | |
| 311 | 311 | pub const TypeIndex = u32; |
| 312 | 312 | |
| 313 | // TODO According to this header: |
| 314 | // https://github.com/microsoft/microsoft-pdb/blob/082c5290e5aff028ae84e43affa8be717aa7af73/include/cvinfo.h#L3722 |
| 315 | // we should define RecordPrefix as part of the ProcSym structure. |
| 316 | // This might be important when we start generating PDB in self-hosted with our own PE linker. |
| 313 | 317 | pub const ProcSym = extern struct { |
| 314 | 318 | Parent: u32, |
| 315 | 319 | End: u32, |
| ... | ... | @@ -321,8 +325,7 @@ pub const ProcSym = extern struct { |
| 321 | 325 | CodeOffset: u32, |
| 322 | 326 | Segment: u16, |
| 323 | 327 | Flags: ProcSymFlags, |
| 324 | | // following is a null terminated string |
| 325 | | // Name: [*]u8, |
| 328 | Name: [1]u8, // null-terminated |
| 326 | 329 | }; |
| 327 | 330 | |
| 328 | 331 | pub const ProcSymFlags = packed struct { |
| ... | ... | @@ -693,7 +696,7 @@ pub const Pdb = struct { |
| 693 | 696 | .S_LPROC32, .S_GPROC32 => { |
| 694 | 697 | const proc_sym = @ptrCast(*align(1) ProcSym, &module.symbols[symbol_i + @sizeOf(RecordPrefix)]); |
| 695 | 698 | if (address >= proc_sym.CodeOffset and address < proc_sym.CodeOffset + proc_sym.CodeSize) { |
| 696 | | return mem.sliceTo(@ptrCast([*:0]u8, proc_sym) + @sizeOf(ProcSym), 0); |
| 699 | return mem.sliceTo(@ptrCast([*:0]u8, &proc_sym.Name[0]), 0); |
| 697 | 700 | } |
| 698 | 701 | }, |
| 699 | 702 | else => {}, |