commit e9217dd299737068e383646d8be6f3524c46f875
parent 0144208765bd20759c266409ba65da1c33fc5152
Author: Drew DeVault <sir@cmpwn.com>
Date: Thu, 25 Jan 2024 10:53:25 +0100
debug::dwarf::line: support version 2
It is backwards- and forwards- compatible, so this is trivial.
Fixes backtraces on OpenBSD.
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/debug/dwarf/line.ha b/debug/dwarf/line.ha
@@ -7,7 +7,8 @@ use format::elf;
use io;
use memio;
-def LINE_VERSION: u16 = 3;
+def MIN_LINE_VERSION: u16 = 2;
+def MAX_LINE_VERSION: u16 = 3;
// Boolean flags for the line number state machine
export type line_flag = enum uint {
@@ -83,7 +84,8 @@ export fn exec_line_program(
// Read program header
const ver = read_uhalf(rd)!;
- assert(ver == 3, "debug::dwarf: unsupported .debug_line version");
+ assert(ver >= MIN_LINE_VERSION && ver <= MAX_LINE_VERSION,
+ "debug::dwarf: unsupported .debug_line version");
let head = line_header { ... };
const head_len = read_secword(rd)?;