| ... | ... | @@ -32,10 +32,13 @@ pub fn main() !void { |
| 32 | 32 | |
| 33 | 33 | // This is many times larger than any line objdump produces should ever be |
| 34 | 34 | var buf: [4096]u8 = undefined; |
| 35 | var line_number: usize = 0; |
| 35 | 36 | |
| 36 | 37 | // Sample input line: |
| 37 | 38 | // 00000000000241b0 g DF .text	000000000000001b copy_file_range |
| 38 | 39 | while (try stdin.readUntilDelimiterOrEof(&buf, '\n')) |line| { |
| 40 | line_number += 1; |
| 41 | |
| 39 | 42 | // the lines we want all start with a 16 digit hex value |
| 40 | 43 | if (line.len < 16) continue; |
| 41 | 44 | _ = std.fmt.parseInt(u64, line[0..16], 16) catch continue; |
| ... | ... | @@ -57,7 +60,7 @@ pub fn main() !void { |
| 57 | 60 | else if (line[17] == ' ' and line[18] == 'w') |
| 58 | 61 | .weak |
| 59 | 62 | else |
| 60 | | unreachable, |
| 63 | std.debug.panic("unexpected kind on line {d}:\n{s}", .{ line_number, line }), |
| 61 | 64 | |
| 62 | 65 | .type = switch (line[23]) { |
| 63 | 66 | 'F' => .function, |