public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* [OBV] Fix building of insight
@ 2009-07-07 12:38 Pierre Muller
  0 siblings, 0 replies; only message in thread
From: Pierre Muller @ 2009-07-07 12:38 UTC (permalink / raw)
  To: insight


  Recent commits to GDB CVS 
made gdbtk again out of sync.

  The patch below fixes al issues but one:

  set_raw_breakpoint was made static in 
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/breakpoint.c.diff?r1=1.410&
r2=1.411&cvsroot=src


  I will ask if that can be undone on gdb-patches.

If you apply this patch to src/gdb
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.412
diff -u -p -r1.412 breakpoint.c
--- breakpoint.c	2 Jul 2009 17:21:05 -0000	1.412
+++ breakpoint.c	7 Jul 2009 12:26:35 -0000
@@ -105,7 +105,7 @@ static void break_command_1 (char *, int
 
 static void mention (struct breakpoint *);
 
-static struct breakpoint *set_raw_breakpoint (struct gdbarch *gdbarch,
+struct breakpoint *set_raw_breakpoint (struct gdbarch *gdbarch,
 					      struct symtab_and_line,
 					      enum bptype);
 
@@ -4397,7 +4397,7 @@ static void free_bp_location (struct bp_
 /* Helper to set_raw_breakpoint below.  Creates a breakpoint
    that has type BPTYPE and has no locations as yet.  */
 
-static struct breakpoint *
+struct breakpoint *
 set_raw_breakpoint_without_location (struct gdbarch *gdbarch,
 				     enum bptype bptype)
 {
@@ -4480,7 +4480,7 @@ get_sal_arch (struct symtab_and_line sal
    prior to completing the initialization of the breakpoint.  If this
    should happen, a bogus breakpoint will be left on the chain.  */
 
-static struct breakpoint *
+struct breakpoint *
 set_raw_breakpoint (struct gdbarch *gdbarch,
 		    struct symtab_and_line sal, enum bptype bptype)
 {


You should be able to recompile insight.



Pierre Muller
Pascal language support maintainer for GDB

PS: insight on my cygwin is still failing on some tk window :(


2009-07-07  Pierre Muller  <muller@ics.u-strasbg.fr>

	* generic/gdbtk-bp.c: Include "arch-utils.h".
	(set_raw_breakpoint): Update external definition.
	(gdb_set_bp): Adapt to set_raw_breakpoint change.
	(gdb_set_bp_addr): Likewise.

	* generic/gdbtk-cmds.c: Include "arch-utils.h.
	(gdbtk_load_asm): Adapt to paddress and gdb_print_insn changes.
	(hex2bin): Replace current_gdbarch by get_current_arch call.
	(gdb_update_mem): Adapt to builtin_type changes.
	(gdb_CA_to_TAS): Use paddress to replace removed function paddr_nz.

	* generic/gdbtk-register.c: Include "arch-utils.h".
	(get_register_size): Replace current_gdbarch by get_current_arch
call.
	(get_register_types): Likewise.
	(get_register): Likewise.
	(get_register_name): Likewise.
	(map_arg_registers): Likewise.
	(register_changed_p): Likewise.
	(setup_architecture_data): Likewise.
	(gdb_regformat): Likewise.
	(gdb_reggrouplist): Likewise.
	(gdb_reggroup): Likewise.

	* generic/gdbtk-stack.c: Inlcude "arch-utils.h".
	(gdb_get_blocks): Use paddress instead of removed paddr_nz function.
	(gdb_selected_block): Likewise.
	(gdb_selected_frame): Likewise.


Index: generic/gdbtk-bp.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-bp.c,v
retrieving revision 1.30
diff -u -p -r1.30 gdbtk-bp.c
--- generic/gdbtk-bp.c	31 Mar 2009 05:08:35 -0000	1.30
+++ generic/gdbtk-bp.c	7 Jul 2009 12:09:07 -0000
@@ -30,6 +30,7 @@
 #include "gdbtk.h"
 #include "gdbtk-cmds.h"
 #include "observer.h"
+#include "arch-utils.h"
 
 /* From breakpoint.c */
 extern struct breakpoint *breakpoint_chain;
@@ -75,8 +76,9 @@ char *bpdisp[] =
  * at some point make these static in breakpoint.c and move GUI code there
  */
 
-extern struct breakpoint *set_raw_breakpoint (struct symtab_and_line sal,
-					      enum bptype bp_type);
+extern struct breakpoint *set_raw_breakpoint (struct gdbarch *gdbarch,
+					      struct symtab_and_line,
+					      enum bptype);
 extern void set_breakpoint_count (int);
 extern int breakpoint_count;
 
@@ -545,7 +547,7 @@ gdb_set_bp (ClientData clientData, Tcl_I
     return TCL_ERROR;
 
   sal.section = find_pc_overlay (sal.pc);
-  b = set_raw_breakpoint (sal, bp_breakpoint);
+  b = set_raw_breakpoint (get_current_arch (), sal, bp_breakpoint);
   set_breakpoint_count (breakpoint_count + 1);
   b->number = breakpoint_count;
   b->disposition = disp;
@@ -618,7 +620,7 @@ gdb_set_bp_addr (ClientData clientData, 
 
   sal = find_pc_line (addr, 0);
   sal.pc = addr;
-  b = set_raw_breakpoint (sal, bp_breakpoint);
+  b = set_raw_breakpoint (get_current_arch (), sal, bp_breakpoint);
   set_breakpoint_count (breakpoint_count + 1);
   b->number = breakpoint_count;
   b->disposition = disp;
Index: generic/gdbtk-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-cmds.c,v
retrieving revision 1.112
diff -u -p -r1.112 gdbtk-cmds.c
--- generic/gdbtk-cmds.c	19 Jun 2009 13:49:38 -0000	1.112
+++ generic/gdbtk-cmds.c	7 Jul 2009 12:09:08 -0000
@@ -45,6 +45,7 @@
 #include "target.h"
 #include "valprint.h"
 #include "regcache.h"
+#include "arch-utils.h"
 
 /* tcl header files includes varargs.h unless HAS_STDARG is defined,
    but gdb uses stdarg.h, so make sure HAS_STDARG is defined.  */
@@ -1895,7 +1896,7 @@ gdbtk_load_asm (ClientData clientData, C
   for (i = 0; i < 3; i++)
     Tcl_SetObjLength (client_data->result_obj[i], 0);
 
-  fputs_filtered (paddress (pc), gdb_stdout);
+  fputs_filtered (paddress (get_current_arch (), pc), gdb_stdout);
   gdb_flush (gdb_stdout);
 
   result_ptr->obj_ptr = client_data->result_obj[1];
@@ -1904,7 +1905,7 @@ gdbtk_load_asm (ClientData clientData, C
 
   result_ptr->obj_ptr = client_data->result_obj[2];
   /* FIXME: cagney/2003-09-08: This should use gdb_disassembly.  */
-  insn = gdb_print_insn (pc, gdb_stdout, NULL);
+  insn = gdb_print_insn (get_current_arch (), pc, gdb_stdout, NULL);
   gdb_flush (gdb_stdout);
 
   client_data->widget_line_no++;
@@ -2271,7 +2272,7 @@ hex2bin (const char *hex, char *bin, int
   int incr = 2;
 
 
-  if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_LITTLE)
+  if (gdbarch_byte_order (get_current_arch ()) == BFD_ENDIAN_LITTLE)
     {
       /* need to read string in reverse */
       hex += count - 2;
@@ -2466,23 +2467,23 @@ gdb_update_mem (ClientData clientData, T
   switch (size)
     {
     case 1:
-      val_type = builtin_type_int8;
+      val_type = builtin_type (get_current_arch ())->builtin_int8;
       asize = 'b';
       break;
     case 2:
-      val_type = builtin_type_int16;
+      val_type = builtin_type (get_current_arch ())->builtin_int16;
       asize = 'h';
       break;
     case 4:
-      val_type = builtin_type_int32;
+      val_type = builtin_type (get_current_arch ())->builtin_int32;
       asize = 'w';
       break;
     case 8:
-      val_type = builtin_type_int64;
+      val_type = builtin_type (get_current_arch ())->builtin_int64;
       asize = 'g';
       break;
     default:
-      val_type = builtin_type_int8;
+      val_type = builtin_type (get_current_arch ())->builtin_int8;
       asize = 'b';
     }
 
@@ -3011,7 +3012,10 @@ gdb_CA_to_TAS (ClientData clientData, Tc
 
   /* This is not really correct.  Using paddr_nz() will convert to hex and
truncate 
      to 32-bits when required but will otherwise not do what we really
want. */
-  Tcl_SetStringObj (result_ptr->obj_ptr, paddr_nz (address), -1);
+  
+  Tcl_SetStringObj (result_ptr->obj_ptr,
+		    paddress (get_current_arch (), address),
+		    -1);
 
   return TCL_OK;
 }
Index: generic/gdbtk-register.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-register.c,v
retrieving revision 1.37
diff -u -p -r1.37 gdbtk-register.c
--- generic/gdbtk-register.c	25 Mar 2009 23:43:07 -0000	1.37
+++ generic/gdbtk-register.c	7 Jul 2009 12:09:08 -0000
@@ -27,6 +27,7 @@
 #include "gdb_string.h"
 #include "language.h"
 #include "valprint.h"
+#include "arch-utils.h"
 
 #include <tcl.h>
 #include "gdbtk.h"
@@ -211,7 +212,8 @@ static void
 get_register_size (int regnum, map_arg arg)
 {
   Tcl_ListObjAppendElement (gdbtk_interp, result_ptr->obj_ptr,
-			    Tcl_NewIntObj (register_size (current_gdbarch,
regnum)));
+			    Tcl_NewIntObj (register_size (get_current_arch
(),
+							  regnum)));
 }
 
 /* returns a list of valid types for a register */
@@ -224,7 +226,7 @@ get_register_types (int regnum, map_arg 
   struct type *reg_vtype;
   int i,n;
 
-  reg_vtype = register_type (current_gdbarch, regnum);
+  reg_vtype = register_type (get_current_arch (), regnum);
   
   if (TYPE_CODE (reg_vtype) == TYPE_CODE_UNION)
     {
@@ -287,7 +289,7 @@ get_register (int regnum, map_arg arg)
   
   reg_vtype = regtype[regnum];
   if (reg_vtype == NULL)
-    reg_vtype = register_type (current_gdbarch, regnum);
+    reg_vtype = register_type (get_current_arch (), regnum);
 
   if (!target_has_registers)
     {
@@ -319,10 +321,10 @@ get_register (int regnum, map_arg arg)
 
       strcpy (buf, "0x");
       ptr = buf + 2;
-      for (j = 0; j < register_size (current_gdbarch, regnum); j++)
+      for (j = 0; j < register_size (get_current_arch (), regnum); j++)
 	{
-	  int idx = ((gdbarch_byte_order (current_gdbarch) ==
BFD_ENDIAN_BIG)
-		     ? j : register_size (current_gdbarch, regnum) - 1 - j);
+	  int idx = ((gdbarch_byte_order (get_current_arch ()) ==
BFD_ENDIAN_BIG)
+		     ? j : register_size (get_current_arch (), regnum) - 1 -
j);
 	  sprintf (ptr, "%02x", (unsigned char) buffer[idx]);
 	  ptr += 2;
 	}
@@ -338,7 +340,7 @@ get_register (int regnum, map_arg arg)
 
       if ((TYPE_CODE (reg_vtype) == TYPE_CODE_UNION)
 	  && (strcmp (FIELD_NAME (TYPE_FIELD (reg_vtype, 0)), 
-		      gdbarch_register_name (current_gdbarch, regnum)) ==
0))
+		      gdbarch_register_name (get_current_arch (), regnum))
== 0))
 	{
 	  val_print (FIELD_TYPE (TYPE_FIELD (reg_vtype, 0)), buffer, 0, 0,
 		     stb, 0, &opts, current_language);
@@ -365,7 +367,7 @@ get_register_name (int regnum, map_arg a
   /* Non-zero if the caller wants the register numbers, too.  */
   int numbers = arg.integer;
   Tcl_Obj *name
-    = Tcl_NewStringObj (gdbarch_register_name (current_gdbarch, regnum),
-1);
+    = Tcl_NewStringObj (gdbarch_register_name (get_current_arch (),
regnum), -1);
   Tcl_Obj *elt;
 
   if (numbers)
@@ -398,16 +400,16 @@ map_arg_registers (Tcl_Interp *interp, i
      In this case, some entries of gdbarch_register_name will change
      depending upon the particular processor being debugged.  */
 
-  numregs = (gdbarch_num_regs (current_gdbarch)
-	     + gdbarch_num_pseudo_regs (current_gdbarch));
+  numregs = (gdbarch_num_regs (get_current_arch ())
+	     + gdbarch_num_pseudo_regs (get_current_arch ()));
 
   if (objc == 0)		/* No args, just do all the regs */
     {
       result_ptr->flags |= GDBTK_MAKES_LIST;
       for (regnum = 0; regnum < numregs; regnum++)
 	{
-	  if (gdbarch_register_name (current_gdbarch, regnum) == NULL
-	      || *(gdbarch_register_name (current_gdbarch, regnum)) == '\0')
+	  if (gdbarch_register_name (get_current_arch (), regnum) == NULL
+	      || *(gdbarch_register_name (get_current_arch (), regnum)) ==
'\0')
 	    continue;
 	  func (regnum, arg);
 	}      
@@ -451,13 +453,13 @@ register_changed_p (int regnum, map_arg 
     return;
 
   if (memcmp (&old_regs[regnum * MAX_REGISTER_SIZE], raw_buffer,
-	      register_size (current_gdbarch, regnum)) == 0)
+	      register_size (get_current_arch (), regnum)) == 0)
     return;
 
   /* Found a changed register.  Save new value and return its number. */
 
   memcpy (&old_regs[regnum * MAX_REGISTER_SIZE], raw_buffer,
-	  register_size (current_gdbarch, regnum));
+	  register_size (get_current_arch (), regnum));
 
   Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, Tcl_NewIntObj
(regnum));
 }
@@ -471,8 +473,8 @@ setup_architecture_data ()
   xfree (regformat);
   xfree (regtype);
 
-  numregs = (gdbarch_num_regs (current_gdbarch)
-	     + gdbarch_num_pseudo_regs (current_gdbarch));
+  numregs = (gdbarch_num_regs (get_current_arch ())
+	     + gdbarch_num_pseudo_regs (get_current_arch ()));
   old_regs = xcalloc (1, numregs * MAX_REGISTER_SIZE + 1);
   regformat = (int *)xcalloc (numregs, sizeof(int));
   regtype = (struct type **)xcalloc (numregs, sizeof(struct type **));
@@ -502,8 +504,8 @@ gdb_regformat (ClientData clientData, Tc
   type = (struct type *)strtol (Tcl_GetStringFromObj (objv[1], NULL), NULL,
16);  
   fm = (int)*(Tcl_GetStringFromObj (objv[2], NULL));
 
-  numregs = (gdbarch_num_regs (current_gdbarch)
-	     + gdbarch_num_pseudo_regs (current_gdbarch));
+  numregs = (gdbarch_num_regs (get_current_arch ())
+	     + gdbarch_num_pseudo_regs (get_current_arch ()));
   if (regno >= numregs)
     {
       gdbtk_set_result (interp, "Register number %d too large", regno);
@@ -534,9 +536,9 @@ gdb_reggrouplist (ClientData clientData,
       return TCL_ERROR;
     }
 
-  for (group = reggroup_next (current_gdbarch, NULL);
+  for (group = reggroup_next (get_current_arch (), NULL);
        group != NULL;
-       group = reggroup_next (current_gdbarch, group))
+       group = reggroup_next (get_current_arch (), group))
     {
       if (reggroup_type (group) == USER_REGGROUP)
 	Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
Tcl_NewStringObj (reggroup_name (group), -1));
@@ -569,9 +571,9 @@ gdb_reggroup (ClientData clientData, Tcl
       return TCL_ERROR;
     }
 
-  for (group = reggroup_next (current_gdbarch, NULL);
+  for (group = reggroup_next (get_current_arch (), NULL);
        group != NULL;
-       group = reggroup_next (current_gdbarch, group))
+       group = reggroup_next (get_current_arch (), group))
     {
       if (strcmp (groupname, reggroup_name (group)) == 0)
 	break;
@@ -580,11 +582,11 @@ gdb_reggroup (ClientData clientData, Tcl
   if (group == NULL)
     return TCL_ERROR;
 
-  num = (gdbarch_num_regs (current_gdbarch)
-	 + gdbarch_num_pseudo_regs (current_gdbarch));
+  num = (gdbarch_num_regs (get_current_arch ())
+	 + gdbarch_num_pseudo_regs (get_current_arch ()));
   for (regnum = 0; regnum < num; regnum++)
     {
-      if (gdbarch_register_reggroup_p (current_gdbarch, regnum, group))
+      if (gdbarch_register_reggroup_p (get_current_arch (), regnum, group))
 	Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, Tcl_NewIntObj
(regnum));
     }
   return TCL_OK;
Index: generic/gdbtk-stack.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-stack.c,v
retrieving revision 1.33
diff -u -p -r1.33 gdbtk-stack.c
--- generic/gdbtk-stack.c	25 Mar 2009 23:43:07 -0000	1.33
+++ generic/gdbtk-stack.c	7 Jul 2009 12:09:08 -0000
@@ -25,6 +25,7 @@
 #include "block.h"
 #include "dictionary.h"
 #include "varobj.h"
+#include "arch-utils.h"
 
 #include <tcl.h>
 #include "gdbtk.h"
@@ -211,11 +212,13 @@ gdb_get_blocks (ClientData clientData, T
 	      char *addr;
 
 	      Tcl_Obj *elt = Tcl_NewListObj (0, NULL);
-	      addr = xstrprintf ("0x%s", paddr_nz (BLOCK_START (block)));
+	      addr = xstrprintf ("%s", paddress (get_current_arch (),
+						 BLOCK_START (block)));
 	      Tcl_ListObjAppendElement (interp, elt,
 					Tcl_NewStringObj (addr, -1));
 	      free(addr);
-	      addr = xstrprintf ("0x%s", paddr_nz (BLOCK_END (block)));
+	      addr = xstrprintf ("%s", paddress (get_current_arch (),
+						 BLOCK_END (block)));
 	      Tcl_ListObjAppendElement (interp, elt,
 					Tcl_NewStringObj (addr, -1));
 	      Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, elt);
@@ -384,8 +387,10 @@ gdb_selected_block (ClientData clientDat
     {
       struct block *block;
       block = get_frame_block (get_selected_frame (NULL), 0);
-      start = xstrprintf ("0x%s", paddr_nz (BLOCK_START (block)));
-      end = xstrprintf ("0x%s", paddr_nz (BLOCK_END (block)));
+      start = xstrprintf ("%s", paddress (get_current_arch (),
+					  BLOCK_START (block)));
+      end = xstrprintf ("%s", paddress (get_current_arch (),
+					BLOCK_END (block)));
     }
 
   Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL);
@@ -420,8 +425,8 @@ gdb_selected_frame (ClientData clientDat
   else
     /* FIXME: cagney/2002-11-19: This should be using get_frame_id()
        to identify the frame and *NOT* get_frame_base().  */
-    frame = xstrprintf ("0x%s",
-	       paddr_nz (get_frame_base (get_selected_frame (NULL))));
+    frame = xstrprintf ("%s",paddress (get_current_arch (),
+			get_frame_base (get_selected_frame (NULL))));
 
   Tcl_SetStringObj (result_ptr->obj_ptr, frame, -1);
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-07-07 12:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-07 12:38 [OBV] Fix building of insight Pierre Muller

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).