This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

fix libjava.jvmti/export testcase


This fixes

FAIL: events output

in the libjava testsuite.  I fixed all the warnings in this file
produced by -Wall.

Tested with 'make check'.

-- 
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/libjava-testsuite-exporttest.patch========
2006-10-16  Geoffrey Keating  <geoffk@apple.com>

	* testsuite/libjava.jvmti/natevents.cc (env): Delete.
	(ExceptionCB): Fix types for printf arguments.
	(ExceptionCatchCB): Likewise.
	(SingleStepCB): Likewise.
	(BreakpointCB): Likewise.
	(FieldAccessCB): Likewise.
	(FieldModificationCB): Likewise.
	(CompiledMethodLoadCB): Likewise.

Index: libjava/testsuite/libjava.jvmti/natevents.cc
===================================================================
--- libjava/testsuite/libjava.jvmti/natevents.cc	(revision 117786)
+++ libjava/testsuite/libjava.jvmti/natevents.cc	(working copy)
@@ -7,8 +7,6 @@
 #include "jvmti-int.h"
 #include "events.h"
 
-static jvmtiEnv *env = NULL;
-
 void
 print_events ()
 {
@@ -119,18 +117,18 @@
 	     jlocation location, jobject exception, jmethodID catch_method,
 	     jlocation catch_location)
 {
-  printf ("ExceptionCB jni_env=%p thread=%p method=%p location=%p", jni_env,
-	  thread, method, location);
-  printf (" exception=%p catch_method=%p catch_location=%p\n", exception,
-	  catch_method, catch_location);
+  printf ("ExceptionCB jni_env=%p thread=%p method=%p location=%#llx", jni_env,
+	  thread, method, (unsigned long long) location);
+  printf (" exception=%p catch_method=%p catch_location=%#llx\n", exception,
+	  catch_method, (unsigned long long) catch_location);
 }
 
 static void
 ExceptionCatchCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread,
 		  jmethodID method, jlocation location, jobject exception)
 {
-  printf ("ExceptionCatchCB jni_env=%p thread=%p method=%p location=%p",
-	  jni_env, thread, method, location);
+  printf ("ExceptionCatchCB jni_env=%p thread=%p method=%p location=%#llx",
+	  jni_env, thread, method, (unsigned long long) location);
   printf (" exception=%p\n", exception);
 }
 
@@ -138,8 +136,8 @@
 SingleStepCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread, jmethodID method,
 	      jlocation location)
 {
-  printf ("SingleStepCB jni_env=%p thread=%p method=%p location=%p\n", 
-	  jni_env, thread, method, location);
+  printf ("SingleStepCB jni_env=%p thread=%p method=%p location=%#llx\n", 
+	  jni_env, thread, method, (unsigned long long) location);
 }
 
 static void
@@ -156,8 +154,8 @@
 BreakpointCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread, jmethodID method,
 	      jlocation location)
 {
-  printf ("BreakpointCB  jni_env=%p thread=%p method=%p location=%p\n",
-	  jni_env, thread, method, location);
+  printf ("BreakpointCB  jni_env=%p thread=%p method=%p location=%#llx\n",
+	  jni_env, thread, method, (unsigned long long) location);
 }
 
 static void
@@ -165,8 +163,8 @@
 	       jmethodID method, jlocation location, jclass field_klass,
 	       jobject object, jfieldID field)
 {
-  printf ("FieldAccessCB jni_env=%p thread=%p method=%p location=%p",
-	  jni_env, thread, method, location);
+  printf ("FieldAccessCB jni_env=%p thread=%p method=%p location=%#llx",
+	  jni_env, thread, method, (unsigned long long) location);
   printf (" field_klass=%p object=%p field=%p\n", field_klass, object, field);
 }
 
@@ -177,8 +175,8 @@
 		     jvalue new_value)
 
 {
-  printf ("FieldModificationCB  jni_env=%p thread=%p method=%p location=%p",
-	  jni_env, thread, method, location);
+  printf ("FieldModificationCB  jni_env=%p thread=%p method=%p location=%#llx",
+	  jni_env, thread, method, (unsigned long long) location);
   printf (" field_klass=%p object=%p field=%p signature_type=%c", field_klass,
 	  object, field, signature_type);
   printf (" new_value=%d\n", (int) new_value.i);
@@ -218,8 +216,8 @@
 		      const jvmtiAddrLocationMap *map,
 		      const void *compile_info)
 {
-  printf ("CompiledMethodLoadCB method=%p code_size=%p code_addr=%p",
-	  method, code_size, code_addr);
+  printf ("CompiledMethodLoadCB method=%p code_size=%#x code_addr=%p",
+	  method, (unsigned) code_size, code_addr);
   printf (" map_length=%d map=%p compile_info=%p\n", (int) map_length, map,
 	  compile_info);
 }
============================================================


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