Skip to content

Commit

Permalink
The changes reflect the feature request eclipse-openj9#16416 - part 2…
Browse files Browse the repository at this point in the history
… of eclipse-openj9#20641

Adding cmdline option to specify string length to be printed.
-Xtrace:methodstrarglen=[1-128]
methodStrArgLen takes an unsigned integer value from 1 to 128
If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32.
Other invalid inputs result in the following:
"Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128
 Trace option unrecognized: -Xtrace:methodStrArgLen
 Error processing trace option: -Xtrace:methodStrArgLen=<invalid input>
"

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

Signed-off-by: Nick Kamal <[email protected]>
  • Loading branch information
h3110n3rv3 committed Dec 17, 2024
1 parent e645803 commit 40b6792
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runtime/rastrace/method_trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ setMethodStrArgLength(J9JavaVM *vm, const char *str, BOOLEAN atRuntime)

p = getPositionalParm(1, str, &length);

if (length > 3) {
if (length > 1) {
goto err;
}

Expand All @@ -585,7 +585,7 @@ setMethodStrArgLength(J9JavaVM *vm, const char *str, BOOLEAN atRuntime)
return OMR_ERROR_NONE;

err:
vaReportJ9VMCommandLineError(PORTLIB, "methodstrarglen takes an unsigned integer value from 0 to %d", MAX_STRING_LENGTH);
vaReportJ9VMCommandLineError(PORTLIB, "methodstrarglen takes an unsigned integer value from 1 to %d", MAX_STRING_LENGTH);
return OMR_ERROR_INTERNAL;
}

Expand Down

0 comments on commit 40b6792

Please sign in to comment.