authorgravatar for emekankurumeh@outlook.comemekoi <emekankurumeh@outlook.com> 2019-06-29 13:56:23-05:00
committergravatar for emekankurumeh@outlook.comemekoi <emekankurumeh@outlook.com> 2019-06-29 13:56:23-05:00
log027517a0c933f7c07497497c1e8cc0700b7f02bb
treeb7925a8cdd951f751ca382482c79b34f983faf30
parentb780dee3e845f5c8fb8ea7b7906685d5196261a4

added init function for `Coff`


2 files changed, 13 insertions(+), 9 deletions(-)

std/coff.zig+12
......@@ -39,6 +39,18 @@ pub const Coff = struct {
3939 guid: [16]u8,
4040 age: u32,
4141
42 pub fn init(allocator: *mem.Allocator, in_file: File) Coff {
43 return Coff{
44 .in_file = in_file,
45 .allocator = allocator,
46 .coff_header = undefined,
47 .pe_header = undefined,
48 .sections = ArrayList(Section).init(allocator),
49 .guid = undefined,
50 .age = undefined,
51 };
52 }
53
4254 pub fn loadHeader(self: *Coff) !void {
4355 const pe_pointer_offset = 0x3C;
4456
std/debug.zig+1-9
......@@ -800,15 +800,7 @@ fn openSelfDebugInfoWindows(allocator: *mem.Allocator) !DebugInfo {
800800 defer self_file.close();
801801
802802 const coff_obj = try allocator.create(coff.Coff);
803 coff_obj.* = coff.Coff{
804 .in_file = self_file,
805 .allocator = allocator,
806 .coff_header = undefined,
807 .pe_header = undefined,
808 .sections = ArrayList(coff.Section).init(allocator),
809 .guid = undefined,
810 .age = undefined,
811 };
803 coff_obj.* = coff.Coff.init(allocator, self_file);
812804
813805 var di = DebugInfo{
814806 .coff = coff_obj,