Skip to content

Commit

Permalink
Print actual string arguments with -Xtrace (part 2)
Browse files Browse the repository at this point in the history
The changes reflect the feature request #16416.

Adding cmdline option to specify string argument length.
-Xtrace:methodstrarglen=[1-128]
methodStrArgLen takes an unsigned integer value from 1 to 128
If methodStrArgLen = 0 or unspecified, default to 32.
Other invalid inputs result in the input error.

There will be subsequent PR for tests (part 3).

Signed-off-by: Nick Kamal <[email protected]>
  • Loading branch information
h3110n3rv3 committed Nov 28, 2024
1 parent 8606fa4 commit 6f968b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runtime/rastrace/method_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,8 @@ traceMethodArgObject(J9VMThread *thr, UDATA* arg0EA, char* cursor, UDATA length)
#define DEFAULT_STRING_LENGTH 32
char utf8Buffer[128];
UDATA utf8Length = 0;
const unsigned int methodStrArgLength = ((RasGlobalStorage *)thr->javaVM->j9rasGlobalStorage)->methodStrArgLength;
unsigned int strArgLength = methodStrArgLength == 0 ? DEFAULT_STRING_LENGTH : methodStrArgLength;
const unsigned int methodStrArgLength = ((RasGlobalStorage *)thr->javaVM->j9rasGlobalStorage)->methodStrArgLength;
unsigned int strArgLength = methodStrArgLength == 0 ? DEFAULT_STRING_LENGTH : methodStrArgLength;

char *utf8String = vm->internalVMFunctions->copyStringToUTF8WithMemAlloc(
thr,
Expand Down

0 comments on commit 6f968b4

Please sign in to comment.