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 ca304aa commit ae49bd0
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions runtime/rastrace/method_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0
*******************************************************************************/


#include "rommeth.h"

#define _UTE_STATIC_
Expand All @@ -45,7 +44,7 @@ static char* traceMethodReturnVal(J9VMThread* thr, J9UTF8* signature, void* retu
static void traceMethodArgBoolean (J9VMThread *thr, UDATA* arg0EA, char* cursor, UDATA length);
static void traceMethodEnter (J9VMThread *thr, J9Method *method, void *receiverAddress, UDATA isCompiled, UDATA doParameters);
static void traceMethodArgLong (J9VMThread *thr, UDATA* arg0EA, char* cursor, UDATA length);
static U_8 checkMethod (J9VMThread *thr, J9Method *method, int *stringArgLength);
static U_8 checkMethod (J9VMThread *thr, J9Method *method);

/**************************************************************************
* name - matchMethod
Expand Down Expand Up @@ -116,11 +115,10 @@ matchMethod(RasMethodTable * methodTable, J9Method *method)
* the trace spec and thus need to be traced.
* parameters - Pointer to the current thread
* Pointer to the method
* Pointer to int variable to be filled
* returns - none
*************************************************************************/
static
U_8 checkMethod(J9VMThread *thr, J9Method *method, int *stringArgLength)
U_8 checkMethod(J9VMThread *thr, J9Method *method)
{
RasMethodTable *methodTable;
U_8 flag = J9_RAS_METHOD_SEEN;
Expand All @@ -145,7 +143,6 @@ U_8 checkMethod(J9VMThread *thr, J9Method *method, int *stringArgLength)

if(methodTable->traceInputRetVals == TRUE) {
flag |= J9_RAS_METHOD_TRACE_ARGS;
*stringArgLength = methodTable->stringArgLength;
}
} else {
/* Disable all method trace for this method */
Expand Down Expand Up @@ -319,15 +316,14 @@ traceMethodExitX(J9VMThread *thr, J9Method *method, UDATA isCompiled, void* exce
BOOLEAN
setRAMClassExtendedMethodFlagsHelper(J9VMThread *thr, J9Class *clazz, const char **nlsMsgFormat)
{
int stringArgLength;
J9JavaVM *vm = thr->javaVM;
J9Method *method = clazz->ramMethods;
U_32 i = 0;
U_32 romMethodCount = clazz->romClass->romMethodCount;

for (i = 0; i < romMethodCount; i++) {
U_8 *mtFlag = fetchMethodExtendedFlagsPointer(method);
setExtendedMethodFlags(vm, mtFlag, (checkMethod(thr, method, &stringArgLength) | rasSetTriggerTrace(thr, method)));
setExtendedMethodFlags(vm, mtFlag, (checkMethod(thr, method) | rasSetTriggerTrace(thr, method)));
method++;
}

Expand Down

0 comments on commit ae49bd0

Please sign in to comment.