Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9801142a authored by Siva Velusamy's avatar Siva Velusamy
Browse files

gltrace: Make code 64-bit safe.

Currently, the trace API passes the pointers that need to be
patched up via 32 bit integers. Such code will not be 64 bit safe.
This patch sends all pointers in a separate array of pointers
for the fixup calls to read from.

Change-Id: If975333f11a6f6f9a74fba57de328affaed452a5
parent 9291da97
Loading
Loading
Loading
Loading
+1991 −440

File changed.

Preview size limit exceeded, changes collapsed.

+112 −111

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Original line Diff line number Diff line
@@ -27,7 +27,7 @@ namespace gltrace {


void fixupGLMessage(GLTraceContext *curContext, nsecs_t wallStart, nsecs_t wallEnd,
void fixupGLMessage(GLTraceContext *curContext, nsecs_t wallStart, nsecs_t wallEnd,
                                                nsecs_t threadStart, nsecs_t threadEnd,
                                                nsecs_t threadStart, nsecs_t threadEnd,
                                                GLMessage *message);
                                                GLMessage *message, void *pointersToFixup[]);
void fixup_addFBContents(GLTraceContext *curContext, GLMessage *message, FBBinding fbToRead);
void fixup_addFBContents(GLTraceContext *curContext, GLMessage *message, FBBinding fbToRead);


};
};
+14 −3
Original line number Original line Diff line number Diff line
@@ -92,8 +92,8 @@ GL2PROTOBUF_TYPE_MAP = {
    "GLclampf":DataType.FLOAT,
    "GLclampf":DataType.FLOAT,
    "GLfixed":DataType.INT,
    "GLfixed":DataType.INT,
    "GLclampx":DataType.INT,
    "GLclampx":DataType.INT,
    "GLsizeiptr":DataType.POINTER,
    "GLsizeiptr":DataType.INT,
    "GLintptr":DataType.POINTER,
    "GLintptr":DataType.INT,
    "GLeglImageOES":DataType.POINTER,
    "GLeglImageOES":DataType.POINTER,
}
}


@@ -180,9 +180,20 @@ TRACE_CALL_TEMPLATE = pyratemp.Template(
    rt->$!retDataType.getProtobufCall()!$retValue);
    rt->$!retDataType.getProtobufCall()!$retValue);
<!--(end)-->
<!--(end)-->


    void *pointerArgs[] = {
<!--(for argname, argtype in parsedArgs)-->
    <!--(if argtype == DataType.POINTER)-->
        (void *) $!argname!$,
    <!--(end)-->
<!--(end)-->
<!--(if retDataType == DataType.POINTER)-->
        (void *) retValue,
<!--(end)-->
    };

    fixupGLMessage(glContext, wallStartTime, wallEndTime,
    fixupGLMessage(glContext, wallStartTime, wallEndTime,
                              threadStartTime, threadEndTime,
                              threadStartTime, threadEndTime,
                              &glmsg);
                              &glmsg, pointerArgs);
    glContext->traceGLMessage(&glmsg);
    glContext->traceGLMessage(&glmsg);
<!--(if retType != "void")-->
<!--(if retType != "void")-->