|
|
5219fe |
diff --git a/java/HelperSDT.c b/java/HelperSDT.c
|
|
|
5219fe |
index ea08b8d..4b3271d 100644
|
|
|
5219fe |
--- a/java/HelperSDT.c
|
|
|
5219fe |
+++ b/java/HelperSDT.c
|
|
|
5219fe |
@@ -47,7 +47,7 @@ static int64_t determine_java_type(JNIEnv *env, jobject _arg, _Bool *need_free)
|
|
|
5219fe |
{
|
|
|
5219fe |
if ((*env)->IsSameObject(env, _arg, NULL)) {
|
|
|
5219fe |
*need_free = 1;
|
|
|
5219fe |
- return (int64_t) strdup("(null)"); /* need a real string to avoid user_string_warn getting upset */
|
|
|
5219fe |
+ return (int64_t) (uintptr_t) strdup("(null)"); /* need a real string to avoid user_string_warn getting upset */
|
|
|
5219fe |
}
|
|
|
5219fe |
|
|
|
5219fe |
jclass class_arg = (*env)->GetObjectClass(env, _arg);
|
|
|
5219fe |
@@ -87,7 +87,7 @@ static int64_t determine_java_type(JNIEnv *env, jobject _arg, _Bool *need_free)
|
|
|
5219fe |
(*env)->ExceptionClear(env);
|
|
|
5219fe |
/* Not a simple numeric scalar. Caller must free(). */
|
|
|
5219fe |
*need_free = true;
|
|
|
5219fe |
- return (int64_t) get_java_tostring(env, _arg);
|
|
|
5219fe |
+ return (int64_t) (uintptr_t) get_java_tostring(env, _arg);
|
|
|
5219fe |
}
|
|
|
5219fe |
|
|
|
5219fe |
static char *alloc_sargs(int64_t *sargs, _Bool *sfree, JNIEnv *env,
|
|
|
5219fe |
@@ -106,7 +106,7 @@ static void free_sargs(char *rulename, int64_t *sargs, _Bool *sfree, int num)
|
|
|
5219fe |
int i;
|
|
|
5219fe |
for (i = 0;i < num; i++)
|
|
|
5219fe |
if (sfree[i])
|
|
|
5219fe |
- free((void *) sargs[i]);
|
|
|
5219fe |
+ free((void *) (uintptr_t) sargs[i]);
|
|
|
5219fe |
free(rulename);
|
|
|
5219fe |
}
|
|
|
5219fe |
|
|
|
5219fe |
diff --git a/tapset/linux/conversions.stp b/tapset/linux/conversions.stp
|
|
|
5219fe |
index cfea83c..cfc896b 100644
|
|
|
5219fe |
--- a/tapset/linux/conversions.stp
|
|
|
5219fe |
+++ b/tapset/linux/conversions.stp
|
|
|
5219fe |
@@ -26,7 +26,8 @@ deref_fault: /* branched to from deref_string() */
|
|
|
5219fe |
* really odd in the following error message. Setting a format
|
|
|
5219fe |
* width of '1' fixes this. */
|
|
|
5219fe |
snprintf (CONTEXT->error_buffer, sizeof(CONTEXT->error_buffer),
|
|
|
5219fe |
- "kernel string copy fault at 0x%p [man error::fault]", (void *) (uintptr_t) STAP_ARG_addr);
|
|
|
5219fe |
+ "kernel string copy fault at 0x%lx [man error::fault]", (void *)
|
|
|
5219fe |
+ (unsigned long) (uintptr_t) STAP_ARG_addr);
|
|
|
5219fe |
CONTEXT->last_error = CONTEXT->error_buffer;
|
|
|
5219fe |
}
|
|
|
5219fe |
%}
|
|
|
5219fe |
@@ -67,7 +68,8 @@ function kernel_string_quoted:string (addr:long)
|
|
|
5219fe |
(char *)(uintptr_t)STAP_ARG_addr,
|
|
|
5219fe |
MAXSTRINGLEN, MAXSTRINGLEN, 1, 0, 0);
|
|
|
5219fe |
if (STAP_ARG_addr == 0 || rc < 0)
|
|
|
5219fe |
- snprintf(STAP_RETVALUE, MAXSTRINGLEN, "%p", (void *)(uintptr_t)STAP_ARG_addr);
|
|
|
5219fe |
+ snprintf(STAP_RETVALUE, MAXSTRINGLEN, "0x%lx",
|
|
|
5219fe |
+ (unsigned long)(uintptr_t)STAP_ARG_addr);
|
|
|
5219fe |
%}
|
|
|
5219fe |
|
|
|
5219fe |
/**
|
|
|
5219fe |
@@ -86,7 +88,8 @@ function kernel_string_n:string (addr:long, n:long) %{ /* pure */
|
|
|
5219fe |
if (0) {
|
|
|
5219fe |
deref_fault: /* branched to from deref_string() */
|
|
|
5219fe |
snprintf (CONTEXT->error_buffer, sizeof(CONTEXT->error_buffer),
|
|
|
5219fe |
- "kernel string copy fault at 0x%p [man error::fault]", (void *) (uintptr_t) STAP_ARG_addr);
|
|
|
5219fe |
+ "kernel string copy fault at 0x%lx [man error::fault]",
|
|
|
5219fe |
+ (unsigned long) (uintptr_t) STAP_ARG_addr);
|
|
|
5219fe |
CONTEXT->last_error = CONTEXT->error_buffer;
|
|
|
5219fe |
}
|
|
|
5219fe |
%}
|
|
|
5219fe |
@@ -110,7 +113,8 @@ function kernel_string_utf32:string (addr:long) %{ /* pure */
|
|
|
5219fe |
if ((rc = _stp_convert_utf32(destination, len, c32)) <= 0) {
|
|
|
5219fe |
if (rc < 0) {
|
|
|
5219fe |
snprintf (CONTEXT->error_buffer, sizeof(CONTEXT->error_buffer),
|
|
|
5219fe |
- "invalid UTF-32 character U+%X at 0x%p", c32, source);
|
|
|
5219fe |
+ "invalid UTF-32 character U+%X at 0x%lx", c32,
|
|
|
5219fe |
+ (unsigned long) (uintptr_t) source);
|
|
|
5219fe |
CONTEXT->last_error = CONTEXT->error_buffer;
|
|
|
5219fe |
}
|
|
|
5219fe |
break;
|
|
|
5219fe |
@@ -123,7 +127,8 @@ function kernel_string_utf32:string (addr:long) %{ /* pure */
|
|
|
5219fe |
if (0) {
|
|
|
5219fe |
deref_fault: /* branched to from deref_string() */
|
|
|
5219fe |
snprintf (CONTEXT->error_buffer, sizeof(CONTEXT->error_buffer),
|
|
|
5219fe |
- "kernel string copy fault at 0x%p [man error::fault]", source);
|
|
|
5219fe |
+ "kernel string copy fault at 0x%lx [man error::fault]",
|
|
|
5219fe |
+ (unsigned long) (uintptr_t) source);
|
|
|
5219fe |
CONTEXT->last_error = CONTEXT->error_buffer;
|
|
|
5219fe |
}
|
|
|
5219fe |
%}
|
|
|
5219fe |
@@ -189,7 +194,8 @@ function kernel_string_utf16:string (addr:long) %{ /* pure */
|
|
|
5219fe |
if ((rc = _stp_convert_utf32(destination, len, c32)) <= 0) {
|
|
|
5219fe |
if (rc < 0) {
|
|
|
5219fe |
snprintf (CONTEXT->error_buffer, sizeof(CONTEXT->error_buffer),
|
|
|
5219fe |
- "invalid UTF-16 character U+%X at 0x%p", c32, source);
|
|
|
5219fe |
+ "invalid UTF-16 character U+%X at 0x%lx", c32,
|
|
|
5219fe |
+ (unsigned long) (uintptr_t) source);
|
|
|
5219fe |
CONTEXT->last_error = CONTEXT->error_buffer;
|
|
|
5219fe |
}
|
|
|
5219fe |
break;
|
|
|
5219fe |
@@ -202,7 +208,8 @@ function kernel_string_utf16:string (addr:long) %{ /* pure */
|
|
|
5219fe |
if (0) {
|
|
|
5219fe |
deref_fault: /* branched to from deref_string() */
|
|
|
5219fe |
snprintf (CONTEXT->error_buffer, sizeof(CONTEXT->error_buffer),
|
|
|
5219fe |
- "kernel string copy fault at 0x%p [man error::fault]", source);
|
|
|
5219fe |
+ "kernel string copy fault at 0x%lx [man error::fault]",
|
|
|
5219fe |
+ (unsigned long) (uintptr_t) source);
|
|
|
5219fe |
CONTEXT->last_error = CONTEXT->error_buffer;
|
|
|
5219fe |
}
|
|
|
5219fe |
%}
|
|
|
5219fe |
@@ -249,7 +256,8 @@ function kernel_long:long (addr:long) %{ /* pure */
|
|
|
5219fe |
if (0) {
|
|
|
5219fe |
deref_fault: /* branched to from kread() */
|
|
|
5219fe |
snprintf (CONTEXT->error_buffer, sizeof(CONTEXT->error_buffer),
|
|
|
5219fe |
- "kernel long copy fault at 0x%p [man error::fault]", (void *) (uintptr_t) STAP_ARG_addr);
|
|
|
5219fe |
+ "kernel long copy fault at 0x%lx [man error::fault]",
|
|
|
5219fe |
+ (unsigned long) (uintptr_t) STAP_ARG_addr);
|
|
|
5219fe |
CONTEXT->last_error = CONTEXT->error_buffer;
|
|
|
5219fe |
}
|
|
|
5219fe |
%}
|
|
|
5219fe |
@@ -267,7 +275,8 @@ function kernel_int:long (addr:long) %{ /* pure */
|
|
|
5219fe |
if (0) {
|
|
|
5219fe |
deref_fault: /* branched to from kread() */
|
|
|
5219fe |
snprintf (CONTEXT->error_buffer, sizeof(CONTEXT->error_buffer),
|
|
|
5219fe |
- "kernel int copy fault at 0x%p [man error::fault]", (void *) (uintptr_t) STAP_ARG_addr);
|
|
|
5219fe |
+ "kernel int copy fault at 0x%lx [man error::fault]",
|
|
|
5219fe |
+ (unsigned long) (uintptr_t) STAP_ARG_addr);
|
|
|
5219fe |
CONTEXT->last_error = CONTEXT->error_buffer;
|
|
|
5219fe |
}
|
|
|
5219fe |
%}
|
|
|
5219fe |
@@ -285,7 +294,8 @@ function kernel_short:long (addr:long) %{ /* pure */
|
|
|
5219fe |
if (0) {
|
|
|
5219fe |
deref_fault: /* branched to from kread() */
|
|
|
5219fe |
snprintf (CONTEXT->error_buffer, sizeof(CONTEXT->error_buffer),
|
|
|
5219fe |
- "kernel short copy fault at 0x%p [man error::fault]", (void *) (uintptr_t) STAP_ARG_addr);
|
|
|
5219fe |
+ "kernel short copy fault at 0x%lx [man error::fault]",
|
|
|
5219fe |
+ (unsigned long) (uintptr_t) STAP_ARG_addr);
|
|
|
5219fe |
CONTEXT->last_error = CONTEXT->error_buffer;
|
|
|
5219fe |
}
|
|
|
5219fe |
%}
|
|
|
5219fe |
@@ -303,7 +313,8 @@ function kernel_char:long (addr:long) %{ /* pure */
|
|
|
5219fe |
if (0) {
|
|
|
5219fe |
deref_fault: /* branched to from kread() */
|
|
|
5219fe |
snprintf (CONTEXT->error_buffer, sizeof(CONTEXT->error_buffer),
|
|
|
5219fe |
- "kernel char copy fault at 0x%p [man error::fault]", (void *) (uintptr_t) STAP_ARG_addr);
|
|
|
5219fe |
+ "kernel char copy fault at 0x%lx [man error::fault]",
|
|
|
5219fe |
+ (unsigned long) (uintptr_t) STAP_ARG_addr);
|
|
|
5219fe |
CONTEXT->last_error = CONTEXT->error_buffer;
|
|
|
5219fe |
}
|
|
|
5219fe |
%}
|
|
|
5219fe |
@@ -322,7 +333,8 @@ function kernel_pointer:long (addr:long) %{ /* pure */
|
|
|
5219fe |
if (0) {
|
|
|
5219fe |
deref_fault: /* branched to from kread() */
|
|
|
5219fe |
snprintf (CONTEXT->error_buffer, sizeof(CONTEXT->error_buffer),
|
|
|
5219fe |
- "kernel pointer copy fault at 0x%p [man error::fault]", (void *) (uintptr_t) STAP_ARG_addr);
|
|
|
5219fe |
+ "kernel pointer copy fault at 0x%lx [man error::fault]",
|
|
|
5219fe |
+ (unsigned long) (uintptr_t) STAP_ARG_addr);
|
|
|
5219fe |
CONTEXT->last_error = CONTEXT->error_buffer;
|
|
|
5219fe |
}
|
|
|
5219fe |
%}
|
|
|
5219fe |
diff --git a/tapset/uconversions.stp b/tapset/uconversions.stp
|
|
|
5219fe |
index 1b2b52e..83790e9 100644
|
|
|
5219fe |
--- a/tapset/uconversions.stp
|
|
|
5219fe |
+++ b/tapset/uconversions.stp
|
|
|
5219fe |
@@ -126,7 +126,7 @@ function user_string_n:string (addr:long, n:long)
|
|
|
5219fe |
strlcpy(STAP_RETVALUE, "<unknown>", MAXSTRINGLEN);
|
|
|
5219fe |
snprintf (CONTEXT->error_buffer, sizeof(CONTEXT->error_buffer),
|
|
|
5219fe |
"user string copy fault %ld at 0x%lx [man error::fault]", rc,
|
|
|
5219fe |
- (uintptr_t) STAP_ARG_addr);
|
|
|
5219fe |
+ (unsigned long) (uintptr_t) STAP_ARG_addr);
|
|
|
5219fe |
CONTEXT->last_error = CONTEXT->error_buffer;
|
|
|
5219fe |
} else
|
|
|
5219fe |
STAP_RETVALUE[len - 1] = '\0';
|
|
|
5219fe |
@@ -228,8 +228,8 @@ function user_string_n_warn:string (addr:long, n:long, warn_msg:string)
|
|
|
5219fe |
// NB: using error_buffer to get local space for the warning, but we're
|
|
|
5219fe |
// not aborting, so leave last_error alone.
|
|
|
5219fe |
snprintf (CONTEXT->error_buffer, sizeof(CONTEXT->error_buffer),
|
|
|
5219fe |
- "user string copy fault 0x%ld at %lx [man error::fault]", rc,
|
|
|
5219fe |
- (void *) (uintptr_t) STAP_ARG_addr);
|
|
|
5219fe |
+ "user string copy fault %ld at 0x%lx [man error::fault]", rc,
|
|
|
5219fe |
+ (unsigned long) (uintptr_t) STAP_ARG_addr);
|
|
|
5219fe |
_stp_warn(CONTEXT->error_buffer);
|
|
|
5219fe |
strlcpy (STAP_RETVALUE, STAP_ARG_warn_msg, MAXSTRINGLEN);
|
|
|
5219fe |
} else
|
|
|
5219fe |
@@ -335,7 +335,7 @@ function user_string_n_quoted:string (addr:long, inlen:long, outlen:long)
|
|
|
5219fe |
else
|
|
|
5219fe |
#endif
|
|
|
5219fe |
snprintf(STAP_RETVALUE, MAXSTRINGLEN, "0x%lx",
|
|
|
5219fe |
- (uintptr_t)STAP_ARG_addr);
|
|
|
5219fe |
+ (unsigned long) (uintptr_t)STAP_ARG_addr);
|
|
|
5219fe |
#endif
|
|
|
5219fe |
}
|
|
|
5219fe |
}
|
|
|
5219fe |
@@ -366,7 +366,8 @@ function user_string_utf32:string (addr:long) %{ /* pure */ /* myproc-unprivileg
|
|
|
5219fe |
if ((rc = _stp_convert_utf32(destination, len, c32)) <= 0) {
|
|
|
5219fe |
if (rc < 0) {
|
|
|
5219fe |
snprintf (CONTEXT->error_buffer, sizeof(CONTEXT->error_buffer),
|
|
|
5219fe |
- "invalid UTF-32 character U+%X at 0x%lx", c32, (uintptr_t) source);
|
|
|
5219fe |
+ "invalid UTF-32 character U+%X at 0x%lx", c32,
|
|
|
5219fe |
+ (unsigned long) (uintptr_t) source);
|
|
|
5219fe |
CONTEXT->last_error = CONTEXT->error_buffer;
|
|
|
5219fe |
}
|
|
|
5219fe |
break;
|
|
|
5219fe |
@@ -379,7 +380,8 @@ function user_string_utf32:string (addr:long) %{ /* pure */ /* myproc-unprivileg
|
|
|
5219fe |
if (0) {
|
|
|
5219fe |
deref_fault: /* branched to from deref_string() */
|
|
|
5219fe |
snprintf (CONTEXT->error_buffer, sizeof(CONTEXT->error_buffer),
|
|
|
5219fe |
- "user string copy fault at 0x%lx [man error::fault]", (uintptr_t) source);
|
|
|
5219fe |
+ "user string copy fault at 0x%lx [man error::fault]",
|
|
|
5219fe |
+ (unsigned long) (uintptr_t) source);
|
|
|
5219fe |
CONTEXT->last_error = CONTEXT->error_buffer;
|
|
|
5219fe |
}
|
|
|
5219fe |
%}
|
|
|
5219fe |
@@ -447,7 +449,8 @@ function user_string_utf16:string (addr:long) %{ /* pure */ /* myproc-unprivileg
|
|
|
5219fe |
if ((rc = _stp_convert_utf32(destination, len, c32)) <= 0) {
|
|
|
5219fe |
if (rc < 0) {
|
|
|
5219fe |
snprintf (CONTEXT->error_buffer, sizeof(CONTEXT->error_buffer),
|
|
|
5219fe |
- "invalid UTF-16 character U+%X at 0x%lx", c32, source);
|
|
|
5219fe |
+ "invalid UTF-16 character U+%X at 0x%lx", c32,
|
|
|
5219fe |
+ (unsigned long) (uintptr_t) source);
|
|
|
5219fe |
CONTEXT->last_error = CONTEXT->error_buffer;
|
|
|
5219fe |
}
|
|
|
5219fe |
break;
|
|
|
5219fe |
@@ -460,7 +463,8 @@ function user_string_utf16:string (addr:long) %{ /* pure */ /* myproc-unprivileg
|
|
|
5219fe |
if (0) {
|
|
|
5219fe |
deref_fault: /* branched to from deref_string() */
|
|
|
5219fe |
snprintf (CONTEXT->error_buffer, sizeof(CONTEXT->error_buffer),
|
|
|
5219fe |
- "user string copy fault at 0x%lx [man error::fault]", (uintptr_t) source);
|
|
|
5219fe |
+ "user string copy fault at 0x%lx [man error::fault]",
|
|
|
5219fe |
+ (unsigned long) (uintptr_t) source);
|
|
|
5219fe |
CONTEXT->last_error = CONTEXT->error_buffer;
|
|
|
5219fe |
}
|
|
|
5219fe |
%}
|
|
|
5219fe |
@@ -532,7 +536,7 @@ function user_char_warn:long (addr:long) {
|
|
|
5219fe |
try {
|
|
|
5219fe |
return user_char_error(addr)
|
|
|
5219fe |
} catch {
|
|
|
5219fe |
- warn(sprintf("user char copy fault %p [man error::fault]",
|
|
|
5219fe |
+ warn(sprintf("user char copy fault at %p [man error::fault]",
|
|
|
5219fe |
addr))
|
|
|
5219fe |
return 0
|
|
|
5219fe |
}
|