1# RUN: rm -rf %t.dir 2# RUN: mkdir %t.dir 3# RUN: cd %t.dir 4# RUN: yaml2obj %p/Inputs/split-dwarf5-debug-stroffsets-file1.dwo.yaml -o %t.dir/file1.dwo 5# RUN: yaml2obj %p/Inputs/split-dwarf5-debug-stroffsets-file2.dwo.yaml -o %t.dir/file2.dwo 6# RUN: yaml2obj %p/Inputs/split-dwarf5-debug-stroffsets-main.yaml -o %t.dir/test 7# RUN: lldb-test breakpoints %t.dir/test %s | FileCheck %s 8 9# This test checks that source code location is shown correctly 10# when split DWARF 5 is used and both DWO/executable file contains 11# .debug_str_offsets/.debug_str_offsets.dwo sections. 12# Used clang version 8.0.0 (trunk 347299) 13# 14# split-dwarf5-debug-stroffsets-file1.dwo.yaml, split-dwarf5-debug-stroffsets-file2.dwo.yaml 15# and split-dwarf5-debug-stroffsets-main.yaml are reduced yaml files produces 16# from the DWO files and the corresponding executable. 17# 18# Code: 19# // decl.h 20# struct struct1 { 21# ~struct1(); 22# static void f(); 23# }; 24# 25# struct struct2 { 26# ~struct2(); 27# static void f(); 28# }; 29# 30# int g(); 31# 32# // file1.cpp 33# #include "decls.h" 34# 35# int g() { 36# return 1; 37# } 38# 39# struct1::~struct1() { 40# int x = g(); 41# } 42# 43# void struct1::f() {} 44# 45# float test() { 46# return 0.0f; 47# } 48# 49# int main() { 50# struct1::f(); 51# struct2::f(); 52# 53# struct1 s1; 54# struct2 s2; 55# 56# test(); 57# 58# return 0; 59# } 60# 61# // file2.cpp 62# 63# 64# #include "decls.h" 65# 66# struct2::~struct2() { 67# int x = g(); 68# } 69# 70# void struct2::f() {} 71# 72# 73# Invocation used was: 74# clang++ file1.cpp -o file1.o -g -fno-rtti -c -gdwarf-5 -gsplit-dwarf -ffunction-sections 75# clang++ file2.cpp -o file2.o -g -fno-rtti -c -gdwarf-5 -gsplit-dwarf -ffunction-sections 76# clang++ file1.o file2.o -g -fno-rtti -gdwarf-5 -o test -gsplit-dwarf -ffunction-sections 77 78b struct1::f 79# CHECK-LABEL: b struct1::f 80# CHECK: Address: {{.*}}struct1::f() + 4 at file1.cpp:11:20 81 82b struct2::f 83# CHECK-LABEL: b struct2::f 84# CHECK: Address: {{.*}}struct2::f() + 4 at file2.cpp:7:20 85