From 966a5fb6496cf3949004e08aaa5ab6aeb1c0c485 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Thu, 26 Oct 2023 16:49:08 +0200 Subject: [PATCH] libdw: ignore really large discriminator llvm can create really large discriminator values. We used to flag those as invalid when the value wouldn't fit in 24 bits. Just truncate the value. * libdw/dwarf_getsrclines.c (add_new_line): Define SETX. Use SETX to set discriminator. https://sourceware.org/bugzilla/show_bug.cgi?id=30967 Signed-off-by: Mark Wielaard --- libdw/dwarf_getsrclines.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libdw/dwarf_getsrclines.c b/libdw/dwarf_getsrclines.c index df003c5fd..69e10c7b1 100644 --- a/libdw/dwarf_getsrclines.c +++ b/libdw/dwarf_getsrclines.c @@ -129,6 +129,12 @@ add_new_line (struct line_state *state, struct linelist *new_line) return true; \ } while (0) + /* Same as above, but don't flag as "invalid" just use truncated + value. Used for discriminator for which llvm might use a value + that won't fit 24 bits. */ +#define SETX(field) \ + new_line->line.field = state->field; \ + SET (addr); SET (op_index); SET (file); @@ -140,7 +146,7 @@ add_new_line (struct line_state *state, struct linelist *new_line) SET (prologue_end); SET (epilogue_begin); SET (isa); - SET (discriminator); + SETX (discriminator); SET (context); SET (function_name); -- 2.47.2