diff options
Diffstat (limited to 'wrappers/glxtrace.py')
-rw-r--r-- | wrappers/glxtrace.py | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/wrappers/glxtrace.py b/wrappers/glxtrace.py index e9c43a9c..d9dce953 100644 --- a/wrappers/glxtrace.py +++ b/wrappers/glxtrace.py @@ -166,7 +166,6 @@ if __name__ == '__main__': print '#define GL_GLEXT_PROTOTYPES' print '#define GLX_GLXEXT_PROTOTYPES' print - print '#include "dlopen.hpp"' print '#include "glproc.hpp"' print '#include "glsize.hpp"' print @@ -178,52 +177,3 @@ if __name__ == '__main__': api.addModule(module) tracer = GlxTracer() tracer.traceApi(api) - - print r''' - - -/* - * Several applications, such as Quake3, use dlopen("libGL.so.1"), but - * LD_PRELOAD does not intercept symbols obtained via dlopen/dlsym, therefore - * we need to intercept the dlopen() call here, and redirect to our wrapper - * shared object. - */ -extern "C" PUBLIC -void * dlopen(const char *filename, int flag) -{ - void *handle; - - handle = _dlopen(filename, flag); - - const char * libgl_filename = getenv("TRACE_LIBGL"); - - if (filename && handle && !libgl_filename) { - if (0) { - os::log("apitrace: warning: dlopen(\"%s\", 0x%x)\n", filename, flag); - } - - // FIXME: handle absolute paths and other versions - if (strcmp(filename, "libGL.so") == 0 || - strcmp(filename, "libGL.so.1") == 0) { - - // Use the true libGL.so handle instead of RTLD_NEXT from now on - _libGlHandle = handle; - - // Get the file path for our shared object, and use it instead - static int dummy = 0xdeedbeef; - Dl_info info; - if (dladdr(&dummy, &info)) { - os::log("apitrace: redirecting dlopen(\"%s\", 0x%x)\n", filename, flag); - handle = _dlopen(info.dli_fname, flag); - } else { - os::log("apitrace: warning: dladdr() failed\n"); - } - } - } - - return handle; -} - - - -''' |