Files
clang-p2996/llvm/test/tools/llvm-symbolizer/data.s
Mitch Phillips cead4eceb0 [symbolizer] Parse DW_TAG_variable DIs to show line info for globals
Currently, llvm-symbolizer doesn't like to parse .debug_info in order to
show the line info for global variables. addr2line does this. In the
future, I'm looking to migrate AddressSanitizer off of internal metadata
over to using debuginfo, and this is predicated on being able to get the
line info for global variables.

This patch adds the requisite support for getting the line info from the
.debug_info section for symbolizing global variables. This only happens
when you ask for a global variable to be symbolized as data.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D123538
2022-05-23 13:30:22 -07:00

24 lines
556 B
ArmAsm

## Show that when "DATA" is used with an address, it forces the found location
## to be symbolized as data.
# REQUIRES: x86-registered-target
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
# RUN: llvm-symbolizer "DATA 0x2" "DATA 0x8" --obj=%t.o | \
# RUN: FileCheck %s -DFILE=%s --implicit-check-not={{.}}
# CHECK: d1
# CHECK-NEXT: 0 8
# CHECK-NEXT: ??:?
# CHECK-EMPTY:
# CHECK-NEXT: d2
# CHECK-NEXT: 8 4
# CHECK-NEXT: ??:?
# CHECK-EMPTY:
d1:
.quad 0x1122334455667788
.size d1, 8
d2:
.long 0x99aabbcc
.size d2, 4