<html>
<head>
<base href="http://llvm.org/bugs/" />
</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 --- - Inspecting variable with same name as a type does not work"
href="http://llvm.org/bugs/show_bug.cgi?id=20466">20466</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Inspecting variable with same name as a type does not work
</td>
</tr>
<tr>
<th>Product</th>
<td>lldb
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>lldb-dev@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Reporter</th>
<td>Matthew.Arsenault@amd.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>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)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>