File: debuginfod.test

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (27 lines) | stat: -rw-r--r-- 1,178 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# This test uses the local debuginfod cache to test the symbolizer integration
# with the debuginfod client.
RUN: rm -rf %t
RUN: mkdir %t

# Produce a stripped copy of the input binary addr.exe
RUN: llvm-objcopy --strip-debug %p/Inputs/addr.exe %t/addr.exe

# Symbolizing the stripped binary should fail.
RUN: env DEBUGINFOD_CACHE_PATH=%t llvm-symbolizer --print-address \
RUN:   --obj=%t/addr.exe 0x40054d | FileCheck %s --check-prefix=NOTFOUND
NOTFOUND: 0x40054d
NOTFOUND-NEXT: main
NOTFOUND-NEXT: ??:0:0

# Use llvm-objcopy to write the debuginfo of the addr.exe binary to an
# appropriately-named file in the llvm debuginfod cache. The filename is
# determined by the debuginfod client's caching scheme, so it is manually
# specified here as llvmcache-98...19
RUN: llvm-objcopy --keep-section=.debug_info %p/Inputs/addr.exe \
RUN:   %t/llvmcache-9800707741016212219

# The symbolizer should call the debuginfod client library, which finds the
# debuginfo placed in the cache, enabling symbolization of the address.
RUN: env DEBUGINFOD_CACHE_PATH=%t llvm-symbolizer \
RUN:   --obj=%t/addr.exe 0x40054d | FileCheck %s --check-prefix=FOUND
FOUND: {{[/\]+}}tmp{{[/\]+}}x.c:14:0