]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Added a useful skin instrumentation function.
authorNicholas Nethercote <njn@valgrind.org>
Mon, 24 Feb 2003 10:32:51 +0000 (10:32 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Mon, 24 Feb 2003 10:32:51 +0000 (10:32 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1433

coregrind/vg_instrument.c
include/vg_skin.h

index 80dd5f0564506eaee100d9c021cc8270aa209434..6bb425f92bff0cf37e5e1aa0df6200bfa7684230 100644 (file)
@@ -84,6 +84,15 @@ void VG_(set_global_var)(UCodeBlock* cb, Addr globvar_ptr, UInt val)
    uInstr2(cb, STORE, 4, TempReg, t_val, TempReg, t_gv);
 }
 
+void VG_(set_global_var_tempreg)(UCodeBlock* cb, Addr globvar_ptr, UInt t_val)
+{
+   Int t_gv  = newTemp(cb);        
+
+   uInstr2(cb, MOV,   4, Literal, 0, TempReg, t_gv);
+   uLiteral(cb, globvar_ptr);
+   uInstr2(cb, STORE, 4, TempReg, t_val, TempReg, t_gv);
+}
+
 /*--------------------------------------------------------------------*/
 /*--- end                                          vg_instrument.c ---*/
 /*--------------------------------------------------------------------*/
index 43702fa9b03e7b83b1c834b046e96be6fd309868..44643941f866f6c29f5f7bc1b691d6e4e1e8b1cb 100644 (file)
@@ -812,9 +812,13 @@ extern void VG_(call_helper_2_0) ( UCodeBlock* cb, Addr f, UInt arg1, UInt arg2,
                                    UInt regparms_n);
 
 /* One way around the 3-arg C function limit is to pass args via global
- * variables... ugly, but it works. */
+ * variables... ugly, but it works.  This one puts a literal in there. */
 extern void VG_(set_global_var) ( UCodeBlock* cb, Addr globvar_ptr, UInt val);
 
+/* This one puts the contents of a TempReg in the global variable. */
+extern void VG_(set_global_var_tempreg) ( UCodeBlock* cb, Addr globvar_ptr,
+                                          UInt t_val);
+
 /* ------------------------------------------------------------------ */
 /* Allocating/freeing basic blocks of UCode */
 extern UCodeBlock* VG_(setup_UCodeBlock) ( UCodeBlock* cb );