From d3e121331bafa274b654bf2e1691cde628b7ff55 Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Fri, 5 Sep 2014 19:29:45 +0000 Subject: [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. llvm-svn: 217270 --- llvm/test/DebugInfo/Inputs/split-dwarf-test | Bin 0 -> 9379 bytes llvm/test/DebugInfo/Inputs/split-dwarf-test.cc | 17 +++++++++++++++++ llvm/test/DebugInfo/Inputs/split-dwarf-test.dwo | Bin 0 -> 1609 bytes 3 files changed, 17 insertions(+) create mode 100755 llvm/test/DebugInfo/Inputs/split-dwarf-test create mode 100644 llvm/test/DebugInfo/Inputs/split-dwarf-test.cc create mode 100644 llvm/test/DebugInfo/Inputs/split-dwarf-test.dwo (limited to 'llvm/test/DebugInfo/Inputs') diff --git a/llvm/test/DebugInfo/Inputs/split-dwarf-test b/llvm/test/DebugInfo/Inputs/split-dwarf-test new file mode 100755 index 00000000000..a4411129a9b Binary files /dev/null and b/llvm/test/DebugInfo/Inputs/split-dwarf-test differ diff --git a/llvm/test/DebugInfo/Inputs/split-dwarf-test.cc b/llvm/test/DebugInfo/Inputs/split-dwarf-test.cc new file mode 100644 index 00000000000..5ed56f94b36 --- /dev/null +++ b/llvm/test/DebugInfo/Inputs/split-dwarf-test.cc @@ -0,0 +1,17 @@ +int foo(int a) { + return a + 1; +} + +int main(int argc, char *argv[]) { + return foo(argc); +} + +// Build instructions: +// 1) clang++ -### -O2 -gsplit-dwarf.cc split-dwarf-test.cc -o split-dwarf-test +// 2) Replace the value "-fdebug-compilation-dir" flag to "Output" +// (this is the temp directory used by lit). +// 3) Manually run clang-cc1, objcopy and ld invocations. +// 4) Copy the binary and .dwo file to the Inputs directory. Make sure the +// .dwo file will be available for symbolizer (use test RUN-lines to copy +// the .dwo file to a directory +// /. diff --git a/llvm/test/DebugInfo/Inputs/split-dwarf-test.dwo b/llvm/test/DebugInfo/Inputs/split-dwarf-test.dwo new file mode 100644 index 00000000000..74183a4b622 Binary files /dev/null and b/llvm/test/DebugInfo/Inputs/split-dwarf-test.dwo differ -- cgit v1.2.3