This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Re: insight/52
- To: Steven Johnson <sbjohnson at ozemail dot com dot au>
- Subject: Re: insight/52
- From: Fernando Nasser <fnasser at cygnus dot com>
- Date: Thu, 12 Oct 2000 22:35:47 +0000
- CC: insight at sourceware dot cygnus dot com
- Organization: Red Hat Canada Ltd. - Toronto
- References: <20001012161301.19246.qmail@sourceware.cygnus.com> <39E62A7D.5CECCADD@ozemail.com.au>
Here is a revised (and also untested patch).
Please let me know how it goes.
(the ser-unix.c part you already have applied)
Thanks again for the four-hands bug tracking effort.
Regards,
Fernando
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@cygnus.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: 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/12 22:29:49
*************** proc gdbtk_busy {} {
*** 135,140 ****
--- 135,170 ----
# that could change target state.
# ------------------------------------------------------------------
proc gdbtk_update {} {
+
+ set err [catch {run_hooks gdb_update_hook} txt]
+ if {$err} {
+ debug "gdbtk_update ERROR: $txt"
+ }
+
+ # Force the screen to update
+ update
+ }
+
+ # ------------------------------------------------------------------
+ # 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} {
+ return
+ }
+
set err [catch {run_hooks gdb_update_hook} txt]
if {$err} {
debug "gdbtk_update ERROR: $txt"
*************** 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
}
# ------------------------------------------------------------------
--- 578,584 ----
# 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
}
####################################################################
--- 588,594 ----
# the program's variables).
# ------------------------------------------------------------------
proc gdbtk_memory_changed {} {
! after idle gdbtk_update_safe
}
####################################################################