This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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]

[rfc] [2/4] Remove macro TARGET_ADDR_BIT


Hello,

this patch removes TARGET_ADDR_BIT macro from gdbarch.sh.

ChangeLog:

	* gdbarch.sh (TARGET_ADDR_BIT): Replace by gdbarch_addr_bit.
	* valops.c (value_cast): Likewise.
	* utils.c (strlen_paddr, paddr, paddr_nz, paddress): Likewise.
	* ui-out.c (ui_out_field_core_addr): Likewise.
	* tracepoint.c (tracepoints_info): Likewise.
	* symtab.c (print_msymbol_info): Likewise.
	* solib-irix.c (irix_current_sos)
	(irix_open_symbol_file_object): Likewise.
	* remote.c (build_remote_gdbarch_data): Likewise.
	* prologue-value.c (make_pv_area): Likewise.
	* procfs.c (info_mappings_callback): Likewise.
	* printcmd.c (print_scalar_formatted)
	(deprecated_print_address_numeric): Likewise.
	* memattr.c (mem_info_command): Likewise.
	* linux-nat.c (linux_nat_info_proc_cmd): Likewise.
	* gdbtypes.c (build_flt, gdbtypes_post_init): Likewise.
	* exec.c (print_section_info): Likewise.
	* dwarf2read.c (read_subrange_type): Likewise.
	* dwarf2loc.c (find_location_expression): Likewise.
	* dwarf2expr.c (dwarf2_read_address, unsigned_address_type)
	(signed_address_type, execute_stack_op): Likewise.
	* breakpoint.c (print_one_breakpoint, breakpoint_1): Likewise.
	* gdbarch.c, gdbarch.h: Regenerate.



Is this ok to commit?

--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com


