llvm-project/llvm/test/tools/llvm-dwp/X86
Simonas Kazlauskas 6ffcb2937c [llvm-dwp] Join dwo paths correctly when DWOPath is absolute
When the `DWOPath` is absolute, we want to use `DWOPath` as is, without prepending any other
components to the path. The `sys::path::append` does not join, but rather unconditionally appends
the paths, so something like `sys::path::append("/tmp", "/tmp/banana")` will result in
`/tmp/tmp/banana` rather than the desired `/tmp/banana`.

This then causes `llvm-dwp` to fail in a following situation:

```
$ clang -gsplit-dwarf /tmp/banana/test.c -c -o /tmp/outdir/foo.o
$ clang outdir/foo.o -o outdir/hm
$ llvm-dwarfdump outdir/hm | grep -C2 foo.dwo
                  DW_AT_comp_dir    ("/tmp")
                  DW_AT_GNU_pubnames  (true)
                  DW_AT_GNU_dwo_name    ("/tmp/outdir/foo.dwo")
                                DW_AT_GNU_dwo_id    (0xde4d396f3bf0e257)
                  DW_AT_low_pc  (0x0000000000401100)
$ strace -o trace llvm-dwp -e outdir/hm -o outdir/hm.dwp
error: No such file or directory
$ cat trace | grep foo.dwo
openat(AT_FDCWD, "/tmp/tmp/outdir/foo.dwo", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
```

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D96678
2021-02-16 13:38:35 -08:00
..
absolute_paths.test [llvm-dwp] Join dwo paths correctly when DWOPath is absolute 2021-02-16 13:38:35 -08:00
compress.test
compressfail.test
duplicate.test
dwos_list_from_exec_simple.test
empty.test
gcc_type.test
info-v5.s llvm-dwarfdump: Include unit count in DWP index header dumping 2020-06-12 12:40:02 -07:00
invalid_cu_index.test
invalid_string_form.test
lit.local.cfg
merge.test
missing_dwo_id.test
missing_tu_index.test
multiple_type_sections.test
nocompress.test
non_cu_top_level.test
simple.test [DebugInfo] Report the format of type units [10/10] 2020-06-02 17:55:31 +07:00
type_dedup.test [DebugInfo] Report the format of type units [10/10] 2020-06-02 17:55:31 +07:00
unknown-section-id.s llvm-dwarfdump: Include unit count in DWP index header dumping 2020-06-12 12:40:02 -07:00
unsupported_cu_index_version.s
unsupported_tu_index_version.s
wrong-unit-type-info-v5.s