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 32 characters.
There will be subsequent PRs for cmdline option for string length and tests.

Closes: eclipse-openj9#16416
Signed-off-by: Nick Kamal <[email protected]>
  • Loading branch information
h3110n3rv3 committed Nov 21, 2024
1 parent eba9690 commit ed27c15
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions runtime/rastrace/method_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,12 +491,12 @@ traceMethodArgObject(J9VMThread *thr, UDATA* arg0EA, char* cursor, UDATA length)
if(DEFAULT_STRING_LENGTH < strlen(stringArgUTF8)) {
j9str_printf(PORTLIB, cursor, length, "%.*s@%.32s...", (U_32)J9UTF8_LENGTH(className), J9UTF8_DATA(className), stringArgUTF8);
} else {
j9str_printf(PORTLIB, cursor, length, "%.*s@%s", (U_32)J9UTF8_LENGTH(className), J9UTF8_DATA(className), stringArgUTF8);
j9str_printf(PORTLIB, cursor, length, "%.*s@%s", (U_32)J9UTF8_LENGTH(className), J9UTF8_DATA(className), stringArgUTF8);
}

if ((char*)stringArgBuffer != stringArgUTF8) {
j9mem_free_memory(stringArgUTF8);
}
j9mem_free_memory(stringArgUTF8);
}
} else {
/* TODO: handle arrays */
j9str_printf(PORTLIB, cursor, length, "%.*s@%p", (U_32)J9UTF8_LENGTH(className), J9UTF8_DATA(className), object);
Expand Down

0 comments on commit ed27c15

Please sign in to comment.