LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-19-2007, 05:13 AM   #1
atulsvasu
Member
 
Registered: Apr 2006
Distribution: Gentoo
Posts: 49

Rep: Reputation: 15
Unhappy GDB new thread silent/quiet


I've a program that generates a lot of threads
that are so ephemeral that debugging the program
with gdb is a headache. Because it outputs :

Code:
[New Thread 1090525504 (LWP 7112)]
[Thread 1090525504 (LWP 7112) exited]
[New Thread 1090525504 (LWP 7113)]
[Thread 1090525504 (LWP 7113) exited]
[New Thread 1090525504 (LWP 7114)]
[Thread 1090525504 (LWP 7114) exited]
[New Thread 1090525504 (LWP 7115)]
[Thread 1090525504 (LWP 7115) exited]
[New Thread 1090525504 (LWP 7116)]
[Thread 1090525504 (LWP 7116) exited]
[New Thread 1090525504 (LWP 7117)]
[Thread 1090525504 (LWP 7117) exited]
for each and everythread created. How to disable
printing this output.

I know I can code in alternate way to avoid this
by using thread pools, but I don't want to do it now.
Any quick solution to gdb would be greatly appreciated.

I am unable to find such a request anywhere in GDB
FAQ.

Thank you,
Atul
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 06-19-2007, 07:03 AM   #2
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 31
This might sound off the wall, but how about grabbing the source of gdb and removing the lines that output this stuff? If you anticipate spending a lot of time debugging this application and possibly others like it, this might be the quickest solution in the long run.
 
Old 06-19-2007, 12:10 PM   #3
atulsvasu
Member
 
Registered: Apr 2006
Distribution: Gentoo
Posts: 49

Original Poster
Rep: Reputation: 15
Thanks for the reply, I think it is easier for me to
rewrite my own application to avoid creating new threads,
I'll reuse created threads, using some mechanism, will
be more efficient also.

Editing gdb [], I have never done anything like that,
I'll try sometime. A similar technique shall be filtering the
output stream, to get similar effect. I'll that that
version. (thanks for your tip).

I was expecting a direct command.
 
Old 01-05-2022, 10:39 AM   #4
BruceDLong
LQ Newbie
 
Registered: Apr 2011
Location: Colorado USA, Earth
Distribution: Ubuntu, Angstrom, Maemo
Posts: 3
Blog Entries: 1

Rep: Reputation: 2
Actual answer for future viewers

You can enter this to turn off all the thread messages:

Code:
set print thread-events off
Better yet, put it in the .gdbinit file in your home folder.

Turn them back on with:

Code:
set print thread-events on
 
2 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
normal gdb and spec gdb for kgdb Igor007 Programming 1 09-23-2005 04:15 PM
normal gdb and spec gdb for kgdb Igor007 Linux - Newbie 1 09-23-2005 01:41 PM
gdb .. looking for 32 bit gdb.. for ia64 suse.. nkshirsagar SUSE / openSUSE 0 12-09-2004 03:02 AM
Main thread sending notification to child thread rajesh_b Programming 1 09-22-2004 09:15 AM
Multi-thread debugging with gdb on RedHat 9.0 Rodney Riggs Linux - Software 0 09-23-2003 04:34 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration