From 647ef50fc4de9b5c49ffad1aec4271e79b171785 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 18 Mar 2021 11:41:51 -0700 Subject: Ignore missing CUs in DWARF rewriting (#3700) A recent change in LLVM causes it to sometimes end up with a thing with no parent. That is, a debug_line or a debug_loc that has no CU that refers to it. This is perhaps LLVM DCEing CUs, or something else that changed - not sure. But it seems like valid DWARF we should handle. This PR handles that in our code. Two things broke here. First, locs must be simply ignored when there is no CU. Second, lines are trickier as we used to compute their position by scanning them, and that list contained only ones with a CU. So we missed some and ended up with wrong offsets. To make things simpler and more robust, just track the position of each line table on itself. Fixes #3697 --- third_party/llvm-project/include/llvm/ObjectYAML/DWARFYAML.h | 1 + 1 file changed, 1 insertion(+) (limited to 'third_party/llvm-project/include/llvm/ObjectYAML') diff --git a/third_party/llvm-project/include/llvm/ObjectYAML/DWARFYAML.h b/third_party/llvm-project/include/llvm/ObjectYAML/DWARFYAML.h index 510610123..bb66565a5 100644 --- a/third_party/llvm-project/include/llvm/ObjectYAML/DWARFYAML.h +++ b/third_party/llvm-project/include/llvm/ObjectYAML/DWARFYAML.h @@ -151,6 +151,7 @@ struct LineTableOpcode { }; struct LineTable { + uint64_t Position; // XXX BINARYEN: the binary location in .debug_line InitialLength Length; uint16_t Version; uint64_t PrologueLength; -- cgit v1.2.3