mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
1eb956c2eb
DWARF info contains info about the line number at which a function starts (DW_AT_decl_line). This patch creates a function to look up the start line number for a function, and returns it in DILineInfo when looking up debug info for a particular address. Patch by Simon Que! Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D27962 llvm-svn: 294231
40 lines
930 B
Plaintext
40 lines
930 B
Plaintext
#static volatile int do_mul;
|
|
#static volatile int do_inc;
|
|
#
|
|
#int main () {
|
|
# int x = 1;
|
|
# if (do_mul) x *= 2; else x /= 2;
|
|
# return do_inc ? ++x : --x;
|
|
#}
|
|
#Build as : clang -g -O2 discrim.c -o discrim
|
|
|
|
RUN: llvm-symbolizer -verbose -print-address -obj=%p/Inputs/discrim < %p/Inputs/discrim.inp | FileCheck %s
|
|
|
|
#CHECK: some text
|
|
|
|
#CHECK: 0x4004f2
|
|
#CHECK-NEXT: main
|
|
#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c
|
|
#CHECK-NEXT: Function start line: 4
|
|
#CHECK-NEXT: Line: 6
|
|
#CHECK-NEXT: Column: 7
|
|
#CHECK-NOT: Discriminator: 0
|
|
|
|
#CHECK: 0x400509
|
|
#CHECK-NEXT: main
|
|
#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c
|
|
#CHECK-NEXT: Function start line: 4
|
|
#CHECK-NEXT: Line: 7
|
|
#CHECK-NEXT: Column: 3
|
|
#CHECK-NEXT: Discriminator: 1
|
|
|
|
#CHECK: 0x40050d
|
|
#CHECK-NEXT: main
|
|
#CHECK-NEXT: Filename: /tmp{{[\\/]}}discrim.c
|
|
#CHECK-NEXT: Function start line: 4
|
|
#CHECK-NEXT: Line: 7
|
|
#CHECK-NEXT: Column: 3
|
|
#CHECK-NEXT: Discriminator: 2
|
|
|
|
#CHECK: some more text
|