[lldb-dev] [Bug 20466] New: Inspecting variable with same name as a type does not work

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Jul 27 11:29:52 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20466

            Bug ID: 20466
           Summary: Inspecting variable with same name as a type does not
                    work
           Product: lldb
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at cs.uiuc.edu
          Reporter: Matthew.Arsenault at amd.com
    Classification: Unclassified

If a variable has the same name as a type, lldb gets confused.

For example, in LLVM:

  SDNode *Base = Node;
  // This algorithm requires a reasonably low use count before finding a match
  // to avoid uselessly blowing up compile time in large blocks.
  unsigned UseCount = 0;
  for (SDNode::use_iterator I = Chain->use_begin(), E = Chain->use_end();
       I != E && UseCount < 100; ++I, ++UseCount) {
    SDNode *User = *I;
    if (User == Node || !Visited.insert(User)) // Breakpoint
      continue;
    int64_t Offset1, Offset2;


If I set a breakpoint at the commented line, I can only do anything with Base.
It has the same type as "User", but I cannot do anything to it since User is
also a type. Printing it just does nothing with no explanation.

(lldb) p Base
(llvm::SDNode *) $3 = 0x0000000104818128
(lldb) p User
(lldb) p Base->dump(DAG)
0x104818128: v2i32,ch = S_LOAD_DWORDX2_IMM 0x104817d08, 0x104817e10,
0x103c00670<Mem:LD8[undef(addrspace=2)](nontemporal)> [ORD=1]
(lldb) p User->dump(DAG)
error: cannot use arrow operator on a type
error: 1 errors parsing expression
(lldb)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20140727/c9c22010/attachment.html>


More information about the lldb-dev mailing list