<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=http://email.email.llvm.org/c/eJylVttu2zgQ_Rr5ZbCCLMd2_OAHX7bbAC622ATtMyVRFhuaFHipm_36PaQkX5K4LbCA4ljkXM-cmXGhq5flypSNcLx03vBksqIf97Mk2ybZ6u_H8PpVqEofLY2z7nS3-_KJvnBjhVbhfjxJs7S_6z4fHDWsbbmyJGpyDafCcPbcaqEcCUvwRk5r0rXjKu10PnLDw12QPgglDkyS1d6UnEpdcaq1IcNboytfOnhOacddlMbZ3rADFVyoPVW88Ps9r_BKih3w5Ylbt2rblP_gxFQVdWohOX1iQqVl2yKJPvpZ1j_daz4RqpQe3pPJRmjrkMUhmfx5mWtI6QBDSX6f5AtK5uvunOjYBCc4d8bzV3dE1lXB72RVau-CfTwQzlP8JZM14fsHPBRxedGeFEcuTpNF2uwC0MFkMt8OXw1HKRVlsNOHOty9ynAzIGsdMy7AF8DpITRJvgne4vmVR5wHIDu5cGu8Iqn1byIpZVUgtdXnB3zudtt12pxBvZI8dtS7eX-jJt6GoEL1bctAoOjwhMUvyva43g75x_o8KOEEk-Jf3smeDBExj3oMaCGe7RvlDaJz_MyBC-VBL33kbmVfVAmpmkl7JXblqdTKovZt-5m5Jrr7J5Alv79geFC-JlAUhvbtVrlyAiLsuYvWTxF2WTzFG7jrI7gZ50WzBzOdxXR9Ou3MrV92umShlSOu-akbQ0obmnbmT2mc1cG0To-E-mVWV4FBsOTWXka1Y16VzaM4tDKUSXkpWxeZ_97Xtwn_vMl7h-lGK3SRf8ugq8piEvSQnRFM_-Luo3CbcPWONsYrTnvFfIoZnQUDwUb2JpobQ2dwO0wgekWgr5y-eYTXmgB-AFz5QwHCa8x2gR57PeGPrBvx_Ds3LzGkKHYO5GJUnSfTjfZ74gbroGui6-x_MuXem0EPdRyjYVSFeC0H6NXAnVBlnCpiWEkG0y7WNZzWRh_wXvNjr2JDM7GAGigTMEB43iE9CBcavdabBAZM7fvt9tRgteFhFDEB3bRxDFiVzHYTmJ0HyQOBzBXQk7oFo4NhMB0RlQ3EZCDuRQkugAfo9rQnsP_ss8AWroiVpTZVHO_gGodn2DNecpvSKm5EhMaNQRgFmuvZUu0N4DB01OY5HVXLSbWYLNgIZG20WR7EM8uns5E3ctk419pQqkiWvXCNL9JSA9EPUn4f_v0BUL7hFwZehbU-oPVhms9ni1GzrBeLcprz-2pazRibZVN-P67z-XyyyIs6K6uRZAWXdplM12CmQiGiicDS6Xb0_yMQyzzLx-N8PM8Wd7N8kbJ6lmWLeV7XVXY3r--Su4xjV8g02Em12Y_MMppEvSwupbDOni-ZtWKPKsSAEaETTvJl2HORERaVBNG6HRUaDlmtCcuQMNH631qjGOIyxvcf6JH21g>52769</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
LLDB hangs when using C ++ API on Windows
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
mika256
</td>
</tr>
</table>
<pre>
Architecture: x86
OS: Windows 10
LLVM Version: 13.0.0
It happens if the breakpoint is hit too often.
Here is the minimal source code for reproduction. Let the program being debugged be named TestApp.exe and the file Main.cpp:
```
#include <iostream>
int main() {
while (true) {
std::cout << "."; // Here you need to set a breakpoint
}
return 0;
}
```
Code for starting the debugger, setting a breakpoint, and debugging run loop:
```
#include <lldb/API/LLDB.h>
#include <windows.h>
#include <iostream>
using namespace lldb;
int main() {
SBDebugger::Initialize();
auto debugger = SBDebugger::Create(true);
debugger.SetAsync(false);
auto const appPath = R"(TestApp.exe)"; // Path to the program being debugged
auto target = debugger.CreateTarget(appPath);
auto breakpoint = target.BreakpointCreateByLocation("Main.cpp", 5); // Breakpoint location in the program being debugged
auto process = target.LaunchSimple(nullptr, nullptr, nullptr);
while (true) {
process.Continue();
auto const count = breakpoint.GetHitCount();
if (count % 100 == 0) {
std::cout << count << " "; // We just print the number of times the breakpoint was hit every 100 times
}
}
SBDebugger::Terminate();
return 0;
}
```
If you run the second program, then after a while, from a few seconds to a couple of minutes, both programs hang.
This is a very important case for a debugger I am developing, in which a large number of breakpoint hits need to be skipped according to certain rules. And this error blocks further work.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyNVtlu2zgU_Rr55WIEWfISP_jBy2QawMUUk6B9piTKYi2TApe6ma-fQ0ryksTtALQtkXc599yFzlX5ulzpohaWF9ZpHmUr-vkwi5JtlKz-fvav34Qs1cnQOOl2d7uvn-kr10Yo6c_HWZzE_Vn3_WSpZm3LpSFRka055ZqzQ6uEtCQMwRtZpUhVlsu40_nENfdnXvoopDiyhoxyuuBUqJJTpTRp3mpVusLCc0w7boM09vaaHSnnQu6p5Lnb73mJV5LsiIcXbuyqbWP-kxOTZdCpRMPpMxMyLtoWQfToZ0m_utc0E7JoHLxH2UYoYxHFMcr-vI7Vh3SEoSh9iNIFRfN1t090qr0T7Fvt-JszImNL7zdbFcpZbx8LwmmMT5StCc-PWBR4eVWOJEcsVpFB2OyK0MFkNN8Oj5ojlZIS2OmhDmdvItwMzBrLtPX0eXJ6CnWUbry3sH_jEfueyE7On2onqVHqfzLZNGWO0FZfnvC9223XcX0h9Uby1JXe3fM7OXHGg_LZNy1DAQWHZy5-k7bn9XaIP-TnSQorWCP-5Z3s2RARc8jHwBbwbN8pb4DO8ksNXCkPevEztyvzKgtIVawxN2I3ngolDXLftl-YrYO7f3yxpA9XFe6VbwsoCEP7fqvcOEEh7LkN1s8Iuyhewgnc9Qju4rxqdm-msxivz7udufXrThXMt3LgNT13ow9pQ9PO_DmMizoqrdMjIX8b1Q0wCBbcmGtUO-ZkUT-LY9v4NEnXNK0Nlf_R4_uAf93kvcN4oyS6yL2voJvMYhL0lF0YjP_i9pOwG3_0gTbGK3Z7xXSKGZ14A95G8g7NnaEzuB0mEL0poG-cvjvAa7Un3xMu3TFHwSvMdoEeezvhT6wb8fwH168BUhC7ALkaVZfJdKf9XrjGddA10W30v5hyH82gpyqMUT-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