llvm-mirror/test/DebugInfo/symbolize-build-id.test
Petr Hosek fbbc57aefb [llvm-symbolizer] Support debug file lookup using build ID
Build ID is a protocol for looking up debug files that's already
supported by various tools including debuggers. For example, when
locating debug files, gdb would check the following directories:

- /usr/lib/debug/.build-id/ab/cdef1234.debug
- /usr/bin/ls.debug
- /usr/bin/.debug/ls.debug
- /usr/lib/debug/usr/bin/ls.debug

llvm-symbolizer currently consults all of these except for build ID
based one. This patch implements support for build ID lookup. The
set of debug directories to search is specified by the new option:
--debug-file-directory, whose name matches the debug-file-directory
variable used by gdb for the same purpose.

Differential Revision: https://reviews.llvm.org/D70759
2019-12-04 15:07:56 -08:00

29 lines
736 B
Plaintext

# RUN: yaml2obj %s -o %t
# RUN: llvm-symbolizer --debug-file-directory=/non-existent --obj=%t 0x20112f | FileCheck --check-prefix=UNKNOWN %s
# UNKNOWN: ??
# UNKNOWN-NEXT: ??:0:0
# RUN: llvm-symbolizer --debug-file-directory=%p/Inputs --obj=%t 0x20112f | FileCheck --check-prefix=FOUND %s
# FOUND: main
# FOUND-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Machine: EM_X86_64
Sections:
- Name: .note.gnu.build-id
Type: SHT_NOTE
Flags: [ SHF_ALLOC ]
Content: 040000000800000003000000474e5500abb50d82b6bdc861
ProgramHeaders:
- Type: PT_NOTE
Flags: [ PF_R ]
Sections:
- Section: .note.gnu.build-id