<html>
<head>
<base href="https://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 --- - Can't proper evaluate std::list and union type in Linux"
href="https://llvm.org/bugs/show_bug.cgi?id=26861">26861</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Can't proper evaluate std::list and union type in Linux
</td>
</tr>
<tr>
<th>Product</th>
<td>lldb
</td>
</tr>
<tr>
<th>Version</th>
<td>3.8
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</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@lists.llvm.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>aert_fudan@hotmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>For the following code:
union S
{
std::int32_t n; // occupies 4 bytes
std::uint16_t s[2]; // occupies 4 bytes
std::uint8_t c; // occupies 1 byte
}; // the whole union occupies 4 bytes
int main(int argc, char *argv[])
{
string str("this is a test");
list<int> l;
unordered_map<int, string> ht;
vector<int> v{1, 2, 3, 4};
S s = {0x12345678};
for (int i = 0; i < v.size(); ++ i) {
printf("i: %d\n", i);
l.push_back(i);
ht[i] = str;
}
return 0; <==== Breakpoint stops here.
}
Result:
(lldb) p l
(std::list<int, std::allocator<int> >) $1 = size=4 {}
(lldb) p s
error: stl 0x00004d65: DW_TAG_member 's' refers to type 0x00004d78 which
extends beyond the bounds of 0x00004d52
(S) $0 = (n = 305419896, s = unsigned short [] @ 0x0000000000aa6550, c = 'x')
Expected:
1. The content of list should be visualized.
2. s.s field should be visualized without emiting error.</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>