1 ## a) Show that llvm-dwarfdump dumps the .debug_str and
2 ## .debug_str.dwo sections when --debug-str is specified.
4 ## "some string\0foo\0\0"
5 # RUN: yaml2obj -DCONTENT="736f6d6520737472696e6700666f6f0000" %s -o %t.o
6 # RUN: llvm-dwarfdump %t.o --debug-str | FileCheck %s
8 # CHECK: .debug_str contents:
9 # CHECK-NEXT: 0x00000000: "some string"
10 # CHECK-NEXT: 0x0000000c: "foo"
11 # CHECK-NEXT: 0x00000010: ""
12 # CHECK: .debug_str.dwo contents:
13 # CHECK-NEXT: 0x00000000: "some string"
14 # CHECK-NEXT: 0x0000000c: "foo"
15 # CHECK-NEXT: 0x00000010: ""
28 - Name: .debug_str.dwo
32 ## b) Test how we dump unprintable chars.
34 ## ['\t', '\0', '\001', '\0', '\\', '0', '0', '1', '\0']
35 # RUN: yaml2obj -DCONTENT="090001005C30303100" %s -o %t2.o
36 # RUN: llvm-dwarfdump --debug-str %t2.o | FileCheck %s --check-prefix=ESCAPED
38 # ESCAPED: .debug_str contents:
39 # ESCAPED-NEXT: 0x00000000: "\t"
40 # ESCAPED-NEXT: 0x00000002: "\001"
41 # ESCAPED-NEXT: 0x00000004: "\\001"
42 # ESCAPED: .debug_str.dwo contents:
43 # ESCAPED-NEXT: 0x00000000: "\t"
44 # ESCAPED-NEXT: 0x00000002: "\001"
45 # ESCAPED-NEXT: 0x00000004: "\\001"
48 ## c) Test that llvm-dwarfdump emits a warning when it encounters a string without a null terminator.
51 # RUN: yaml2obj -DCONTENT="61626300616263" %s -o %t3.o
52 # RUN: llvm-dwarfdump --debug-str %t3.o 2>&1 | FileCheck %s --check-prefix=WARN
54 # WARN: .debug_str contents:
55 # WARN-NEXT: 0x00000000: "abc"
56 # WARN-NEXT: warning: no null terminated string at offset 0x4
57 # WARN: .debug_str.dwo contents:
58 # WARN-NEXT: 0x00000000: "abc"
59 # WARN-NEXT: warning: no null terminated string at offset 0x4