diff -urN src.1/gdb/breakpoint.c dev/gdb/breakpoint.c
--- src.1/gdb/breakpoint.c	2007-06-13 17:12:31.000000000 +0200
+++ dev/gdb/breakpoint.c	2007-06-13 17:12:39.000000000 +0200
@@ -3443,7 +3443,7 @@
   strcpy (wrap_indent, "                           ");
   if (addressprint)
     {
-      if (TARGET_ADDR_BIT <= 32)
+      if (gdbarch_addr_bit (current_gdbarch) <= 32)
 	strcat (wrap_indent, "           ");
       else
 	strcat (wrap_indent, "                   ");
@@ -3802,7 +3802,7 @@
 	{
 	  if (nr_printable_breakpoints > 0)
 	    annotate_field (4);
-	  if (TARGET_ADDR_BIT <= 32)
+	  if (gdbarch_addr_bit (current_gdbarch) <= 32)
 	    ui_out_table_header (uiout, 10, ui_left, "addr", "Address");/* 5 */
 	  else
 	    ui_out_table_header (uiout, 18, ui_left, "addr", "Address");/* 5 */
diff -urN src.1/gdb/dwarf2expr.c dev/gdb/dwarf2expr.c
--- src.1/gdb/dwarf2expr.c	2007-05-18 21:42:42.000000000 +0200
+++ dev/gdb/dwarf2expr.c	2007-06-13 17:12:39.000000000 +0200
@@ -202,10 +202,10 @@
 {
   CORE_ADDR result;
 
-  if (buf_end - buf < TARGET_ADDR_BIT / TARGET_CHAR_BIT)
+  if (buf_end - buf < gdbarch_addr_bit (current_gdbarch) / TARGET_CHAR_BIT)
     error (_("dwarf2_read_address: Corrupted DWARF expression."));
 
-  *bytes_read = TARGET_ADDR_BIT / TARGET_CHAR_BIT;
+  *bytes_read = gdbarch_addr_bit (current_gdbarch) / TARGET_CHAR_BIT;
 
   /* For most architectures, calling extract_unsigned_integer() alone
      is sufficient for extracting an address.  However, some
@@ -233,7 +233,8 @@
 			      (unsigned_address_type (),
 			       extract_unsigned_integer 
 				 (buf,
-				  TARGET_ADDR_BIT / TARGET_CHAR_BIT)));
+				  gdbarch_addr_bit (current_gdbarch)
+				    / TARGET_CHAR_BIT)));
 
   return result;
 }
@@ -243,7 +244,7 @@
 static struct type *
 unsigned_address_type (void)
 {
-  switch (TARGET_ADDR_BIT / TARGET_CHAR_BIT)
+  switch (gdbarch_addr_bit (current_gdbarch) / TARGET_CHAR_BIT)
     {
     case 2:
       return builtin_type_uint16;
@@ -262,7 +263,7 @@
 static struct type *
 signed_address_type (void)
 {
-  switch (TARGET_ADDR_BIT / TARGET_CHAR_BIT)
+  switch (gdbarch_addr_bit (current_gdbarch) / TARGET_CHAR_BIT)
     {
     case 2:
       return builtin_type_int16;
@@ -550,13 +551,16 @@
 	    {
 	    case DW_OP_deref:
 	      {
-		gdb_byte *buf = alloca (TARGET_ADDR_BIT / TARGET_CHAR_BIT);
+		gdb_byte *buf = alloca (gdbarch_addr_bit (current_gdbarch)
+					  / TARGET_CHAR_BIT);
 		int bytes_read;
 
 		(ctx->read_mem) (ctx->baton, buf, result,
-				 TARGET_ADDR_BIT / TARGET_CHAR_BIT);
+				 gdbarch_addr_bit (current_gdbarch)
+				   / TARGET_CHAR_BIT);
 		result = dwarf2_read_address (buf,
-					      buf + (TARGET_ADDR_BIT
+					      buf + (gdbarch_addr_bit
+						       (current_gdbarch)
 						     / TARGET_CHAR_BIT),
 					      &bytes_read);
 	      }
@@ -564,12 +568,15 @@
 
 	    case DW_OP_deref_size:
 	      {
-		gdb_byte *buf = alloca (TARGET_ADDR_BIT / TARGET_CHAR_BIT);
+		gdb_byte *buf
+		   = alloca (gdbarch_addr_bit (current_gdbarch)
+			      / TARGET_CHAR_BIT);
 		int bytes_read;
 
 		(ctx->read_mem) (ctx->baton, buf, result, *op_ptr++);
 		result = dwarf2_read_address (buf,
-					      buf + (TARGET_ADDR_BIT
+					      buf + (gdbarch_addr_bit
+						      (current_gdbarch)
 						     / TARGET_CHAR_BIT),
 					      &bytes_read);
 	      }
diff -urN src.1/gdb/dwarf2loc.c dev/gdb/dwarf2loc.c
--- src.1/gdb/dwarf2loc.c	2007-06-12 18:59:38.000000000 +0200
+++ dev/gdb/dwarf2loc.c	2007-06-13 17:12:39.000000000 +0200
@@ -55,7 +55,7 @@
   CORE_ADDR low, high;
   gdb_byte *loc_ptr, *buf_end;
   int length;
-  unsigned int addr_size = TARGET_ADDR_BIT / TARGET_CHAR_BIT;
+  unsigned int addr_size = gdbarch_addr_bit (current_gdbarch) / TARGET_CHAR_BIT;
   CORE_ADDR base_mask = ~(~(CORE_ADDR)1 << (addr_size * 8 - 1));
   /* Adjust base_address for relocatable objects.  */
   CORE_ADDR base_offset = ANOFFSET (baton->objfile->section_offsets,
diff -urN src.1/gdb/dwarf2read.c dev/gdb/dwarf2read.c
--- src.1/gdb/dwarf2read.c	2007-06-12 18:59:38.000000000 +0200
+++ dev/gdb/dwarf2read.c	2007-06-13 17:12:39.000000000 +0200
@@ -4930,7 +4930,9 @@
     {
       complaint (&symfile_complaints,
                 _("DW_AT_type missing from DW_TAG_subrange_type"));
-      base_type = dwarf_base_type (DW_ATE_signed, TARGET_ADDR_BIT / 8, cu);
+      base_type
+	= dwarf_base_type (DW_ATE_signed,
+			   gdbarch_addr_bit (current_gdbarch) / 8, cu);
     }
 
   if (cu->language == language_fortran)
diff -urN src.1/gdb/exec.c dev/gdb/exec.c
--- src.1/gdb/exec.c	2007-02-09 21:11:47.000000000 +0100
+++ dev/gdb/exec.c	2007-06-13 17:12:39.000000000 +0200
@@ -532,8 +532,8 @@
 print_section_info (struct target_ops *t, bfd *abfd)
 {
   struct section_table *p;
-  /* FIXME: 16 is not wide enough when TARGET_ADDR_BIT > 64.  */
-  int wid = TARGET_ADDR_BIT <= 32 ? 8 : 16;
+  /* FIXME: 16 is not wide enough when gdbarch_addr_bit > 64.  */
+  int wid = gdbarch_addr_bit (current_gdbarch) <= 32 ? 8 : 16;
 
   printf_filtered ("\t`%s', ", bfd_get_filename (abfd));
   wrap_here ("        ");
diff -urN src.1/gdb/gdbarch.c dev/gdb/gdbarch.c
--- src.1/gdb/gdbarch.c	2007-06-13 17:12:31.000000000 +0200
+++ dev/gdb/gdbarch.c	2007-06-13 17:12:39.000000000 +0200
@@ -650,11 +650,6 @@
   fprintf_unfiltered (file,
                       "gdbarch_dump: GDB_TM_FILE = %s\n",
                       gdb_tm_file);
-#ifdef TARGET_ADDR_BIT
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_ADDR_BIT # %s\n",
-                      XSTRING (TARGET_ADDR_BIT));
-#endif
   fprintf_unfiltered (file,
                       "gdbarch_dump: addr_bit = %s\n",
                       paddr_d (current_gdbarch->addr_bit));
diff -urN src.1/gdb/gdbarch.h dev/gdb/gdbarch.h
--- src.1/gdb/gdbarch.h	2007-06-13 17:12:31.000000000 +0200
+++ dev/gdb/gdbarch.h	2007-06-13 17:12:39.000000000 +0200
@@ -130,10 +130,10 @@
 
 /* For most targets, a pointer on the target and its representation as an
    address in GDB have the same size and "look the same".  For such a
-   target, you need only set TARGET_PTR_BIT / ptr_bit and TARGET_ADDR_BIT
+   target, you need only set TARGET_PTR_BIT / ptr_bit and gdbarch_addr_bit
    / addr_bit will be set from it.
   
-   If TARGET_PTR_BIT and TARGET_ADDR_BIT are different, you'll probably
+   If TARGET_PTR_BIT and gdbarch_addr_bit are different, you'll probably
    also need to set gdbarch_pointer_to_address and gdbarch_address_to_pointer
    as well.
   
@@ -152,12 +152,6 @@
 
 extern int gdbarch_addr_bit (struct gdbarch *gdbarch);
 extern void set_gdbarch_addr_bit (struct gdbarch *gdbarch, int addr_bit);
-#if !defined (GDB_TM_FILE) && defined (TARGET_ADDR_BIT)
-#error "Non multi-arch definition of TARGET_ADDR_BIT"
-#endif
-#if !defined (TARGET_ADDR_BIT)
-#define TARGET_ADDR_BIT (gdbarch_addr_bit (current_gdbarch))
-#endif
 
 /* Number of bits in a BFD_VMA for the target object file format. */
 
diff -urN src.1/gdb/gdbarch.sh dev/gdb/gdbarch.sh
--- src.1/gdb/gdbarch.sh	2007-06-13 17:12:31.000000000 +0200
+++ dev/gdb/gdbarch.sh	2007-06-13 17:12:39.000000000 +0200
@@ -403,17 +403,17 @@
 
 # For most targets, a pointer on the target and its representation as an
 # address in GDB have the same size and "look the same".  For such a
-# target, you need only set TARGET_PTR_BIT / ptr_bit and TARGET_ADDR_BIT
+# target, you need only set TARGET_PTR_BIT / ptr_bit and gdbarch_addr_bit
 # / addr_bit will be set from it.
 #
-# If TARGET_PTR_BIT and TARGET_ADDR_BIT are different, you'll probably
+# If TARGET_PTR_BIT and gdbarch_addr_bit are different, you'll probably
 # also need to set gdbarch_pointer_to_address and gdbarch_address_to_pointer
 # as well.
 #
 # ptr_bit is the size of a pointer on the target
 v:TARGET_PTR_BIT:int:ptr_bit:::8 * sizeof (void*):current_gdbarch->int_bit::0
 # addr_bit is the size of a target address as represented in gdb
-v:TARGET_ADDR_BIT:int:addr_bit:::8 * sizeof (void*):0:TARGET_PTR_BIT:
+v::int:addr_bit:::8 * sizeof (void*):0:TARGET_PTR_BIT:
 # Number of bits in a BFD_VMA for the target object file format.
 v:TARGET_BFD_VMA_BIT:int:bfd_vma_bit:::8 * sizeof (void*):TARGET_ARCHITECTURE->bits_per_address::0
 #
diff -urN src.1/gdb/gdbtypes.c dev/gdb/gdbtypes.c
--- src.1/gdb/gdbtypes.c	2007-06-12 18:37:17.000000000 +0200
+++ dev/gdb/gdbtypes.c	2007-06-13 17:12:39.000000000 +0200
@@ -3574,7 +3574,7 @@
   builtin_type_void_func_ptr
     = lookup_pointer_type (lookup_function_type (builtin_type_void));
   builtin_type_CORE_ADDR =
-    init_type (TYPE_CODE_INT, TARGET_ADDR_BIT / 8,
+    init_type (TYPE_CODE_INT, gdbarch_addr_bit (current_gdbarch) / 8,
 	       TYPE_FLAG_UNSIGNED,
 	       "__CORE_ADDR", (struct objfile *) NULL);
   builtin_type_bfd_vma =
@@ -3725,7 +3725,7 @@
   builtin_type->builtin_func_ptr
     = lookup_pointer_type (lookup_function_type (builtin_type->builtin_void));
   builtin_type->builtin_core_addr =
-    init_type (TYPE_CODE_INT, TARGET_ADDR_BIT / 8,
+    init_type (TYPE_CODE_INT, gdbarch_addr_bit (current_gdbarch) / 8,
 	       TYPE_FLAG_UNSIGNED,
 	       "__CORE_ADDR", (struct objfile *) NULL);
 
diff -urN src.1/gdb/linux-nat.c dev/gdb/linux-nat.c
--- src.1/gdb/linux-nat.c	2007-06-11 11:31:57.000000000 +0200
+++ dev/gdb/linux-nat.c	2007-06-13 17:12:39.000000000 +0200
@@ -2862,7 +2862,7 @@
 	  char permissions[8], device[8], filename[MAXPATHLEN];
 
 	  printf_filtered (_("Mapped address spaces:\n\n"));
-	  if (TARGET_ADDR_BIT == 32)
+	  if (gdbarch_addr_bit (current_gdbarch) == 32)
 	    {
 	      printf_filtered ("\t%10s %10s %10s %10s %7s\n",
 			   "Start Addr",
@@ -2888,7 +2888,7 @@
 		 a generic local_address_string instead to print out
 		 the addresses; that makes sense to me, too.  */
 
-	      if (TARGET_ADDR_BIT == 32)
+	      if (gdbarch_addr_bit (current_gdbarch) == 32)
 	        {
 	          printf_filtered ("\t%#10lx %#10lx %#10x %#10x %7s\n",
 			       (unsigned long) addr,	/* FIXME: pr_addr */
diff -urN src.1/gdb/memattr.c dev/gdb/memattr.c
--- src.1/gdb/memattr.c	2007-01-09 18:58:52.000000000 +0100
+++ dev/gdb/memattr.c	2007-06-13 17:12:39.000000000 +0200
@@ -434,10 +434,10 @@
   printf_filtered ("Num ");
   printf_filtered ("Enb ");
   printf_filtered ("Low Addr   ");
-  if (TARGET_ADDR_BIT > 32)
+  if (gdbarch_addr_bit (current_gdbarch) > 32)
     printf_filtered ("        ");
   printf_filtered ("High Addr  ");
-  if (TARGET_ADDR_BIT > 32)
+  if (gdbarch_addr_bit (current_gdbarch) > 32)
     printf_filtered ("        ");
   printf_filtered ("Attrs ");
   printf_filtered ("\n");
@@ -448,14 +448,14 @@
       printf_filtered ("%-3d %-3c\t",
 		       m->number,
 		       m->enabled_p ? 'y' : 'n');
-      if (TARGET_ADDR_BIT <= 32)
+      if (gdbarch_addr_bit (current_gdbarch) <= 32)
 	tmp = hex_string_custom ((unsigned long) m->lo, 8);
       else
 	tmp = hex_string_custom ((unsigned long) m->lo, 16);
       
       printf_filtered ("%s ", tmp);
 
-      if (TARGET_ADDR_BIT <= 32)
+      if (gdbarch_addr_bit (current_gdbarch) <= 32)
 	{
 	if (m->hi == 0)
 	  tmp = "0x100000000";
diff -urN src.1/gdb/printcmd.c dev/gdb/printcmd.c
--- src.1/gdb/printcmd.c	2007-06-11 11:31:58.000000000 +0200
+++ dev/gdb/printcmd.c	2007-06-13 17:12:39.000000000 +0200
@@ -346,9 +346,9 @@
 
   /* If the value is a pointer, and pointers and addresses are not the
      same, then at this point, the value's length (in target bytes) is
-     TARGET_ADDR_BIT/TARGET_CHAR_BIT, not TYPE_LENGTH (type).  */
+     gdbarch_addr_bit/TARGET_CHAR_BIT, not TYPE_LENGTH (type).  */
   if (TYPE_CODE (type) == TYPE_CODE_PTR)
-    len = TARGET_ADDR_BIT / TARGET_CHAR_BIT;
+    len = gdbarch_addr_bit (current_gdbarch) / TARGET_CHAR_BIT;
 
   /* If we are printing it as unsigned, truncate it in case it is actually
      a negative signed value (e.g. "print/u (short)-1" should print 65535
@@ -669,7 +669,7 @@
     fputs_filtered (paddress (addr), stream);
   else
     {
-      int addr_bit = TARGET_ADDR_BIT;
+      int addr_bit = gdbarch_addr_bit (current_gdbarch);
 
       if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
 	addr &= ((CORE_ADDR) 1 << addr_bit) - 1;
diff -urN src.1/gdb/procfs.c dev/gdb/procfs.c
--- src.1/gdb/procfs.c	2007-06-08 05:38:51.000000000 +0200
+++ dev/gdb/procfs.c	2007-06-13 17:12:39.000000000 +0200
@@ -5735,7 +5735,7 @@
 {
   char *data_fmt_string;
 
-  if (TARGET_ADDR_BIT == 32)
+  if (gdbarch_addr_bit (current_gdbarch) == 32)
     data_fmt_string   = "\t%#10lx %#10lx %#10x %#10x %7s\n";
   else
     data_fmt_string   = "  %#18lx %#18lx %#10x %#10x %7s\n";
diff -urN src.1/gdb/prologue-value.c dev/gdb/prologue-value.c
--- src.1/gdb/prologue-value.c	2007-01-09 18:58:56.000000000 +0100
+++ dev/gdb/prologue-value.c	2007-06-13 17:12:39.000000000 +0200
@@ -330,7 +330,8 @@
 
   /* Remember that shift amounts equal to the type's width are
      undefined.  */
-  a->addr_mask = ((((CORE_ADDR) 1 << (TARGET_ADDR_BIT - 1)) - 1) << 1) | 1;
+  a->addr_mask = ((((CORE_ADDR) 1
+		   << (gdbarch_addr_bit (current_gdbarch) - 1)) - 1) << 1) | 1;
 
   return a;
 }
diff -urN src.1/gdb/remote.c dev/gdb/remote.c
--- src.1/gdb/remote.c	2007-06-13 17:12:31.000000000 +0200
+++ dev/gdb/remote.c	2007-06-13 17:12:40.000000000 +0200
@@ -6411,7 +6411,7 @@
 static void
 build_remote_gdbarch_data (void)
 {
-  remote_address_size = TARGET_ADDR_BIT;
+  remote_address_size = gdbarch_addr_bit (current_gdbarch);
 }
 
 /* Function to be called whenever a new objfile (shlib) is detected.  */
diff -urN src.1/gdb/solib-irix.c dev/gdb/solib-irix.c
--- src.1/gdb/solib-irix.c	2007-01-09 18:58:58.000000000 +0100
+++ dev/gdb/solib-irix.c	2007-06-13 17:12:40.000000000 +0200
@@ -503,8 +503,12 @@
 	return 0;
     }
 
-  read_memory (debug_base, addr_buf, TARGET_ADDR_BIT / TARGET_CHAR_BIT);
-  lma = extract_mips_address (addr_buf, TARGET_ADDR_BIT / TARGET_CHAR_BIT);
+  read_memory (debug_base,
+	       addr_buf,
+	       gdbarch_addr_bit (current_gdbarch) / TARGET_CHAR_BIT);
+  lma = extract_mips_address (addr_buf,
+			      gdbarch_addr_bit (current_gdbarch)
+				/ TARGET_CHAR_BIT);
 
   while (lma)
     {
@@ -605,8 +609,12 @@
     return 0;			/* failed somehow...  */
 
   /* First link map member should be the executable.  */
-  read_memory (debug_base, addr_buf, TARGET_ADDR_BIT / TARGET_CHAR_BIT);
-  lma = extract_mips_address (addr_buf, TARGET_ADDR_BIT / TARGET_CHAR_BIT);
+  read_memory (debug_base,
+	       addr_buf,
+	       gdbarch_addr_bit (current_gdbarch) / TARGET_CHAR_BIT);
+  lma = extract_mips_address (addr_buf,
+			      gdbarch_addr_bit (current_gdbarch)
+				/ TARGET_CHAR_BIT);
   if (lma == 0)
     return 0;			/* failed somehow...  */
 
diff -urN src.1/gdb/symtab.c dev/gdb/symtab.c
--- src.1/gdb/symtab.c	2007-06-11 11:31:58.000000000 +0200
+++ dev/gdb/symtab.c	2007-06-13 17:12:40.000000000 +0200
@@ -3246,7 +3246,7 @@
 {
   char *tmp;
 
-  if (TARGET_ADDR_BIT <= 32)
+  if (gdbarch_addr_bit (current_gdbarch) <= 32)
     tmp = hex_string_custom (SYMBOL_VALUE_ADDRESS (msymbol)
 			     & (CORE_ADDR) 0xffffffff,
 			     8);
diff -urN src.1/gdb/tracepoint.c dev/gdb/tracepoint.c
--- src.1/gdb/tracepoint.c	2007-06-12 18:53:26.000000000 +0200
+++ dev/gdb/tracepoint.c	2007-06-13 17:12:40.000000000 +0200
@@ -480,7 +480,7 @@
 	  printf_filtered ("Num Enb ");
 	  if (addressprint)
 	    {
-	      if (TARGET_ADDR_BIT <= 32)
+	      if (gdbarch_addr_bit (current_gdbarch) <= 32)
 		printf_filtered ("Address    ");
 	      else
 		printf_filtered ("Address            ");
@@ -490,7 +490,7 @@
       strcpy (wrap_indent, "                           ");
       if (addressprint)
 	{
-	  if (TARGET_ADDR_BIT <= 32)
+	  if (gdbarch_addr_bit (current_gdbarch) <= 32)
 	    strcat (wrap_indent, "           ");
 	  else
 	    strcat (wrap_indent, "                   ");
@@ -502,7 +502,7 @@
 	{
 	  char *tmp;
 
-	  if (TARGET_ADDR_BIT <= 32)
+	  if (gdbarch_addr_bit (current_gdbarch) <= 32)
 	    tmp = hex_string_custom (t->address & (CORE_ADDR) 0xffffffff, 
 				     8);
 	  else
diff -urN src.1/gdb/ui-out.c dev/gdb/ui-out.c
--- src.1/gdb/ui-out.c	2007-03-26 15:54:30.000000000 +0200
+++ dev/gdb/ui-out.c	2007-06-13 17:12:40.000000000 +0200
@@ -493,7 +493,7 @@
 			CORE_ADDR address)
 {
   char addstr[20];
-  int addr_bit = TARGET_ADDR_BIT;
+  int addr_bit = gdbarch_addr_bit (current_gdbarch);
 
   /* Truncate address to match deprecated_print_address_numeric().  */
   if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
@@ -501,7 +501,7 @@
 
   /* FIXME: cagney/2002-05-03: Need local_address_string() function
      that returns the language localized string formatted to a width
-     based on TARGET_ADDR_BIT.  */
+     based on gdbarch_addr_bit.  */
   /* deprecated_print_address_numeric (address, 1, local_stream); */
   if (addr_bit <= 32)
     strcpy (addstr, hex_string_custom (address, 8));
diff -urN src.1/gdb/utils.c dev/gdb/utils.c
--- src.1/gdb/utils.c	2007-06-08 05:38:51.000000000 +0200
+++ dev/gdb/utils.c	2007-06-13 17:12:40.000000000 +0200
@@ -2535,19 +2535,19 @@
 int
 strlen_paddr (void)
 {
-  return (TARGET_ADDR_BIT / 8 * 2);
+  return (gdbarch_addr_bit (current_gdbarch) / 8 * 2);
 }
 
 char *
 paddr (CORE_ADDR addr)
 {
-  return phex (addr, TARGET_ADDR_BIT / 8);
+  return phex (addr, gdbarch_addr_bit (current_gdbarch) / 8);
 }
 
 char *
 paddr_nz (CORE_ADDR addr)
 {
-  return phex_nz (addr, TARGET_ADDR_BIT / 8);
+  return phex_nz (addr, gdbarch_addr_bit (current_gdbarch) / 8);
 }
 
 const char *
@@ -2562,7 +2562,7 @@
      either zero or sign extended.  Should gdbarch_address_to_pointer or
      some ADDRESS_TO_PRINTABLE() be used to do the conversion?  */
 
-  int addr_bit = TARGET_ADDR_BIT;
+  int addr_bit = gdbarch_addr_bit (current_gdbarch);
 
   if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
     addr &= ((CORE_ADDR) 1 << addr_bit) - 1;
diff -urN src.1/gdb/valops.c dev/gdb/valops.c
--- src.1/gdb/valops.c	2007-06-12 18:53:26.000000000 +0200
+++ dev/gdb/valops.c	2007-06-13 17:12:40.000000000 +0200
@@ -402,7 +402,7 @@
 	 otherwise occur when dealing with a target having two byte
 	 pointers and four byte addresses.  */
 
-      int addr_bit = TARGET_ADDR_BIT;
+      int addr_bit = gdbarch_addr_bit (current_gdbarch);
 
       LONGEST longest = value_as_long (arg2);
       if (addr_bit < sizeof (LONGEST) * HOST_CHAR_BIT)

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