Skip to content

Commit

Permalink
The changes reflect the feature request eclipse-openj9#16416.
Browse files Browse the repository at this point in the history
Instead of printing the memory address for string arguments, print the actual string at max of 255 characters.

Closes: eclipse-openj9#16416
Signed-off-by: Nick Kamal <[email protected]>
  • Loading branch information
h3110n3rv3 committed Nov 20, 2024
1 parent ae49bd0 commit 9941812
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions runtime/rastrace/method_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,12 +487,12 @@ traceMethodArgObject(J9VMThread *thr, UDATA* arg0EA, char* cursor, UDATA length)

J9InternalVMFunctions const * const vmFuncs = thr->javaVM->internalVMFunctions;
char *stringArgUTF8 = vmFuncs->copyStringToUTF8WithMemAlloc(thr, object, J9_STR_NULL_TERMINATE_RESULT, " ", 2, stringArgBuffer, DEFAULT_STRING_LENGTH, NULL);
stringArgUTF8[DEFAULT_STRING_LENGTH - 1] = '\0';
stringArgUTF8[DEFAULT_STRING_LENGTH - 1] = '\0';

if(DEFAULT_STRING_LENGTH - 1 == strlen(stringArgUTF8)) {
stringArgUTF8[DEFAULT_STRING_LENGTH - 4] = '.';
stringArgUTF8[DEFAULT_STRING_LENGTH - 3] = '.';
stringArgUTF8[DEFAULT_STRING_LENGTH - 2] = '.';
stringArgUTF8[DEFAULT_STRING_LENGTH - 4] = '.';
stringArgUTF8[DEFAULT_STRING_LENGTH - 3] = '.';
stringArgUTF8[DEFAULT_STRING_LENGTH - 2] = '.';
}
j9str_printf(PORTLIB, cursor, length, "%.*s@%s", (U_32)J9UTF8_LENGTH(className), J9UTF8_DATA(className), stringArgUTF8);
} else {
Expand Down

0 comments on commit 9941812

Please sign in to comment.