[PATCH] D37625: [DWARF] Incorrect prologue end line record.

Carlos Alberto Enciso via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 8 07:31:41 PDT 2017


CarlosAlbertoEnciso created this revision.
Herald added a subscriber: JDevlieghere.

The prologue-end line record must be emitted after the last instruction that is part of the function frame setup code and before the instruction that marks the beginning of the function body.

Given the test below, the prologue-end line record is emitted with an incorrect associated address, which causes a debugger to show the beginning of function body to be inside the prologue.

1 extern int get_arg();
2 extern void func(int x);
3
4 int main()
5 {
6   int a;
7   func(get_arg());
8 }
9

Using the output from llvm-dwarfdump, this can be illustrated as:

Address            Line   Column File   ISA Discriminator Flags

------------------ ------ ------ ------ --- ------------- -------------

0x0000000000000000      5      0      1   0             0  is_stmt
0x0000000000000004      7      0      1   0             0  is_stmt prologue_end
0x0000000000000014      8      0      1   0             0  is_stmt
0x000000000000001c      8      0      1   0             0  is_stmt end_sequence

The address 0x0000000000000004 is still part of the prologue. The correct associated address must be 0x0000000000000008, which is where the call instruction for 'get_arg' is located.


https://reviews.llvm.org/D37625

Files:
  lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  test/DebugInfo/X86/invalid-prologue-end.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37625.114359.patch
Type: text/x-patch
Size: 5807 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170908/79893400/attachment.bin>


More information about the llvm-commits mailing list