34 lines · plain
1RUN: llvm-symbolizer --dwp=%p/Inputs/split-dwarf-dwp-invalid.dwp \2RUN: --obj=%p/Inputs/split-dwarf-dwp-invalid \3RUN: 0x0000000000001140 0x0000000000001130 0x0000000000001130 \4RUN: 2>&1 | FileCheck %s5 6The test contains a hand-modified dwp file containing an invalid DWARF version7in the second-queried CU.8 9This ensures llvm-symbolizer doesn't crash when trying to access the invalid CU10a second time (the first time works fine, the second fails the sorted search11because of a null entry that can't be sorted/compared)12 13One warning rather than two would be good here, but we put the CUs in an14offset-sorted list, so a null entry in that list makes it impossible to sort15(since it has no offset), so on failure we don't put anything in the list,16which means next time it's queried it is parsed again and fails and warns17again. We could make the list a pair of {offset, pointer} but that'd require18fixing up a bunch of clients probably (possibly by providing a filter iterator19that skips the null entries, keeping those only as an implementation detail?) -20or perhaps just have a separate list of offsets that have failed to parse21previously?22 23CHECK: warning: DWARF unit at offset 0x00000000 has unsupported version 255, supported are 2-524CHECK: warning: DWARF unit at offset 0x00000000 has unsupported version 255, supported are 2-525 26CHECK: other()27CHECK: /usr/local/google/home/blaikie/dev/scratch{{[/\\]}}other.cpp:1:1628 29CHECK: main30CHECK: /usr/local/google/home/blaikie/dev/scratch{{[/\\]}}test.cpp:5:031 32CHECK: main33CHECK: /usr/local/google/home/blaikie/dev/scratch{{[/\\]}}test.cpp:5:034