This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFA: Patch ser-unix.c to only call ui hook when target running (WITHDRAW)
- To: gdb-patches at sourceware dot cygnus dot com, Andrew Cagney <cagney at cygnus dot com>
- Subject: Re: RFA: Patch ser-unix.c to only call ui hook when target running (WITHDRAW)
- From: Fernando Nasser <fnasser at cygnus dot com>
- Date: Sun, 15 Oct 2000 14:23:03 +0000
- Organization: Red Hat Canada Ltd. - Toronto
- References: <39E77F33.80AF409@cygnus.com>
I am temporarily and conditionally withdrawing this patch. Although this works fine and
does eliminate several nasty malfunctions, I would rather make this change in the hook
code itself.
I am working on that fix but I will have to ask someone who has an environment that can
reproduce one of the bugs to test it (I do not have the necessary setup to reproduce it
here). I wonder if we shouldn't add it as a temporary fix until the other patch is
ready so people do not download a broken Insight. I would add a FIXME comment line to
the patch below and make a patch replacing this with the other (more elegant) fix when
it is ready.
Andrew, what do you think?
Fernando
Fernando Nasser wrote:
>
> We do want to keep the GUI alive, but sometimes too much of a good thing is bad.
> This patch prevents the GUI to be called at inconvenient times (like between
> a packet is sent and its acknowledgment or response). The behavior becomes
> the same as for native targets where it is only called when waiting for the inferior
> (not in the middle of commands).
>
> This was causing core dumps when people had scripts with commands that set values of
> registers.
>
> 2000-10-13 Fernando Nasser <fnasser@totem.to.cygnus.com>
>
> * ser-unix.c (do_unix_readchar): Only call ui_loop_hook when the
> target is running.
>
> --
> Fernando Nasser
> Red Hat - Toronto E-Mail: fnasser@redhat.com
> 2323 Yonge Street, Suite #300
> Toronto, Ontario M4P 2C9
>
> Index: ser-unix.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/ser-unix.c,v
> retrieving revision 1.6
> diff -c -p -r1.6 ser-unix.c
> *** ser-unix.c 2000/09/15 20:40:15 1.6
> --- ser-unix.c 2000/10/13 20:56:34
> *************** do_unix_readchar (serial_t scb, int time
> *** 920,930 ****
> someone else might have freed it. The ui_loop_hook signals that
> we should exit by returning 1. */
>
> ! if (ui_loop_hook)
> ! {
> ! if (ui_loop_hook (0))
> ! return SERIAL_TIMEOUT;
> ! }
>
> status = ser_unix_wait_for (scb, delta);
> timeout = (timeout <= 0) ? timeout : (timeout - delta);
> --- 920,934 ----
> someone else might have freed it. The ui_loop_hook signals that
> we should exit by returning 1. */
>
> ! /* NOTE: To prevent GUI commands to be issued while we are executing
> ! a previous one, we just call the GUI hook when we have an infinite
> ! timeout (that means that our target is running). FN */
> !
> ! if (ui_loop_hook && (timeout < 0))
> ! {
> ! if (ui_loop_hook (0))
> ! return SERIAL_TIMEOUT;
> ! }
>
> status = ser_unix_wait_for (scb, delta);
> timeout = (timeout <= 0) ? timeout : (timeout - delta);
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@cygnus.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9