aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug.zig
diff options
context:
space:
mode:
authorMichaƫl Larouche <michael.larouche@gmail.com>2020-01-21 17:32:00 -0500
committerAndrew Kelley <andrew@ziglang.org>2020-02-03 15:07:34 -0500
commit9b11e5e1f1e0debd1e5484883b2daad8b2b33cb7 (patch)
tree568397a81b76f343bfee781937926bd231e574ad /lib/std/debug.zig
parent958f00f1c71f205ce738433d00e9da7dde060f14 (diff)
downloadzig-9b11e5e1f1e0debd1e5484883b2daad8b2b33cb7.tar.gz
zig-9b11e5e1f1e0debd1e5484883b2daad8b2b33cb7.zip
Add InstallRawStep to Zig build system that does a similar job to llvm-objcopy. To use it, do 'exe.installRaw("kernel.bin");' where exe is a LibExeObjStep
Part of #2826
Diffstat (limited to 'lib/std/debug.zig')
-rw-r--r--lib/std/debug.zig14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig
index 3af2a5c417..a87dbe292d 100644
--- a/lib/std/debug.zig
+++ b/lib/std/debug.zig
@@ -946,8 +946,8 @@ fn readSparseBitVector(stream: var, allocator: *mem.Allocator) ![]usize {
fn findDwarfSectionFromElf(elf_file: *elf.Elf, name: []const u8) !?DwarfInfo.Section {
const elf_header = (try elf_file.findSection(name)) orelse return null;
return DwarfInfo.Section{
- .offset = elf_header.offset,
- .size = elf_header.size,
+ .offset = elf_header.sh_offset,
+ .size = elf_header.sh_size,
};
}
@@ -987,12 +987,12 @@ pub fn openElfDebugInfo(
var di = DwarfInfo{
.endian = efile.endian,
- .debug_info = (data[@intCast(usize, debug_info.offset)..@intCast(usize, debug_info.offset + debug_info.size)]),
- .debug_abbrev = (data[@intCast(usize, debug_abbrev.offset)..@intCast(usize, debug_abbrev.offset + debug_abbrev.size)]),
- .debug_str = (data[@intCast(usize, debug_str.offset)..@intCast(usize, debug_str.offset + debug_str.size)]),
- .debug_line = (data[@intCast(usize, debug_line.offset)..@intCast(usize, debug_line.offset + debug_line.size)]),
+ .debug_info = (data[@intCast(usize, debug_info.sh_offset)..@intCast(usize, debug_info.sh_offset + debug_info.sh_size)]),
+ .debug_abbrev = (data[@intCast(usize, debug_abbrev.sh_offset)..@intCast(usize, debug_abbrev.sh_offset + debug_abbrev.sh_size)]),
+ .debug_str = (data[@intCast(usize, debug_str.sh_offset)..@intCast(usize, debug_str.sh_offset + debug_str.sh_size)]),
+ .debug_line = (data[@intCast(usize, debug_line.sh_offset)..@intCast(usize, debug_line.sh_offset + debug_line.sh_size)]),
.debug_ranges = if (opt_debug_ranges) |debug_ranges|
- data[@intCast(usize, debug_ranges.offset)..@intCast(usize, debug_ranges.offset + debug_ranges.size)]
+ data[@intCast(usize, debug_ranges.sh_offset)..@intCast(usize, debug_ranges.sh_offset + debug_ranges.sh_size)]
else
null,
};