[llvm] [MC] Add .loc_label instruction (PR #99710)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 1 13:05:48 PDT 2024
================
@@ -0,0 +1,87 @@
+// Verify that the .loc_label instruction resets the line sequence and generates
+// the requested label at the correct position in the line stream
+
+// RUN: llvm-mc -filetype obj -triple x86_64-linux-elf %s -o %t.o
+// RUN: llvm-dwarfdump -v --debug-line %t.o | FileCheck %s --check-prefix=CHECK-LINE-TABLE
+// RUN: llvm-objdump -s -j .offset_02 -j .offset_03 -j .offset_05 %t.o | FileCheck %s --check-prefix=CHECK-SECTIONS
+
+
+
+# CHECK-LINE-TABLE: Address Line Column File ISA Discriminator OpIndex Flags
+# CHECK-LINE-TABLE-NEXT: ------------------ ------ ------ ------ --- ------------- ------- -------------
+# CHECK-LINE-TABLE-NEXT: 0x00000028: 05 DW_LNS_set_column (1)
+# CHECK-LINE-TABLE-NEXT: 0x0000002a: 00 DW_LNE_set_address (0x0000000000000000)
+# CHECK-LINE-TABLE-NEXT: 0x00000035: 01 DW_LNS_copy
+# CHECK-LINE-TABLE-NEXT: 0x0000000000000000 1 1 1 0 0 0 is_stmt
+# CHECK-LINE-TABLE-NEXT: 0x00000036: 02 DW_LNS_advance_pc (addr += 33, op-index += 0)
+# CHECK-LINE-TABLE-NEXT: 0x00000038: 00 DW_LNE_end_sequence
+# CHECK-LINE-TABLE-NEXT: 0x0000000000000021 1 1 1 0 0 0 is_stmt end_sequence
+# CHECK-LINE-TABLE-NEXT: 0x0000003b: 05 DW_LNS_set_column (2)
+# CHECK-LINE-TABLE-NEXT: 0x0000003d: 00 DW_LNE_set_address (0x0000000000000008)
+# CHECK-LINE-TABLE-NEXT: 0x00000048: 01 DW_LNS_copy
+# CHECK-LINE-TABLE-NEXT: 0x0000000000000008 1 2 1 0 0 0 is_stmt
----------------
alx32 wrote:
Great catch !
I updated the logic / test to match with how [-cas-friendly-debug-info](https://github.com/swiftlang/llvm-project/blob/0450cf2fe227374d22dd18186f08f15863454e6b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp#L175)changes the line table.
For an example of `-cas-friendly-debug-info` - see how [test.cpp](https://gist.github.com/alx32/8ee9aa5207c8ddf802d2a51d04e86ee8)'s line tables are changed by `-cas-friendly-debug-info` : [github diff](https://github.com/alx32/share_files/commit/7ef31e32caab2ecc43c69b23d47472312c1766ed] / [diffchecker](https://www.diffchecker.com/uwAyy0CA/)
https://github.com/llvm/llvm-project/pull/99710
More information about the llvm-commits
mailing list