openwpm/OpenWPM

Consider logging return value of function call

Opened this issue · 1 comments

We currently log a call before we call the function.

return function () {
const callContext = getOriginatingScriptContext(logSettings.logCallStack);
logCall(
objectName + "." + methodName,
arguments,
callContext,
logSettings,
);
return func.apply(this, arguments);
};

This results in us being unable to capture the return value so we leave it empty.
const msg = {
operation: JSOperation.call,
symbol: instrumentedFunctionName,
args: serialArgs,
value: "",
scriptUrl: callContext.scriptUrl,
scriptLine: callContext.scriptLine,
scriptCol: callContext.scriptCol,
funcName: callContext.funcName,
scriptLocEval: callContext.scriptLocEval,
callStack: callContext.callStack,
ordinal: ordinal++,
};

Is there a reason we chose to do that?

Hi,

I am trying to capture the return value of some functions myself.
For what I saw, value is used for return of get() operations, but not for call() ones, but is used as "arg" for set() ones, which makes its usage a bit confusing.
immagine

From SQLite Documentation I see that MAX_LENGTH for String is 1 billion bytes. Maybe is related to a size problem? Although it can be stored and I cannot anticipate a return value of over 1 billion bytes, maybe storing this information would inflate the DB too much...?