How can I disable new thread/thread exited messages in gdb?

LinuxMultithreadingLoggingGdb

Linux Problem Overview


I'm debugging an application, and I get a lot of messages like this:

[New Thread 0x7fffde152700 (LWP 11142)]
[Thread 0x7fffde152700 (LWP 11142) exited]
[New Thread 0x7fff967fa700 (LWP 11143)]
[Thread 0x7fff967fa700 (LWP 11143) exited]
[New Thread 0x7fff967fa700 (LWP 11144)]
[Thread 0x7fff967fa700 (LWP 11144) exited]
[New Thread 0x7fff967fa700 (LWP 11145)]
[Thread 0x7fff967fa700 (LWP 11145) exited]
[New Thread 0x7fffde152700 (LWP 11146)]
[Thread 0x7fffde152700 (LWP 11146) exited]
[New Thread 0x7fffde152700 (LWP 11147)]
[Thread 0x7fffde152700 (LWP 11147) exited]
[New Thread 0x7fffde152700 (LWP 11148)]
[Thread 0x7fffde152700 (LWP 11148) exited]
[New Thread 0x7fffde152700 (LWP 11149)]
[Thread 0x7fffde152700 (LWP 11149) exited]
[New Thread 0x7fffde152700 (LWP 11150)]
[Thread 0x7fffde152700 (LWP 11150) exited]
[New Thread 0x7fffde152700 (LWP 11151)]
[Thread 0x7fffde152700 (LWP 11151) exited]
[New Thread 0x7fffde152700 (LWP 11152)]
[Thread 0x7fffde152700 (LWP 11152) exited]
[New Thread 0x7fffde152700 (LWP 11153)]
[Thread 0x7fffde152700 (LWP 11153) exited]
[New Thread 0x7fffde152700 (LWP 11154)]
[Thread 0x7fffde152700 (LWP 11154) exited]
[New Thread 0x7fff967fa700 (LWP 11155)]
[Thread 0x7fff967fa700 (LWP 11155) exited]
[New Thread 0x7fffde152700 (LWP 11156)]
[Thread 0x7fffde152700 (LWP 11156) exited]
[New Thread 0x7fffde152700 (LWP 11157)]
[Thread 0x7fffde152700 (LWP 11157) exited]

I'm almost never interested in this messages. They make it much harder to read the rest of the output. They can change the timing behaviour of the program, making it hard to reproduce and debug race hazards. How can I disable these messages?

Linux Solutions


Solution 1 - Linux

You can turn off thread events while running gdb:

set print thread-events off

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMatthewView Question on Stackoverflow
Solution 1 - LinuxMatthewView Answer on Stackoverflow