Re: gdb output problems when run in shell (bash or ksh)

Andreas Schwab
2005-08-02T11:51:15Z

Klaus Zeitler <kzeitler@lucent.com> writes:

> I'm trying to debug a program with more than 100 threads under Solaris 5.8,
> that generates lots of output. When I run the program under gdb in bash,
> the first few threads are started, then gdb suspends itself and I need to
> call 'fg' to resume execution, i.e. the whole thing looks like e.g.:

Does this patch help?

2005-08-02 Andreas Schwab <schwab@suse.de>

* sol-thread.c (sol_thread_wait): Call target_terminal_ours before
printing output.

--- gdb/sol-thread.c.~1.50.~ 2005-06-27 10:03:40.000000000 +0200
+++ gdb/sol-thread.c 2005-08-02 13:46:35.000000000 +0200
@@ -463,6 +463,7 @@ sol_thread_wait (ptid_t ptid, struct tar
&& !ptid_equal (rtnval, save_ptid)
&& !in_thread_list (rtnval))
{
+ target_terminal_ours ();
printf_filtered ("[New %s]\n", target_pid_to_str (rtnval));
add_thread (rtnval);
}

Andreas.

--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, MaxfeldstraÃŸe 5, 90409 NÃ¼rnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."