$ cat /tmp/a.cc
struct X {
typedef int InX;
};
X a;
X::InX b;
int main() {
return b;
}
$ g++ /tmp/a.cc -g -o /tmp/a.out
$ bin/lldb /tmp/a.out
(lldb) target create "/tmp/a.out"
Current executable set to '/tmp/a.out' (x86_64).
(lldb) expr -- X::InX a; a
error: <user expression 0>:1:4: no member named 'InX' in 'X'
1 | X::InX a; a
| ~~~^
(lldb) expr b
(X::InX) $0 = 0
(lldb) expr -- X::InX a; a
(X::InX) $1 = 0
This happens because lldb does not construct the clang ast type (only lldb_private::Type) when parsing the dwarf. The clang ast is contructed only when something references the lldb_private::Type -- which can sometimes be too late. Also see #90958 for another issue with lazy typedef parsing (however, unlike this issue, I know how to work around the other one).
```
$ cat /tmp/a.cc
struct X {
typedef int InX;
};
X a;
X::InX b;
int main() {
return b;
}
$ g++ /tmp/a.cc -g -o /tmp/a.out
$ bin/lldb /tmp/a.out
(lldb) target create "/tmp/a.out"
Current executable set to '/tmp/a.out' (x86_64).
(lldb) expr -- X::InX a; a
error: <user expression 0>:1:4: no member named 'InX' in 'X'
1 | X::InX a; a
| ~~~^
(lldb) expr b
(X::InX) $0 = 0
(lldb) expr -- X::InX a; a
(X::InX) $1 = 0
```
This happens because lldb does not construct the clang ast type (only lldb_private::Type) when parsing the dwarf. The clang ast is contructed only when something references the lldb_private::Type -- which can sometimes be too late. Also see #90958 for another issue with lazy typedef parsing (however, unlike this issue, I know how to work around the other one).
This happens because lldb does not construct the clang ast type (only lldb_private::Type) when parsing the dwarf. The clang ast is contructed only when something references the lldb_private::Type -- which can sometimes be too late. Also see #90958 for another issue with lazy typedef parsing (however, unlike this issue, I know how to work around the other one).