[PATCH] D124121: [DebugInfo] Give warning instead of error for premature terminator in .debug_aranges section.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 25 23:11:30 PDT 2022


jhenderson added inline comments.


================
Comment at: llvm/test/tools/llvm-profgen/premature-warning.s:1
+# REQUIRES: x86-registered-target
+# RUN: clang %s -o %t1
----------------
I feel like the test name needs to include "aranges" somewhere in it, e.g. `premature-aranges-end-warning.s`


================
Comment at: llvm/test/tools/llvm-profgen/premature-warning.s:2
+# REQUIRES: x86-registered-target
+# RUN: clang %s -o %t1
+# RUN: llvm-profgen --binary=%t1 --output=%t2 --show-disassembly-only -x86-asm-syntax=intel --show-source-locations 2>&1 | FileCheck %s
----------------
`clang` can't be used for tests under llvm/test, because it may not have been built. You should use llvm-mc (there are plenty of examples of the latter).


================
Comment at: llvm/test/tools/llvm-profgen/premature-warning.s:5
+
+# CHECK: warning: address range table at
+
----------------
I'd check the full warning, as this pattern could match other warnings from the aranges section.


================
Comment at: llvm/test/tools/llvm-profgen/premature-warning.s:7-15
+# the assembly code is from clang t.c -mllvm -generate-arange-section -g2 -save-temps
+# #include <stdio.h>
+# int main(){
+#   printf("hello world.\n");
+#   return 0;
+# }
+# then manually changed .debug_aragnes section
----------------
In addition to the above, I'd note the version of clang you used to generate this assembly.

Up to you, but I'd consider using YAML as input instead of asm. For the simple test case here, you might find it leads to more readable and maintainable input, once you've done the initial legwork of writing the debug_info and debug_abbrev sections.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124121/new/

https://reviews.llvm.org/D124121



More information about the llvm-commits mailing list