[Bug 26861] New: Can't proper evaluate std::list and union type in Linux

Bug ID 26861
Summary Can’t proper evaluate std::list and union type in Linux
Product lldb
Version 3.8
Hardware PC
OS Linux
Status NEW
Severity normal
Priority P
Component All Bugs
Assignee lldb-dev@lists.llvm.org
Reporter aert_fudan@hotmail.com
CC llvm-bugs@lists.llvm.org
Classification Unclassified

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.