This is the mail archive of the insight@sources.redhat.com 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]

Re: [RFA] more 64-bit patches


OK.  I checked this in.  The final ChangeLog and patch is appended.

-- 
Martin Hunt
GDB Engineer
Red Hat, Inc.

2001-10-29  Martin M. Hunt  <hunt@redhat.com>	

	* generic/gdbtk-bp.c (gdb_set_bp_addr): When setting
	the bp addr_string, use the string the function was called
	with instead of using sprintf to write a new one. This
	avoids a problem with truncating 64-bit addresses.

	* library/srcbar.itcl (SrcBar::create_buttons) Don't
	set width of address label.
	(SrcBar::address) When the address changes, recompute
	width of address label.  If it is more than 10, force it
	to 18, otherwise use 10.

Index: library/srcbar.itcl
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/srcbar.itcl,v
retrieving revision 1.12
diff -u -p -r1.12 srcbar.itcl
--- srcbar.itcl	2001/08/03 18:46:41	1.12
+++ srcbar.itcl	2001/10/29 21:43:28
@@ -534,7 +534,7 @@ class SrcBar {
       $Tool add separator
     }
 
-    $Tool add label addr $address "Address" -width 10 -relief sunken \
+    $Tool add label addr $address "Address" -relief sunken \
                            -bd 1 -anchor e -font  src-font
 
     $Tool add label line $line "Line Number" -width 6 -relief sunken \
@@ -1169,7 +1169,14 @@ Do you want to continue?" \
 
   # This holds the text that is shown in the address label.
   public variable address {} {
-    $Tool itemconfigure addr -text $address -font src-font
+    if {[string length $address] > 10} {
+      # 64-bit address plus "0x"
+      set width 18
+    } else {
+      # 32-bit address plus "0x"
+      set width 10
+    }
+    $Tool itemconfigure addr -text $address -font src-font -width $width
   }
 
   # This holds the text that is shown in the line label.
Index: generic/gdbtk-bp.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-bp.c,v
retrieving revision 1.11
diff -u -p -r1.11 gdbtk-bp.c
--- gdbtk-bp.c	2001/10/29 19:37:05	1.11
+++ gdbtk-bp.c	2001/10/29 21:43:28
@@ -200,8 +200,8 @@ Gdbtk_Breakpoint_Init (Tcl_Interp *inter
  *    It returns a list of breakpoint numbers
  */
 static int
-gdb_find_bp_at_addr ( ClientData clientData, Tcl_Interp *interp,
-		      int objc, Tcl_Obj *CONST objv[])
+gdb_find_bp_at_addr (ClientData clientData, Tcl_Interp *interp,
+		     int objc, Tcl_Obj *CONST objv[])
 {
   int i;
   CORE_ADDR addr;
@@ -568,7 +568,7 @@ gdb_set_bp_addr (ClientData clientData, 
   int thread = -1;
   CORE_ADDR addr;
   struct breakpoint *b;
-  char *typestr, *buf;
+  char *saddr, *typestr, *buf;
   enum bpdisp disp;
 
   if (objc != 3 && objc != 4)
@@ -577,8 +577,9 @@ gdb_set_bp_addr (ClientData clientData, 
       return TCL_ERROR;
     }
 
-  addr = string_to_core_addr (Tcl_GetStringFromObj (objv[1], NULL));
-
+  saddr = Tcl_GetStringFromObj (objv[1], NULL);
+  addr = string_to_core_addr (saddr);
+  
   typestr = Tcl_GetStringFromObj (objv[2], NULL);
   if (strncmp (typestr, "temp", 4) == 0)
     disp = disp_del;
@@ -607,9 +608,7 @@ gdb_set_bp_addr (ClientData clientData, 
   b->number = breakpoint_count;
   b->disposition = disp;
   b->thread = thread;
-
-  xasprintf (&buf, "*(0x%lx)", addr);
-  b->addr_string = xstrdup (buf);
+  b->addr_string = xstrdup (saddr);
 
   /* now send notification command back to GUI */
   breakpoint_create_event (b->number);


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