OSDN Git Service

Fix ChangeLog entry and commit typo (gdbmenubar should read srcmenubar).
authorfnasser <fnasser>
Thu, 4 Jan 2001 17:22:22 +0000 (17:22 +0000)
committerfnasser <fnasser>
Thu, 4 Jan 2001 17:22:22 +0000 (17:22 +0000)
gdb/gdbtk/ChangeLog
gdb/gdbtk/library/srcmenubar.itcl

index a509b1d..d540563 100644 (file)
@@ -4,7 +4,7 @@
         remote target (code previously at library/gdbmenubar.itcl).
        (disconnect): Rename to...
        (gdbtk_disconnect): New name for proc disconnect.
-       * library/gdbmenubar.itcl (do_connect): Remove the code mentioned
+       * library/srcmenubar.itcl (do_connect): Remove the code mentioned
        above and call the new interface proc gdbtk_connect.
        Also, call ::update idletasks after changing the state of the
        menu entries.
index c308686..58b88e3 100644 (file)
@@ -419,7 +419,7 @@ class SrcMenuBar {
   # METHOD:  do_detach: detach from a running target
   # ------------------------------------------------------------------
   method do_detach {menu} {
-    ::disconnect
+    gdbtk_disconnect
     gdbtk_idle
   }
 
@@ -436,53 +436,8 @@ class SrcMenuBar {
   #                      in asynch mode if async is 1
   # ------------------------------------------------------------------
   method do_connect {menu {async 0}} {
-    global file_done
 
-    debug "do_connect: menu=$menu async=$async"
-
-    gdbtk_busy
-
-    set result [gdbtk_attach_remote]
-    switch $result {
-      ATTACH_ERROR {
-       set successful 0
-      }
-
-      ATTACH_TARGET_CHANGED {
-       if {[pref get gdb/load/check] && $file_done} {
-         set err [catch {gdb_cmd "compare-sections"} errTxt]
-         if {$err} {
-           set successful 0
-           tk_messageBox -title "Error" -message $errTxt \
-             -icon error -type ok
-           break
-         }
-       }
-
-       tk_messageBox -title "GDB" -message "Successfully connected" \
-         -icon info -type ok
-       set successful 1
-      }
-
-      ATTACH_CANCELED {
-       tk_messageBox -title "GDB" -message "Connection Canceled" -icon info \
-         -type ok
-       set successful 0
-      }
-
-      ATTACH_TARGET_UNCHANGED {
-       tk_messageBox -title "GDB" -message "Successfully connected" \
-         -icon info -type ok
-       set successful 1
-      }
-
-      default {
-       dbug E "Unhandled response from gdbtk_attach_remote: \"$result\""
-       set successful 0
-      }
-    }
-
-    gdbtk_idle
+    set successful [gdbtk_connect $async]
 
     if {$successful} {
       $menu entryconfigure "Connect to target" -state disabled
@@ -492,8 +447,8 @@ class SrcMenuBar {
       $menu entryconfigure "Disconnect" -state disabled
     }
 
-    # Whenever we attach, we need to do an update
-    gdbtk_update
+    # Make the menu reflect this change
+    ::update idletasks
   }
 
   # ------------------------------------------------------------------
@@ -507,7 +462,7 @@ class SrcMenuBar {
     # For now, these are the same, but they might be different...
     # 
 
-    disconnect $async
+    gdbtk_disconnect $async
 
     $menu entryconfigure "Connect to target" -state normal
     $menu entryconfigure "Disconnect" -state disabled
@@ -664,13 +619,7 @@ Do you want to continue?" \
       }
     }
 
-    debug "Enable list is: $enable_list"
-    foreach {type state} $enable_list {
-      set members [menubar_menu_class_find $type]
-      if {[llength $members]} {
-       menubar_change_menu_state $state $members
-      }
-    }
+    set_class_state $enable_list
   }
 \f
   ####################################################################