aboutsummaryrefslogtreecommitdiff
path: root/src/link.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2024-08-17 01:15:04 -0400
committerGitHub <noreply@github.com>2024-08-17 01:15:04 -0400
commitbb70501060a8bfff25818cf1d80491d724f8a634 (patch)
tree546c8d93fcbdf4e2f3e2656d5d4f45bc79e9d483 /src/link.zig
parent90989be0e31a91335f8d1c1eafb84c3b34792a8c (diff)
parented19ecd115beedfbf496c6f20995e74fbcd8ccb4 (diff)
downloadzig-bb70501060a8bfff25818cf1d80491d724f8a634.tar.gz
zig-bb70501060a8bfff25818cf1d80491d724f8a634.zip
Merge pull request #21078 from jacobly0/new-dwarf
Dwarf: rework self-hosted debug info from scratch
Diffstat (limited to 'src/link.zig')
-rw-r--r--src/link.zig16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/link.zig b/src/link.zig
index 3463a77147..b3e0aaa4a8 100644
--- a/src/link.zig
+++ b/src/link.zig
@@ -329,6 +329,9 @@ pub const File = struct {
}
}
+ pub const UpdateDebugInfoError = Dwarf.UpdateError;
+ pub const FlushDebugInfoError = Dwarf.FlushError;
+
pub const UpdateNavError = error{
OutOfMemory,
Overflow,
@@ -365,7 +368,7 @@ pub const File = struct {
DeviceBusy,
InvalidArgument,
HotSwapUnavailableOnHostOperatingSystem,
- };
+ } || UpdateDebugInfoError;
/// Called from within CodeGen to retrieve the symbol index of a global symbol.
/// If no symbol exists yet with this name, a new undefined global symbol will
@@ -398,6 +401,16 @@ pub const File = struct {
}
}
+ pub fn updateContainerType(base: *File, pt: Zcu.PerThread, ty: InternPool.Index) UpdateNavError!void {
+ switch (base.tag) {
+ else => {},
+ inline .elf => |tag| {
+ dev.check(tag.devFeature());
+ return @as(*tag.Type(), @fieldParentPtr("base", base)).updateContainerType(pt, ty);
+ },
+ }
+ }
+
/// May be called before or after updateExports for any given Decl.
pub fn updateFunc(
base: *File,
@@ -570,6 +583,7 @@ pub const File = struct {
Unseekable,
UnsupportedCpuArchitecture,
UnsupportedVersion,
+ UnexpectedEndOfFile,
} ||
fs.File.WriteFileError ||
fs.File.OpenError ||