[DWARF parser] Fix nasty memory corruption in .dwo files handling.

Forge a test case where llvm-symbolizer has to use external .dwo
file to produce the inlining information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217270 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alexey Samsonov
2014-09-05 19:29:45 +00:00
parent 1455ac7a30
commit 54543afeba
6 changed files with 41 additions and 13 deletions

View File

@@ -19,10 +19,15 @@ RUN: echo "%p/Inputs/macho-universal:x86_64 0x100000f05" >> %t.input
RUN: echo "%p/Inputs/llvm-symbolizer-dwo-test 0x400514" >> %t.input
RUN: echo "%p/Inputs/fission-ranges.elf-x86_64 0x720" >> %t.input
RUN: echo "%p/Inputs/arange-overlap.elf-x86_64 0x714" >> %t.input
RUN: cp %p/Inputs/split-dwarf-test.dwo %T
RUN: echo "%p/Inputs/split-dwarf-test 0x4004d0" >> %t.input
RUN: echo "%p/Inputs/split-dwarf-test 0x4004c0" >> %t.input
RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
RUN: --default-arch=i386 < %t.input | FileCheck %s
REQUIRES: shell
CHECK: main
CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
@@ -98,6 +103,14 @@ CHECK-NEXT: {{.*}}fission-ranges.cc:6
CHECK: _ZN1S3bazEv
CHECK-NEXT: {{.*}}arange-overlap.cc:6
CHECK: _Z3fooi
CHECK-NEXT: {{.*}}split-dwarf-test.cc
CHECK-NEXT: main
CHECK-NEXT: {{.*}}split-dwarf-test.cc
CHECK: _Z3fooi
CHECK-NEXT: {{.*}}split-dwarf-test.cc
RUN: echo "unexisting-file 0x1234" > %t.input2
RUN: llvm-symbolizer < %t.input2