<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Consider hiding __beginN / __endN / __rangeN range-based for variables from debug info"
   href="https://bugs.llvm.org/show_bug.cgi?id=44288">44288</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Consider hiding __beginN / __endN / __rangeN range-based for variables from debug info
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>8.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>LLVM Codegen
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>rnk@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I was debugging something in windbg and I saw this:

0:000> dx
Debugger.Sessions[0].Processes[7704].Threads[13648].Stack.Frames[8].SwitchTo();dv
/t /v
Debugger.Sessions[0].Processes[7704].Threads[13648].Stack.Frames[8].SwitchTo()
<unavailable>     class lld::coff::`anonymous namespace'::PDBLinker * this =
<value unavailable>
<unavailable>     class lld::coff::ObjFile * file = <value unavailable>
<unavailable>     struct lld::coff::CVIndexMap * externIndexMap = <value
unavailable>
0000007b`3e58bee0 struct lld::coff::CVIndexMap objectIndexMap = struct
lld::coff::CVIndexMap
0000007b`3e58c2a0 class llvm::Expected<const lld::coff::CVIndexMap &>
indexMapResult = class llvm::Expected<const lld::coff::CVIndexMap &>
0000007b`3e58bed0 struct lld::ScopedTimer t = struct lld::ScopedTimer
0000007b`3e58c190 class lld::coff::`anonymous namespace'::DebugSHandler dsh =
class lld::coff::`anonymous namespace'::DebugSHandler
<unavailable>     class llvm::pdb::DbiStreamBuilder * dbiBuilder = <value
unavailable>
<unavailable>     class lld::coff::SectionChunk ** __end2 = <value unavailable>
<unavailable>     class lld::coff::SectionChunk ** __begin2 = <value
unavailable>
<unavailable>     class llvm::ArrayRef<lld::coff::SectionChunk *> * __range2 =
<value unavailable>
<unavailable>     class lld::coff::SectionChunk * debugChunk = <value
unavailable>
<unavailable>     class llvm::FixedStreamArray<llvm::object::FpoData>
fpoRecords = <value unavailable>
<unavailable>     class llvm::BinaryStreamReader reader = <value unavailable>
<unavailable>     class llvm::ArrayRef<unsigned char> relocatedDebugContents =
<value unavailable>
<unavailable>     unsigned int count = <value unavailable>
<unavailable>     class llvm::FixedStreamArrayIterator<llvm::object::FpoData>
__begin4 = <value unavailable>
<unavailable>     class llvm::FixedStreamArrayIterator<llvm::object::FpoData>
__end4 = <value unavailable>
<unavailable>     class llvm::FixedStreamArray<llvm::object::FpoData> *
__range4 = <value unavailable>

Some of these variables are compiler synthesized and therefore uninteresting.
We should consider mot emitting debug info for them in the first place.

Alternatively, we could try mixing in scopes in our optimized debug info output
to hide some of these variables, which are not actually in scope at this point
in the program.

I am stopped at the mergeDebugT call here in LLD:
<a href="https://github.com/llvm/llvm-project/blob/7081c922416b7b2348a1b10cd1d9528f3089f5fb/lld/COFF/PDB.cpp#L1172">https://github.com/llvm/llvm-project/blob/7081c922416b7b2348a1b10cd1d9528f3089f5fb/lld/COFF/PDB.cpp#L1172</a></pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>