This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: gdb output problems when run in shell (bash or ksh)
- From: Klaus Zeitler <kzeitler at lucent dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: gdb at sources dot redhat dot com, gdb-patches at sources dot redhat dot com
- Date: Tue, 02 Aug 2005 15:57:24 +0200
- Subject: Re: gdb output problems when run in shell (bash or ksh)
- References: <q5gfytsww07.fsf@lucent.com> <jeoe8g36c6.fsf@sykes.suse.de>
>>>>> "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.