<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/87176>87176</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
SymbolFileDWARFDebugMap::FindTypes only finds types defined in the first compile unit
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
pabusse
</td>
</tr>
</table>
<pre>
The early-exit condition inside `SymbolFileDWARFDebugMap::FindTypes ` is inverted:
```cpp
void SymbolFileDWARFDebugMap::FindTypes(const TypeQuery &query,
TypeResults &results) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
oso_dwarf->FindTypes(query, results);
return !results.Done(query); // Keep iterating if we aren't done.
});
}
```
`ForEachSymbolFile` stops iterating when the closure returns `true`. As a result, type queries only consider the first compile unit in a module.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMU01zmzAQ_TXismMGFtvAgYMThx46OTTNTI8ZgRajVpaoPuz433eEndhNe8iMBiTt09O-p13unNxpooat7thqm_DgR2ObiXfBOUo6I07N80hA3KrTgl6lh95oIb00GqR2UhCwdfb9tO-MaqWi7Y_NU7ulLuwe-cSKDSs2rdTi-TSRi0iQDqQ-kPUkYjjbsuztu87Oo5-m887BSAGf42ZY9UY7D3H1LZA9AcP17zhheH-mm2NP5ILyLkbtecqwBlbeXTDOizO1Mv2vl13gVrDi_n3XUh-skwd62QdPr6x4gDMGqy_kH40Iih7nCFYM6ziKN-rW2Afej1dBEbO6Y7hmqy3D6oNSYLgxzryII7dDTHIRb-uMUTfpvgNi8NaNN-lwVXnNBAAs-WA1MMwvgHRrNF0PRjQwbBm28JVoAunJci_1DuQARwJuSTMsPQijKb0Qs3J7e1Fc_v22Hx78X0vWGThvJndz33EkDX4k6JVxwdIl97mevA3xTAobB_yiNar2p4kgSpHkwGh1inUby9XOTIO0LpbyfpKKIGjpQWrgsJ8fME1EU4i6qHlCTV7mebUqiqxOxoYXnGohEEVZ9Zhlg8iopyqr-nyosFsmssEMl1lR5BkuK6zTZU9VvawqLOoyL_uBLTPac6lSpQ771NhdIp0L1FRlXq4TxTtSbu5GRE1HmIMMMTanbeKZRRd2ji0zJZ13VxYvvaLmk404GzJILdxslANBg9Qkogn_tycJVjWj95OLXHNZ7KQfQ5f2Zs-wjXlcfovJmp_Ue4btnL1j2M7q_gQAAP__eENorA">