stack traces: fix for windows

This commit is contained in:
Sahnvour 2018-11-28 00:24:06 +01:00 committed by Andrew Kelley
parent 3c4965a616
commit 1fb15be05f
2 changed files with 4 additions and 2 deletions

View File

@ -282,8 +282,9 @@ fn printSourceAtAddressWindows(di: *DebugInfo, out_stream: var, relocated_addres
var coff_section: *coff.Section = undefined;
const mod_index = for (di.sect_contribs) |sect_contrib| {
if (sect_contrib.Section >= di.coff.sections.len) continue;
coff_section = &di.coff.sections.toSlice()[sect_contrib.Section];
if (sect_contrib.Section > di.coff.sections.len) continue;
// Remember that SectionContribEntry.Section is 1-based.
coff_section = &di.coff.sections.toSlice()[sect_contrib.Section-1];
const vaddr_start = coff_section.header.virtual_address + sect_contrib.Offset;
const vaddr_end = vaddr_start + sect_contrib.Size;

View File

@ -34,6 +34,7 @@ pub const DbiStreamHeader = packed struct {
};
pub const SectionContribEntry = packed struct {
/// COFF Section index, 1-based
Section: u16,
Padding1: [2]u8,
Offset: u32,