[PATCH] D70293: Fix PR44001: assert failure in getFunctionLocalOffsetAfterInsn

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 18 06:04:38 PST 2019


thopre marked 2 inline comments as done.
thopre added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:772-777
       // Address of a call-like instruction for a normal call or a jump-like
       // instruction for a tail call. This is needed for GDB + DWARF 4 tuning.
       const MCSymbol *PCAddr =
-          ApplyGNUExtensions ? const_cast<MCSymbol*>(getLabelAfterInsn(&MI))
-                             : nullptr;
+          ApplyGNUExtensions
+              ? const_cast<MCSymbol *>(getLabelAfterInsn(TopLevelCallMI))
+              : nullptr;
----------------
dstenb wrote:
> thopre wrote:
> > BTW this seems wrong to me, it should probably be getLabelBeforeInsn(MI) but would need labels to be added before call MIs inside a bundle rather than after bundle MIs with a call MI. On the testcase below it gives a DW_AT_low_pc of 0x8 for the following code:
> > 
> > Disassembly of section .text:
> > 
> > 00000000 foo:
> >        0:       00 40 00 5a     5a004000 {      call 0x0
> >        4:       00 c0 9d a0     a09dc000        allocframe(#0) } 
> >        8:       40 3f 00 51     51003f40 {      r0 = add(r0,#1);        dealloc_return }
> It seems that the DW_AT_low_pc attribute is the return address in the GNU extension, so I think that's correct.
> 
> > The call site entry has a DW_AT_low_pc attribute which is the return address after the call. This corresponds to the return address computed by CFI in the called function (6.4).
> 
> http://lists.dwarfstd.org/pipermail/dwarf-discuss-dwarfstd.org/2010-August/002318.html
Alright, fixed the comment accordingly then.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70293/new/

https://reviews.llvm.org/D70293





More information about the llvm-commits mailing list