[PATCH] D68747: [codeview] Try to avoid emitting .cv_loc with line zero

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 9 17:17:27 PDT 2019


rnk created this revision.
rnk added a reviewer: akhuang.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

Visual Studio doesn't like it while stepping. It kicks you out of the
source view of the file being stepped through and tries to fall back to
the disassembly view.

Fixes PR43530

The fix is incomplete, because it's possible to have a basic block with
no source locations at all. In this case, we don't emit a .cv_loc, but
that will result in wrong stepping behavior in the debugger if the
layout predecessor of the location-less BB has an unrelated source
location. We could try harder to find a valid location that dominates or
post-dominates the current BB, but in general it's a dataflow problem,
and one still might not exist. I left a FIXME about this.

As an alternative, we might want to consider having the middle-end check
if its emitting codeview and get it to stop using line zero.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D68747

Files:
  llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
  llvm/test/DebugInfo/COFF/line-zero.ll
  llvm/test/DebugInfo/COFF/local-variables.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68747.224212.patch
Type: text/x-patch
Size: 5421 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191010/deedf113/attachment.bin>


More information about the llvm-commits mailing list