public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* Re: insight/52
       [not found] ` <39E62A7D.5CECCADD@ozemail.com.au>
@ 2000-10-12 14:54   ` Fernando Nasser
  2000-10-12 15:35   ` insight/52 Fernando Nasser
  1 sibling, 0 replies; 2+ messages in thread
From: Fernando Nasser @ 2000-10-12 14:54 UTC (permalink / raw)
  To: Steven Johnson; +Cc: insight

Steven Johnson wrote:
> 
> I Had to change this to read
>        if {$gdb_running} {
>          return
>        }
> 
> Otherwise the TCL Interpreter hated it.
> 
Thanks, as I said, I had no way of testing it :)


> Did this, and download worked great. BUT...
> 
> Now I can Connect, and Download OK.
> 
> I Can insert a breakpoint and RUN OK.
> 
> If I then insert another breakpoint and CONTINUE.
> 
> The target runs and breaks, but Insight doesn't show the break having occured.
> I can change the source file and come back to the file it is broken in and the
> state changes for "GDB Running" to "GDB Halted" but the indicated line is
> wrong. (I can view the registers and the $pc is definately pointing to the next
> breakpoint instruction.)
> 
> I think it is something to do with the change we made to gdbtk_update, but i'm
> not sure what.
> 

Yeah, I was afraid that would happen but I hoped the gdb_running was going to be 
unset before gdbtk_update.

I will have to create a "safe_gdbtk_update" for the after commands and leave the
original alone.

I am sending you the patch momentarily.




-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@cygnus.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9

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

* Re: insight/52
       [not found] ` <39E62A7D.5CECCADD@ozemail.com.au>
  2000-10-12 14:54   ` insight/52 Fernando Nasser
@ 2000-10-12 15:35   ` Fernando Nasser
  1 sibling, 0 replies; 2+ messages in thread
From: Fernando Nasser @ 2000-10-12 15:35 UTC (permalink / raw)
  To: Steven Johnson; +Cc: insight

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
  }
  
  ####################################################################

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

end of thread, other threads:[~2000-10-12 15:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20001012161301.19246.qmail@sourceware.cygnus.com>
     [not found] ` <39E62A7D.5CECCADD@ozemail.com.au>
2000-10-12 14:54   ` insight/52 Fernando Nasser
2000-10-12 15:35   ` insight/52 Fernando Nasser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).