From c8b0ab7b91adc644792446f1f00bdf505364129a Mon Sep 17 00:00:00 2001 From: Nick Kamal Date: Thu, 21 Nov 2024 11:02:10 -0500 Subject: [PATCH] The changes reflect the feature request #16416 - part 2 of #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= " There will be subsequent PRs for tests (part 3). Signed-off-by: Nick Kamal --- runtime/rastrace/method_trigger.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/rastrace/method_trigger.c b/runtime/rastrace/method_trigger.c index 0d01bcf5df1..065f4a84bf2 100644 --- a/runtime/rastrace/method_trigger.c +++ b/runtime/rastrace/method_trigger.c @@ -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; } @@ -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; }