Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: gdb output problems when run in shell (bash or ksh)
       [not found] <q5gfytsww07.fsf@lucent.com>
@ 2005-08-02 11:51 ` Andreas Schwab
  2005-08-02 13:57   ` Klaus Zeitler
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Schwab @ 2005-08-02 11:51 UTC (permalink / raw)
  To: Klaus Zeitler; +Cc: gdb, gdb-patches

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."


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: gdb output problems when run in shell (bash or ksh)
  2005-08-02 11:51 ` gdb output problems when run in shell (bash or ksh) Andreas Schwab
@ 2005-08-02 13:57   ` Klaus Zeitler
  0 siblings, 0 replies; 2+ messages in thread
From: Klaus Zeitler @ 2005-08-02 13:57 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: gdb, gdb-patches

>>>>> "Andreas" == Andreas Schwab <schwab@suse.de> writes:
    Andreas> 
    Andreas> Does this patch help?
    Andreas> 
    Andreas> 	* sol-thread.c (sol_thread_wait): Call target_terminal_ours before
    Andreas> 	printing output.
    Andreas> 
    Andreas> --- gdb/sol-thread.c.~1.50.~	2005-06-27 10:03:40.000000000 +0200
    Andreas> +++ gdb/sol-thread.c	2005-08-02 13:46:35.000000000 +0200
    Andreas> @@ -463,6 +463,7 @@ sol_thread_wait (ptid_t ptid, struct tar
    Andreas>  	  && !ptid_equal (rtnval, save_ptid)
    Andreas>  	  && !in_thread_list (rtnval))
    Andreas>  	{
    Andreas> +	  target_terminal_ours ();
    Andreas>  	  printf_filtered ("[New %s]\n", target_pid_to_str (rtnval));
    Andreas>  	  add_thread (rtnval);
    Andreas>  	}

What a quick reply. Your patch didn't help, but if gave me an idea where to
look. I searched for other calls of 'printf_filtered ("[New %s]\n"' (11
matches) and it worked, when I added the call to target_terminal_ours in
module procfs.c to the first occurrence of 'printf_filtered ("[New %s]\n"':

		    if (!in_thread_list (temp_ptid))
		      {
			  target_terminal_ours ();
			printf_filtered ("[1:New %s]\n",
					 target_pid_to_str (temp_ptid));
			add_thread (temp_ptid);
		      }

A closer look revealed that the problem is caused by prompt_for_continue in
fputs_maybe_filtered. It seems as if gdb counts the 'New thread' messages
and prompts for continuation according to page height.
When I set page height in gdb to 0, the problem also disappears.

Thanks

Klaus


-- 
 ------------------------------------------
|  Klaus Zeitler      Lucent Technologies  |
|  Email:             kzeitler@lucent.com  |
 ------------------------------------------
---
Real programmers don't comment their code.  It was
hard to write, it should be hard to understand.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-08-02 13:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <q5gfytsww07.fsf@lucent.com>
2005-08-02 11:51 ` gdb output problems when run in shell (bash or ksh) Andreas Schwab
2005-08-02 13:57   ` Klaus Zeitler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox