replicant-frameworks_native/opengl/libs/GLES2_dbg/generate_GLFunction_java.py
David Li 2f5a6557ef Initial commit of GLESv2 debugger server
Use debug.egl.debug_proc property to match process cmdline.
Binds to TCP:5039 and waits for client connection.
Sends function call parameters, textures and shaders using Protobuf.
Java Eclipse client plug-in is next.

Change-Id: I183b755263663f87e86dde1ad12f527d0445fd57
Signed-off-by: David Li <davidxli@google.com>
2011-03-03 18:28:43 -08:00

35 lines
849 B
Python
Executable File

#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
if __name__ == "__main__":
externs = []
lines = open("gl2_api.in").readlines()
i = 0
print "// auto generated by generate_GLFunction_java.py"
print """package GLESv2Debugger;
public enum GLFunction
{"""
index = 0
for line in lines:
if line.find("API_ENTRY(") >= 0: # a function prototype
returnType = line[0: line.find(" API_ENTRY(")]
functionName = line[line.find("(") + 1: line.find(")")] #extract GL function name
print "\t%s(%d, DebuggerMessage.Message.Function.%s)," % (functionName, index, functionName)
index += 1
print """\t;
\tpublic final int index;
\tpublic final DebuggerMessage.Message.Function function;
\tGLFunction(final int index, final DebuggerMessage.Message.Function function)
\t{
\t\tthis.index = index;
\t\tthis.function = function;
\t}
}"""