<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/78535>78535</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
lldb only partially read debug symbols in .pdb files
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
drcxd
</td>
</tr>
</table>
<pre>
This is more like a quick question rather than an issue.
Given the following program:
```
#include <iostream>
class MyClass
{
int i = 0;
public:
void f() {
++i;
std::cout << "HelloWorld\n";
++i;
}
};
int main(int argc, char* argv[]) {
MyClass mc;
mc.f();
return 0;
}
```
On Windows, to use LLDB, I have to manually install Python 3.10 as described in this issue https://github.com/llvm/llvm-project/issues/61878. Also, I set the environment variables (to be specific `MSVC_INSTALL_DIR`, `PATH` and `LLDB_USE_NATIVE_PDB_READER`) as described in this thread (https://discourse.llvm.org/t/using-lldb-to-debug-rust-c-on-windows/70149) so that LLDB can read .pdb files.
It looks like LLDB only read part of debug symbols in the .pdb files. The program is compiled using the command `clang++ -g test.cc`. Here is the output of a LLDB session debugging the output .exe file:
```
(lldb) l main
File: D:\emacs_home\test.cc
9 std::cout << "HelloWorld\n";
10 ++i;
11 }
12 };
13
14 int main(int argc, char* argv[]) {
15
16 MyClass mc;
17 mc.f();
18 return 0;
19 }
(lldb) l MyClass::f
error: Could not find function named: "MyClass::f".
```
The version of LLDB is 17.0.4.
I do the same experiment on Linux, LLDB could correctly locate the symbol `MyClass::f`:
```
(lldb) l main
File: /home/drcxd/dt.cc
9 std::cout << "HelloWorld\n";
10 ++i;
11 }
12 };
13
14 int main(int argc, char* argv[]) {
15
16 MyClass mc;
17 mc.f();
18 return 0;
19 }
(lldb) l MyClass::f
File: /home/drcxd/dt.cc
2
3 class MyClass
4 {
5 int i = 0;
6 public:
7 void f() {
8 ++i;
9 std::cout << "HelloWorld\n";
10 ++i;
11 }
12 };
13
14 int main(int argc, char* argv[]) {
15
16 MyClass mc;
(lldb)
```
I noticed that on lldb.llvm.org it said:
> (*) Support for Windows is under active development. Basic functionality is expected to work, with functionality improving rapidly. ARM and AArch64 support is more experimental, with more known issues than the others.
Is this behavior on Windows a problem of my configuration or LLDB does not work properly on Windows yet?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkV01z2zYQ_TXQZUccChQp6qCDLFmNZ5w0E7vJ0QMCKxE1CDAAKFv_vgNQn7aTpkl7qsbDDxCLffuw-7BmzsmNRpyR_IrkywHrfG3sTFj-LAaVEbvZfS0dSAeNsQhKPiIw-NpJ_ghfO3ReGg2W-Rot-JppYBqkcx0mJF2SdN5ff5Nb1OBrhLVRyjxJvYHWmo1lDcnm5zNJke7_-leaSc1VJxBItpDGeYvB5vrchivmHLzfLcJ9_2Fy1T8ASO1BAsmWkJJsP9p2lZL86Bpga6SANaEloVM4MwYg9IrQK3k0DWPOi2CbzbnpfABGsgUQSt-hUuaLsUqQfKEJpRdWr1Yik-UB7fI42l8D6IZJTWgZHpndcEIXwGtmCZ2H922_YRd4D772VEDDT84anuzjOwNl0XdWnxFzgvRiH-L1dw1fpBbmyQUw3kDnEG5vl1fh9QZqtsUw2jDdMaV2ILXzTCn4uPO10ZAloxSYA4GOW1mhABmSIqaX6xBq71sXiKUrQlcb6euuSrhpCF0ptT3chq01fyL3hK6imSN0VYzKSZnAXDnTQ3HoY7qh3kprdIPaw5ZZySqFDggtvYEKwbXI5VpyIEX6_u7z4uHmw939_Pb2YXnzKcROF-HLx_n9O1KkwLQIryHghz_urh8-zO9vPl8_fFxePXy6ni-ve5Pp2yH62iITwfVlmEI6bjrrMAnBJcZuCF2F4Don9WaolKiG3gwFVt1maDvnh3xo9PDpsA-rSToaT4NbZ0IF-rghwJmG6DBpRQVrqdAlcL6XNx6UMY-uL-loY7Ta9UYtsx7MGqJXcLumMsr1oeDFivc1Hgo5aAQ3TSsVCojg42xummZPHFdMb_oqgOEGPDqfcE6KNIF3aBEi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