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

[commit] Use VALUE_LVAL and value_contents


More testing turned these up. Note the comment "THIS IS BOGUS" that I've added in a few places - it's manipulating target ordered values using host operations. Something to cleanup later.

committed,
Andrew
2005-02-07  Andrew Cagney  <cagney@gnu.org>
 
	* cp-valprint.c, c-valprint.c, infcall.c: Use value_contents or
	value_contents_writeable, include note that there are problems.
	* breakpoint.c, infcall.c: Use VALUE_LVAL.

Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.200
diff -p -u -r1.200 breakpoint.c
--- breakpoint.c	8 Feb 2005 01:59:38 -0000	1.200
+++ breakpoint.c	8 Feb 2005 03:49:05 -0000
@@ -5821,9 +5821,10 @@ can_use_hardware_watchpoint (struct valu
 		}
 	    }
 	}
-      else if (v->lval != not_lval && deprecated_value_modifiable (v) == 0)
+      else if (VALUE_LVAL (v) != not_lval
+	       && deprecated_value_modifiable (v) == 0)
 	return 0;	/* ??? What does this represent? */
-      else if (v->lval == lval_register)
+      else if (VALUE_LVAL (v) == lval_register)
 	return 0;	/* cannot watch a register with a HW watchpoint */
     }
 
Index: c-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/c-valprint.c,v
retrieving revision 1.32
diff -p -u -r1.32 c-valprint.c
--- c-valprint.c	7 Feb 2005 23:51:02 -0000	1.32
+++ c-valprint.c	8 Feb 2005 03:49:06 -0000
@@ -551,7 +551,8 @@ c_value_print (struct value *val, struct
                   type = lookup_reference_type (real_type);
                 }
 	      /* JYG: Need to adjust pointer value. */
-              val->aligner.contents[0] -= top;
+	      /* NOTE: cagney/2005-01-02: THIS IS BOGUS.  */
+              value_contents_writeable (val)[0] -= top;
 
               /* Note: When we look up RTTI entries, we don't get any 
                  information on const or volatile attributes */
Index: cp-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/cp-valprint.c,v
retrieving revision 1.34
diff -p -u -r1.34 cp-valprint.c
--- cp-valprint.c	7 Feb 2005 23:51:03 -0000	1.34
+++ cp-valprint.c	8 Feb 2005 03:49:06 -0000
@@ -784,7 +784,8 @@ cp_print_hpacc_virtual_table_entries (st
 	  if (value_lazy (vf))
 	    (void) value_fetch_lazy (vf);
 	  /* adjust by offset */
-	  vf->aligner.contents[0] += 4 * (HP_ACC_VFUNC_START + vx);
+	  /* NOTE: cagney/2005-01-02: THIS IS BOGUS.  */
+	  value_contents_writeable (vf)[0] += 4 * (HP_ACC_VFUNC_START + vx);
 	  vf = value_ind (vf);	/* get the entry */
 	  /* make it a pointer */
 	  deprecated_set_value_type (vf, value_type (v));
Index: infcall.c
===================================================================
RCS file: /cvs/src/src/gdb/infcall.c,v
retrieving revision 1.64
diff -p -u -r1.64 infcall.c
--- infcall.c	7 Feb 2005 23:51:03 -0000	1.64
+++ infcall.c	8 Feb 2005 03:49:08 -0000
@@ -536,10 +536,11 @@ call_function_by_hand (struct value *fun
 		       this point.  */
 		    /* Go see if the actual parameter is a variable of
 		       type pointer to function or just a function.  */
-		    if (args[i]->lval == not_lval)
+		    if (VALUE_LVAL (args[i]) == not_lval)
 		      {
 			char *arg_name;
-			if (find_pc_partial_function ((CORE_ADDR) args[i]->aligner.contents[0], &arg_name, NULL, NULL))
+			/* NOTE: cagney/2005-01-02: THIS IS BOGUS.  */
+			if (find_pc_partial_function ((CORE_ADDR) value_contents (args[i])[0], &arg_name, NULL, NULL))
 			  error ("\
 You cannot use function <%s> as argument. \n\
 You must use a pointer to function type variable. Command ignored.", arg_name);

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