< prev index next >
src/share/vm/prims/jvmtiEnter.xsl
Print this page
rev 9019 : [mq]: format.patch
@@ -42,13 +42,10 @@
# include "oops/oop.inline.hpp"
# include "prims/jvmtiEnter.hpp"
# include "prims/jvmtiRawMonitor.hpp"
# include "prims/jvmtiUtil.hpp"
-// There are known-bad format/arg pairings in the code generated by this file.
-PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
</xsl:text>
<xsl:if test="$trace = 'Trace'">
<xsl:text>
#ifdef JVMTI_TRACE
@@ -541,12 +538,12 @@
JvmtiEnv* jvmti_env = JvmtiEnv::JvmtiEnv_from_jvmti_env(env);
if (!jvmti_env->is_valid()) {
</xsl:text>
<xsl:if test="$trace='Trace'">
<xsl:text> if (trace_flags) {
- tty->print_cr("JVMTI [%s] %s %s env=%d", curr_thread_name, func_name,
- JvmtiUtil::error_name(JVMTI_ERROR_INVALID_ENVIRONMENT), env);
+ tty->print_cr("JVMTI [%s] %s %s env=" PTR_FORMAT, curr_thread_name, func_name,
+ JvmtiUtil::error_name(JVMTI_ERROR_INVALID_ENVIRONMENT), p2i(env));
}
</xsl:text>
</xsl:if>
<xsl:text> return JVMTI_ERROR_INVALID_ENVIRONMENT;
}
@@ -758,12 +755,12 @@
}
if (!rmonitor->is_valid()) {
</xsl:text>
<xsl:apply-templates select=".." mode="traceError">
<xsl:with-param name="err">JVMTI_ERROR_INVALID_MONITOR</xsl:with-param>
- <xsl:with-param name="comment"> - not a raw monitor 0x%x</xsl:with-param>
- <xsl:with-param name="extraValue">, rmonitor</xsl:with-param>
+ <xsl:with-param name="comment"> - not a raw monitor " PTR_FORMAT "</xsl:with-param>
+ <xsl:with-param name="extraValue">, p2i(rmonitor)</xsl:with-param>
</xsl:apply-templates>
<xsl:text>
}
</xsl:text>
</xsl:template>
@@ -775,33 +772,33 @@
<xsl:text>);
if (thread_oop == NULL) {
</xsl:text>
<xsl:apply-templates select=".." mode="traceError">
<xsl:with-param name="err">JVMTI_ERROR_INVALID_THREAD</xsl:with-param>
- <xsl:with-param name="comment"> - jthread resolved to NULL - jthread = 0x%x</xsl:with-param>
- <xsl:with-param name="extraValue">, <xsl:value-of select="$name"/></xsl:with-param>
+ <xsl:with-param name="comment"> - jthread resolved to NULL - jthread = " PTR_FORMAT "</xsl:with-param>
+ <xsl:with-param name="extraValue">, p2i(<xsl:value-of select="$name"/>)</xsl:with-param>
</xsl:apply-templates>
<xsl:text>
}
if (!thread_oop->is_a(SystemDictionary::Thread_klass())) {
</xsl:text>
<xsl:apply-templates select=".." mode="traceError">
<xsl:with-param name="err">JVMTI_ERROR_INVALID_THREAD</xsl:with-param>
- <xsl:with-param name="comment"> - oop is not a thread - jthread = 0x%x</xsl:with-param>
- <xsl:with-param name="extraValue">, <xsl:value-of select="$name"/></xsl:with-param>
+ <xsl:with-param name="comment"> - oop is not a thread - jthread = " PTR_FORMAT "</xsl:with-param>
+ <xsl:with-param name="extraValue">, p2i(<xsl:value-of select="$name"/>)</xsl:with-param>
</xsl:apply-templates>
<xsl:text>
}
java_thread = java_lang_Thread::thread(thread_oop);
if (java_thread == NULL) {
</xsl:text>
<xsl:apply-templates select=".." mode="traceError">
<xsl:with-param name="err">
<xsl:text>JVMTI_ERROR_THREAD_NOT_ALIVE</xsl:text>
</xsl:with-param>
- <xsl:with-param name="comment"> - not a Java thread - jthread = 0x%x</xsl:with-param>
- <xsl:with-param name="extraValue">, <xsl:value-of select="$name"/></xsl:with-param>
+ <xsl:with-param name="comment"> - not a Java thread - jthread = " PTR_FORMAT "</xsl:with-param>
+ <xsl:with-param name="extraValue">, p2i(<xsl:value-of select="$name"/>)</xsl:with-param>
</xsl:apply-templates>
<xsl:text>
}
</xsl:text>
</xsl:template>
@@ -840,11 +837,11 @@
<xsl:text>
if (depth < 0) {
</xsl:text>
<xsl:apply-templates select=".." mode="traceError">
<xsl:with-param name="err">JVMTI_ERROR_ILLEGAL_ARGUMENT</xsl:with-param>
- <xsl:with-param name="comment"> - negative depth - jthread = 0x%x</xsl:with-param>
+ <xsl:with-param name="comment"> - negative depth - jthread = " INT32_FORMAT "</xsl:with-param>
<xsl:with-param name="extraValue">, <xsl:value-of select="$name"/></xsl:with-param>
</xsl:apply-templates>
<xsl:text>
}
</xsl:text>
@@ -859,43 +856,43 @@
<xsl:text>);
if (k_mirror == NULL) {
</xsl:text>
<xsl:apply-templates select=".." mode="traceError">
<xsl:with-param name="err">JVMTI_ERROR_INVALID_CLASS</xsl:with-param>
- <xsl:with-param name="comment"> - resolved to NULL - jclass = 0x%x</xsl:with-param>
- <xsl:with-param name="extraValue">, <xsl:value-of select="$name"/></xsl:with-param>
+ <xsl:with-param name="comment"> - resolved to NULL - jclass = " PTR_FORMAT "</xsl:with-param>
+ <xsl:with-param name="extraValue">, p2i(<xsl:value-of select="$name"/>)</xsl:with-param>
</xsl:apply-templates>
<xsl:text>
}
if (!k_mirror->is_a(SystemDictionary::Class_klass())) {
</xsl:text>
<xsl:apply-templates select=".." mode="traceError">
<xsl:with-param name="err">JVMTI_ERROR_INVALID_CLASS</xsl:with-param>
- <xsl:with-param name="comment"> - not a class - jclass = 0x%x</xsl:with-param>
- <xsl:with-param name="extraValue">, <xsl:value-of select="$name"/></xsl:with-param>
+ <xsl:with-param name="comment"> - not a class - jclass = " PTR_FORMAT "</xsl:with-param>
+ <xsl:with-param name="extraValue">, p2i(<xsl:value-of select="$name"/>)</xsl:with-param>
</xsl:apply-templates>
<xsl:text>
}
</xsl:text>
<xsl:if test="count(@method|@field)=1">
<xsl:text>
if (java_lang_Class::is_primitive(k_mirror)) {
</xsl:text>
<xsl:apply-templates select=".." mode="traceError">
<xsl:with-param name="err">JVMTI_ERROR_INVALID_CLASS</xsl:with-param>
- <xsl:with-param name="comment"> - is a primitive class - jclass = 0x%x</xsl:with-param>
- <xsl:with-param name="extraValue">, <xsl:value-of select="$name"/></xsl:with-param>
+ <xsl:with-param name="comment"> - is a primitive class - jclass = " PTR_FORMAT "</xsl:with-param>
+ <xsl:with-param name="extraValue">, p2i(<xsl:value-of select="$name"/>)</xsl:with-param>
</xsl:apply-templates>
<xsl:text>
}
Klass* k_oop = java_lang_Class::as_Klass(k_mirror);
if (k_oop == NULL) {
</xsl:text>
<xsl:apply-templates select=".." mode="traceError">
<xsl:with-param name="err">JVMTI_ERROR_INVALID_CLASS</xsl:with-param>
- <xsl:with-param name="comment"> - no Klass* - jclass = 0x%x</xsl:with-param>
- <xsl:with-param name="extraValue">, <xsl:value-of select="$name"/></xsl:with-param>
+ <xsl:with-param name="comment"> - no Klass* - jclass = " PTR_FORMAT "</xsl:with-param>
+ <xsl:with-param name="extraValue">, p2i(<xsl:value-of select="$name"/>)</xsl:with-param>
</xsl:apply-templates>
<xsl:text>
}
</xsl:text>
</xsl:if>
@@ -1032,34 +1029,42 @@
<xsl:template match="inbuf" mode="traceInFormat">
<xsl:param name="name"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$name"/>
<xsl:variable name="child" select="child::*[position()=1]"/>
- <xsl:choose>
+ <xsl:choose>g
<xsl:when test="name($child)='char'">
<xsl:text>='%s'</xsl:text>
</xsl:when>
<xsl:otherwise>
- <xsl:text>=0x%x</xsl:text>
+ <xsl:text>=" PTR_FORMAT "</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="inbuf" mode="traceInValue">
<xsl:param name="name"/>
<xsl:text>, </xsl:text>
+ <xsl:variable name="child" select="child::*[position()=1]"/>
+ <xsl:choose>
+ <xsl:when test="name($child)='char'">
<xsl:value-of select="$name"/>
+ </xsl:when>
+ <xsl:otherwise>
+ p2i(<xsl:value-of select="$name"/>)
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
<xsl:template match="ptrtype" mode="traceInFormat">
<xsl:param name="name"/>
<xsl:variable name="child" select="child::*[position()=1]"/>
<xsl:choose>
<xsl:when test="name($child)='jclass'">
<xsl:text> </xsl:text>
<xsl:value-of select="$name"/>
- <xsl:text>=0x%x</xsl:text>
+ <xsl:text>=" PTR_FORMAT "</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="$child" mode="traceInFormat"/>
</xsl:otherwise>
</xsl:choose>
@@ -1069,11 +1074,11 @@
<xsl:param name="name"/>
<xsl:variable name="child" select="child::*[position()=1]"/>
<xsl:choose>
<xsl:when test="name($child)='jclass'">
<xsl:text>, </xsl:text>
- <xsl:value-of select="$name"/>
+ p2i(<xsl:value-of select="$name"/>)
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="$child" mode="traceInValue"/>
</xsl:otherwise>
</xsl:choose>
@@ -1081,17 +1086,17 @@
<xsl:template match="inptr" mode="traceInFormat">
<xsl:param name="name"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$name"/>
- <xsl:text>=0x%x</xsl:text>
+ <xsl:text>=" PTR_FORMAT "</xsl:text>
</xsl:template>
<xsl:template match="inptr" mode="traceInValue">
<xsl:param name="name"/>
<xsl:text>, </xsl:text>
- <xsl:value-of select="$name"/>
+ p2i(<xsl:value-of select="$name"/>)
</xsl:template>
<xsl:template match="jrawMonitorID|jfieldID" mode="traceInFormat">
<xsl:param name="name"/>
<xsl:text> </xsl:text>
@@ -1212,22 +1217,29 @@
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-<xsl:template match="jint|jlocation" mode="traceInFormat">
+<xsl:template match="jint" mode="traceInFormat">
+ <xsl:param name="name"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="$name"/>
+ <xsl:text>=" INT32_FORMAT "</xsl:text>
+</xsl:template>
+
+<xsl:template match="jlocation" mode="traceInFormat">
<xsl:param name="name"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$name"/>
- <xsl:text>=%d</xsl:text>
+ <xsl:text>=" INT64_FORMAT "</xsl:text>
</xsl:template>
<xsl:template match="jlong" mode="traceInFormat">
<xsl:param name="name"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$name"/>
- <xsl:text>=%ld</xsl:text>
+ <xsl:text>=" INT64_FORMAT "</xsl:text>
</xsl:template>
<xsl:template match="size_t" mode="traceInFormat">
<xsl:param name="name"/>
<xsl:text> </xsl:text>
< prev index next >