This is the mail archive of the insight@sourceware.org mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Memory window: save updated address


Hi,

I've committed the following patched based on the patch from insight/269 from Dieter Ruppert from Siemens.

Keith

ChangeLog
2005-08-31  Keith Seitz  <keiths@redhat.com>

        From Dieter Ruppert <dieter_ruppert@siemens.com>:
        * library/memwin.itb (update_address): Change parameter name
        so that it does not shadow a member variable.
        Save the updated address internally.
Index: library/memwin.itb
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/memwin.itb,v
retrieving revision 1.22
diff -u -p -r1.22 memwin.itb
--- library/memwin.itb	13 Nov 2002 20:17:10 -0000	1.22
+++ library/memwin.itb	1 Sep 2005 03:11:40 -0000
@@ -469,13 +469,13 @@ itcl::body MemWin::update_address_cb {} 
 # ------------------------------------------------------------------
 #  METHOD: update_address - update address and data displayed
 # ------------------------------------------------------------------
-itcl::body MemWin::update_address {addr_exp} {
+itcl::body MemWin::update_address {addr} {
 
   set bad_expr 0
   set saved_addr $current_addr
-  if {[string match {[a-zA-Z_&0-9\*]*} $addr_exp]} {
+  if {[string match {[a-zA-Z_&0-9\*]*} $addr]} {
     # Looks like an expression
-    set retVal [catch {gdb_eval "$addr_exp" x} current_addr]
+    set retVal [catch {gdb_eval "$addr" x} current_addr]
     #debug "retVal=$retVal current_addr=$current_addr"
     if {$retVal || [string match "No symbol*" $current_addr] || \
 	  [string match "Invalid *" $current_addr]} {
@@ -488,21 +488,21 @@ itcl::body MemWin::update_address {addr_
 	return
       }
     }
-  } elseif {[regexp {\$[a-zA-Z_]} $addr_exp]} {
+  } elseif {[regexp {\$[a-zA-Z_]} $addr]} {
     # Looks like a local variable
-    set retVal [catch {gdb_eval "$addr_exp" x} current_addr]
+    set retVal [catch {gdb_eval "$addr" x} current_addr]
     #debug "retVal=$retVal current_addr=$current_addr"
     if {$retVal} {
       BadExpr $current_addr
       return
     }
     if {$current_addr == "void"} {
-      BadExpr "No Local Variable Named \"$addr_exp\""
+      BadExpr "No Local Variable Named \"$addr\""
       return
     }
   } else {
     # something really strange, like "0.1" or ""
-    BadExpr "Can't Evaluate \"$addr_exp\""
+    BadExpr "Can't Evaluate \"$addr\""
     return
   }
 
@@ -513,6 +513,8 @@ itcl::body MemWin::update_address {addr_
     set current_addr [string range $current_addr 0 $index]
   }
   
+  set addr_exp $addr
+
   # set table background
   $itk_component(table) config -bg $::Colors(textbg) -state normal
   catch {update_addr}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]