[lldb] Fix flakyness in TestGdbRemote_vContThreads
The cause is the non-async-signal-safety printf function (et al.). If the test managed to interrupt the process and inject a signal before the printf("@started") call returned (but after it has actually written the output), that string could end up being printed twice (presumably, because the function did not manage the clear the userspace buffer, and so the print call in the signal handler would print it once again). This patch fixes the issue by replacing the printf call in the signal handler with a sprintf+write combo, which should not suffer from that problem (though I wouldn't go as far as to call it async signal safe).
Loading
Please sign in to comment