This is the mail archive of the
insight-prs@sources.redhat.com
mailing list for the Insight project.
Re: insight/52
- To: fnasser at cygnus dot com
- Subject: Re: insight/52
- From: Fernando Nasser <fnasser at cygnus dot com>
- Date: 13 Oct 2000 21:13:00 -0000
- Cc: insight-prs at sourceware dot cygnus dot com,
- Reply-To: Fernando Nasser <fnasser at cygnus dot com>
The following reply was made to PR insight/52; it has been noted by GNATS.
From: Fernando Nasser <fnasser@cygnus.com>
To: insight-gnats@sourceware.cygnus.com
Cc:
Subject: Re: insight/52
Date: Fri, 13 Oct 2000 17:12:29 -0400
http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=52&database=insight
This is the final version of the patch that fixes this problem.
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
Index: gdb/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/12 15:39:12
*************** 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,936 ----
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). The only command
! that the GUI sends in that state is the stop, which is the one we
! are really interested. 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);
Index: gdbtk/library/interface.tcl
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/interface.tcl,v
retrieving revision 1.4
diff -c -p -r1.4 interface.tcl
*** interface.tcl 2000/03/28 01:59:39 1.4
--- interface.tcl 2000/10/13 00:10:59
*************** proc gdbtk_busy {} {
*** 135,140 ****
--- 135,141 ----
# that could change target state.
# ------------------------------------------------------------------
proc gdbtk_update {} {
+
set err [catch {run_hooks gdb_update_hook} txt]
if {$err} {
debug "gdbtk_update ERROR: $txt"
*************** proc gdbtk_update {} {
*** 145,150 ****
--- 146,172 ----
}
# ------------------------------------------------------------------
+ # PROCEDURE: gdbtk_update_safe - run all update hooks in a safe way
+ #
+ # Use this procedure to force all widgets to update
+ # themselves. This hook is usually run after command
+ # that could change target state.
+ # Like gdbtk_update but safe to be used in "after idle"
+ # which is used in update hooks.
+ # ------------------------------------------------------------------
+ proc gdbtk_update_safe {} {
+ global gdb_running
+
+ # Fencepost: Do not update if we are running the target
+ # We get here because script commands may have changed memory or
+ # registers and "after idle" events registered as a consequence
+ # If we try to update while the target is running we are doomed.
+ if {!$gdb_running} {
+ gdbtk_update
+ }
+ }
+
+ # ------------------------------------------------------------------
# PROCEDURE: gdbtk_idle - run all idle hooks
#
# Use this procedure to run all the gdb_idle_hook's,
*************** proc gdbtk_tcl_display {action number {v
*** 548,554 ****
# the user has changed the contents of a register.
# ------------------------------------------------------------------
proc gdbtk_register_changed {} {
! after idle gdbtk_update
}
# ------------------------------------------------------------------
--- 570,576 ----
# the user has changed the contents of a register.
# ------------------------------------------------------------------
proc gdbtk_register_changed {} {
! after idle gdbtk_update_safe
}
# ------------------------------------------------------------------
*************** proc gdbtk_register_changed {} {
*** 558,564 ****
# the program's variables).
# ------------------------------------------------------------------
proc gdbtk_memory_changed {} {
! after idle gdbtk_update
}
####################################################################
--- 580,586 ----
# the program's variables).
# ------------------------------------------------------------------
proc gdbtk_memory_changed {} {
! after idle gdbtk_update_safe
}
####################################################################