1 RUN: llvm-symbolizer --dwp=%p/Inputs/split-dwarf-dwp-invalid.dwp \
2 RUN: --obj=%p/Inputs/split-dwarf-dwp-invalid \
3 RUN: 0x0000000000001140 0x0000000000001130 0x0000000000001130 \
4 RUN: 2>&1 | FileCheck %s
6 The test contains a hand-modified dwp file containing an invalid DWARF version
7 in the second-queried CU.
9 This ensures llvm-symbolizer doesn't crash when trying to access the invalid CU
10 a second time (the first time works fine, the second fails the sorted search
11 because of a null entry that can't be sorted/compared)
13 One warning rather than two would be good here, but we put the CUs in an
14 offset-sorted list, so a null entry in that list makes it impossible to sort
15 (since it has no offset), so on failure we don't put anything in the list,
16 which means next time it's queried it is parsed again and fails and warns
17 again. We could make the list a pair of {offset, pointer} but that'd require
18 fixing up a bunch of clients probably (possibly by providing a filter iterator
19 that skips the null entries, keeping those only as an implementation detail?) -
20 or perhaps just have a separate list of offsets that have failed to parse
23 CHECK: warning: DWARF unit at offset 0x00000000 has unsupported version 255, supported are 2-5
24 CHECK: warning: DWARF unit at offset 0x00000000 has unsupported version 255, supported are 2-5
27 CHECK: /usr/local/google/home/blaikie/dev/scratch{{[/\\]}}other.cpp:1:16
30 CHECK: /usr/local/google/home/blaikie/dev/scratch{{[/\\]}}test.cpp:5:0
33 CHECK: /usr/local/google/home/blaikie/dev/scratch{{[/\\]}}test.cpp:5:0