当前位置: 首页>>代码示例>>Python>>正文


Python Tracer.doInvokeFunction方法代码示例

本文整理汇总了Python中trace.Tracer.doInvokeFunction方法的典型用法代码示例。如果您正苦于以下问题:Python Tracer.doInvokeFunction方法的具体用法?Python Tracer.doInvokeFunction怎么用?Python Tracer.doInvokeFunction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在trace.Tracer的用法示例。


在下文中一共展示了Tracer.doInvokeFunction方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: doInvokeFunction

# 需要导入模块: from trace import Tracer [as 别名]
# 或者: from trace.Tracer import doInvokeFunction [as 别名]
    def doInvokeFunction(self, function):
        if function.name in self.getProcAddressFunctionNames:
            nameArg = function.args[0].name
            Tracer.doInvokeFunction(self, function)

            # Replace function addresses with ours
            # XXX: Doing this here instead of wrapRet means that the trace will
            # contain the addresses of the wrapper functions, and not the real
            # functions, but in practice this should make no difference.
            print "    _result = _wrapProcAddress(%s, _result);" % (nameArg,)
        else:
            Tracer.doInvokeFunction(self, function)
开发者ID:mrzzzrm,项目名称:apitrace,代码行数:14,代码来源:gltrace_vanilla.py

示例2: doInvokeFunction

# 需要导入模块: from trace import Tracer [as 别名]
# 或者: from trace.Tracer import doInvokeFunction [as 别名]
    def doInvokeFunction(self, function):
        # Same as invokeFunction() but called both when trace is enabled or disabled.
        #
        # Used to modify the behavior of GL entry-points.

        # Override GL extensions
        if function.name in ('glGetString', 'glGetIntegerv', 'glGetStringi'):
            Tracer.doInvokeFunction(self, function, prefix = 'gltrace::_', suffix = '_override')
            return

        # We implement GL_EXT_debug_marker, GL_GREMEDY_*, etc., and not the
        # driver
        if function.name in self.marker_functions:
            return

        # We may be faking KHR_debug, so ensure the pointer queries result is
        # always zeroed to prevent dereference of unitialized pointers
        if function.name == 'glGetPointerv':
            print '    if (params &&'
            print '        (pname == GL_DEBUG_CALLBACK_FUNCTION ||'
            print '         pname == GL_DEBUG_CALLBACK_USER_PARAM)) {'
            print '        *params = NULL;'
            print '    }'

        if function.name in self.getProcAddressFunctionNames:
            else_ = ''
            for marker_function in self.marker_functions:
                if self.api.getFunctionByName(marker_function):
                    print '    %sif (strcmp("%s", (const char *)%s) == 0) {' % (else_, marker_function, function.args[0].name)
                    print '        _result = (%s)&%s;' % (function.type, marker_function)
                    print '    }'
                else_ = 'else '
            print '    %s{' % else_
            Tracer.doInvokeFunction(self, function)

            # Replace function addresses with ours
            # XXX: Doing this here instead of wrapRet means that the trace will
            # contain the addresses of the wrapper functions, and not the real
            # functions, but in practice this should make no difference.
            if function.name in self.getProcAddressFunctionNames:
                print '    _result = _wrapProcAddress(%s, _result);' % (function.args[0].name,)

            print '    }'
            return

        Tracer.doInvokeFunction(self, function)
开发者ID:Shalmezad,项目名称:regal,代码行数:48,代码来源:gltrace.py

示例3: doInvokeFunction

# 需要导入模块: from trace import Tracer [as 别名]
# 或者: from trace.Tracer import doInvokeFunction [as 别名]
    def doInvokeFunction(self, function):
        # Same as invokeFunction() but called both when trace is enabled or disabled.
        #
        # Used to modify the behavior of GL entry-points.

        # Override GL extensions
        if function.name in ('glGetString', 'glGetIntegerv', 'glGetStringi'):
            Tracer.doInvokeFunction(self, function, prefix = 'gltrace::_', suffix = '_override')
            return

        # We implement GL_EXT_debug_marker, GL_GREMEDY_*, etc., and not the
        # driver
        if function.name in self.marker_functions:
            return

        if function.name in self.getProcAddressFunctionNames:
            else_ = ''
            for marker_function in self.marker_functions:
                if self.api.getFunctionByName(marker_function):
                    print '    %sif (strcmp("%s", (const char *)%s) == 0) {' % (else_, marker_function, function.args[0].name)
                    print '        _result = (%s)&%s;' % (function.type, marker_function)
                    print '    }'
                else_ = 'else '
            print '    %s{' % else_
            Tracer.doInvokeFunction(self, function)

            # Replace function addresses with ours
            # XXX: Doing this here instead of wrapRet means that the trace will
            # contain the addresses of the wrapper functions, and not the real
            # functions, but in practice this should make no difference.
            if function.name in self.getProcAddressFunctionNames:
                print '    _result = _wrapProcAddress(%s, _result);' % (function.args[0].name,)

            print '    }'
            return

        Tracer.doInvokeFunction(self, function)
开发者ID:Hsaniva,项目名称:apitrace,代码行数:39,代码来源:gltrace.py


注:本文中的trace.Tracer.doInvokeFunction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。