summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/lit/SymbolFile/DWARF/Inputs/debug-line-basic.script14
-rw-r--r--lldb/lit/SymbolFile/DWARF/debug-line-basic.s17
2 files changed, 28 insertions, 3 deletions
diff --git a/lldb/lit/SymbolFile/DWARF/Inputs/debug-line-basic.script b/lldb/lit/SymbolFile/DWARF/Inputs/debug-line-basic.script
new file mode 100644
index 00000000000..7f3a1b9c2ff
--- /dev/null
+++ b/lldb/lit/SymbolFile/DWARF/Inputs/debug-line-basic.script
@@ -0,0 +1,14 @@
+PHDRS {
+ text PT_LOAD;
+}
+SECTIONS {
+ .shstrtab : { *(.shstrtab ) }
+ .debug_info : { *(.debug_info ) }
+ .debug_line : { *(.debug_line ) }
+ .debug_str : { *(.debug_str ) }
+ .debug_abbrev : { *(.debug_abbrev) }
+
+ . = 0x201000;
+ .text : { *(.text .text.f) } :text
+ /DISCARD/ : { *(*) }
+}
diff --git a/lldb/lit/SymbolFile/DWARF/debug-line-basic.s b/lldb/lit/SymbolFile/DWARF/debug-line-basic.s
index fc66f6a01b1..a1100ba8d9c 100644
--- a/lldb/lit/SymbolFile/DWARF/debug-line-basic.s
+++ b/lldb/lit/SymbolFile/DWARF/debug-line-basic.s
@@ -1,10 +1,14 @@
+# Test basics of debug_line parsing. This test uses a linker script which
+# ensures the code is placed at the end of a module to test the boundary
+# condition when the final end-of-sequence line table entry points to an address
+# that is outside the range of memory covered by the module.
+
# REQUIRES: lld, x86
# RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj > %t.o
-# RUN: ld.lld %t.o -o %t
+# RUN: ld.lld --script=%S/Inputs/debug-line-basic.script %t.o -o %t
# RUN: %lldb %t -o "image dump line-table -v a.c" -o exit | FileCheck %s
-
.text
.globl _start
_start:
@@ -35,9 +39,16 @@ _start:
.loc 2 1 0 is_stmt 0
nop
# CHECK-NEXT: 0x0000000000201007: /tmp/c.c:1{{$}}
-
# CHECK-NEXT: 0x0000000000201008: /tmp/c.c:1, is_terminal_entry = TRUE{{$}}
+ .section .text.f,"ax",@progbits
+f:
+ .loc 1 3 0 is_stmt 0
+ nop
+# CHECK-NEXT: 0x0000000000201008: /tmp/b.c:3{{$}}
+# CHECK-NEXT: 0x0000000000201009: /tmp/b.c:3, is_terminal_entry = TRUE{{$}}
+
+
.section .debug_str,"MS",@progbits,1
.Linfo_string1:
.asciz "a.c"
OpenPOWER on IntegriCloud