authorgravatar for mason@gamesbymason.comMason Remaley <mason@gamesbymason.com> 2026-04-07 16:35:10-07:00
committergravatar for mason@gamesbymason.comMason Remaley <mason@gamesbymason.com> 2026-04-12 04:01:29-07:00
logcc15c8ae7e0b8d994e818f8275bf73617edefe68
tree3fe340d8a4c396c9c57e1b4362a0f77895933944
parentfa26ab6fa36a5f8d2a6cf11063d42519854d008c

Cleans up binary annotation opcodes that we don't handle


1 files changed, 13 insertions(+), 8 deletions(-)

lib/std/debug/Pdb.zig+13-8
......@@ -357,8 +357,8 @@ pub const BinaryAnnotation = union(enum) {
357357 .change_file => |file_id| {
358358 self.curr.file_id = file_id;
359359 },
360 // LLVM never emits this opcode, but it's clear enough how to interpret it so we may as
361 // well in case they use it in the future
360 // LLVM never emits this opcode, but it's clear enough how to interpret it so we
361 // may as well in case they use it in the future
362362 .change_code_length_and_code_offset => |info| {
363363 self.curr.code_length = info.length;
364364 self.curr.code_offset += info.delta;
......@@ -371,21 +371,24 @@ pub const BinaryAnnotation = union(enum) {
371371 self.curr.line_offset += info.line_delta;
372372 },
373373
374 // Not emitted by LLVM at the time of writing, but if we get it from elsewhere it should
375 // be safe to ignore since we don't use this info. Theoretically we could use column
376 // info if it was present, but it's not easy to test since LLVM doesn't output it.
374 // Not emitted by LLVM at the time of writing, and we don't want to add support
375 // without a test csae. Safe to ignore since we don't use this info right now.
377376 .change_line_end_delta,
378377 .change_column_start,
379378 .change_column_end_delta,
380379 .change_column_end,
381380 => {},
382381
383 // Not emitted by LLVM at the time of writing. Various sources conflict on how these
384 // instructions should be interpreted, so we make no attempt to handle them.
382 // Not emitted by LLVM at the time of writing. Various sources conflict on how
383 // these opcodes should be interpreted, so we make no attempt to handle them.
385384 .code_offset,
386385 .change_code_offset_base,
387386 .change_range_kind,
388 => @panic("unimplemented"),
387 => {
388 self.annotations = .empty;
389 self.prev = null;
390 return null;
391 },
389392 }
390393
391394 switch (annotation) {
......@@ -433,6 +436,8 @@ pub const BinaryAnnotation = union(enum) {
433436 pub const Iterator = struct {
434437 reader: Io.Reader,
435438
439 pub const empty: Iterator = .{ .reader = .ending_instance };
440
436441 pub fn next(self: *Iterator) error{InvalidDebugInfo}!?BinaryAnnotation {
437442 return take(&self.reader) catch |err| switch (err) {
438443 error.ReadFailed => return error.InvalidDebugInfo,