authorgravatar for sahnvour@gmail.comSahnvour <sahnvour@gmail.com> 2018-11-28 00:24:06+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-11-27 20:34:55-05:00
log1fb15be05f1037aad53d2db32d13123363365d10
tree2900aae474be543e68fd1c85215d045b0dff448a
parent3c4965a6162e50064d22bc1900584e74e2ef15ea

stack traces: fix for windows


2 files changed, 4 insertions(+), 2 deletions(-)

std/debug/index.zig+3-2
...@@ -282,8 +282,9 @@ fn printSourceAtAddressWindows(di: *DebugInfo, out_stream: var, relocated_addres...@@ -282,8 +282,9 @@ fn printSourceAtAddressWindows(di: *DebugInfo, out_stream: var, relocated_addres
282282
283 var coff_section: *coff.Section = undefined;283 var coff_section: *coff.Section = undefined;
284 const mod_index = for (di.sect_contribs) |sect_contrib| {284 const mod_index = for (di.sect_contribs) |sect_contrib| {
285 if (sect_contrib.Section >= di.coff.sections.len) continue;285 if (sect_contrib.Section > di.coff.sections.len) continue;
286 coff_section = &di.coff.sections.toSlice()[sect_contrib.Section];286 // Remember that SectionContribEntry.Section is 1-based.
287 coff_section = &di.coff.sections.toSlice()[sect_contrib.Section-1];
287288
288 const vaddr_start = coff_section.header.virtual_address + sect_contrib.Offset;289 const vaddr_start = coff_section.header.virtual_address + sect_contrib.Offset;
289 const vaddr_end = vaddr_start + sect_contrib.Size;290 const vaddr_end = vaddr_start + sect_contrib.Size;
std/pdb.zig+1
...@@ -34,6 +34,7 @@ pub const DbiStreamHeader = packed struct {...@@ -34,6 +34,7 @@ pub const DbiStreamHeader = packed struct {
34};34};
3535
36pub const SectionContribEntry = packed struct {36pub const SectionContribEntry = packed struct {
37 /// COFF Section index, 1-based
37 Section: u16,38 Section: u16,
38 Padding1: [2]u8,39 Padding1: [2]u8,
39 Offset: u32,40 Offset: u32,