[lld] [llvm] [Symbolizer] Support for Missing Line Numbers. (PR #82240)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 23 14:49:53 PDT 2024
================
@@ -0,0 +1,247 @@
+## Test --skip-line-zero option.
+##
+## This test uses handcrafted assembly to produce the following line table:
+## Address Line Column File ISA Discriminator OpIndex Flags
+## ------------------ ------ ------ ------ --- ------------- ------- -------------
+## 0x0000000000001710 1 0 1 0 0 0
+## 0x0000000000001714 0 0 1 0 0 0
+## 0x0000000000001719 1 0 1 0 0 0
+## 0x000000000000171b 1 0 1 0 0 0 end_sequence
+## 0x00000000000016c0 0 0 1 0 0 0
+## 0x00000000000016cf 2 0 1 0 0 0
+## 0x00000000000016d4 0 0 1 0 0 0
+## 0x00000000000016da 0 0 1 0 0 0 end_sequence
+
+# REQUIRES: x86-registered-target
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux --fdebug-prefix-map=%t="" %s -o %t.o
+
+## Check that without '--skip-line-zero', line number zero is displayed for the line-table entry which has no source correspondence.
+# RUN: llvm-symbolizer --obj=%t.o 0x16d4 | FileCheck --strict-whitespace --match-full-lines --check-prefix=APPROX-DISABLE %s
+
+# APPROX-DISABLE:main
+# APPROX-DISABLE-NEXT:main.c:0:0
+
+## Check that with '--skip-line-zero', the last non-zero line in the current sequence is displayed.
+## If it fails to find in the current sequence then return the orignal computed line-zero for the queried address.
+# RUN: llvm-symbolizer --obj=%t.o --skip-line-zero 0x16c0 | FileCheck --strict-whitespace --match-full-lines --check-prefix=APPROX-FAIL-ACROSS-SEQ %s
+
+# APPROX-FAIL-ACROSS-SEQ:main
+# APPROX-FAIL-ACROSS-SEQ-NEXT:main.c:0:0
+
+## Check that with '--skip-line-zero', the last non-zero line in the current sequence is displayed.
+# RUN: llvm-symbolizer --obj=%t.o --skip-line-zero 0x1717 | FileCheck --strict-whitespace --match-full-lines --check-prefix=APPROX-WITHIN-SEQ %s
+
+# APPROX-WITHIN-SEQ:foo
+# APPROX-WITHIN-SEQ-NEXT:main.c:1:0 (approximate)
+
----------------
bd1976bris wrote:
Good point. I originally made this comment because it would be good to have a testcase where more than one line zero row is skipped. Perhaps we could either add a line zero row before the 0x16da row or add another row to the end of this sequence and move the `end_sequence` to that new row?
https://github.com/llvm/llvm-project/pull/82240
More information about the llvm-commits
mailing list