[PATCH] D104271: llvm-dwarfdump: Print warnings on invalid DWARF

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 15 00:00:53 PDT 2021


jhenderson added inline comments.


================
Comment at: llvm/test/tools/llvm-dwarfdump/X86/format-warnings.s:1
+# RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj --defsym=CUEND=1 \
+# RUN:   | llvm-dwarfdump - 2>&1 | FileCheck --check-prefix=CHECK-CUEND %s
----------------
The test deserves an introductory commetn describing what it is testing.

Additionally, the name is too generic and possibly slightly misleading "format-warnings.s" suggests that the main aim of the test is to test the formatting of warning messages in general, whereas this test is more about invalid debug abbrev/debug info, so perhaps it could just be debug-entry-invalid.s or something like that.

I have a personal preference to not use stdin to drive llvm-dwarfdump, and instead create an object file on disk with llvm-mc. This makes it easier to debug the test should something go wrong, since you can inspect the object without needing to change the test code.


================
Comment at: llvm/test/tools/llvm-dwarfdump/X86/format-warnings.s:3
+# RUN:   | llvm-dwarfdump - 2>&1 | FileCheck --check-prefix=CHECK-CUEND %s
+# CHECK-CUEND: warning: DWARF compile unit extends beyond its bounds cu 0x00000000 at 0x0000001f
+
----------------
It would probably be a good idea if you used a non-zero value for the cu index. That will help flag up any conversion issues (e.g. because you used a 32-bit print format for a 64-bit number).

Same goes for the remaining messages.

Here and below, you can drop the "CHECK-" bit of the check prefixes, to make them more concise.


================
Comment at: llvm/test/tools/llvm-dwarfdump/X86/format-warnings.s:21
+.else
+        .uleb128	FORMNO
+.endif
----------------
Indentation here is a little inconsistent.


================
Comment at: llvm/test/tools/llvm-dwarfdump/X86/format-warnings.s:31
+.Lcu_start0:
+	.short	4                       # DWARF version number
+	.long	.debug_abbrev           # Offset Into Abbrev. Section
----------------
Here and elsewhere, consider lining up your comments vertically. They're a bit all over the place currently.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104271



More information about the llvm-commits mailing list