X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglwrap.funcs.t;h=f1527ba25dee59998992fe6cc2c888c1ac030377;hb=ea3d851aa52e999b1c5a5fa52c97ff5019756c0e;hp=6770ec780c7a169e661c0b0f3197a246e2ce83a9;hpb=a0799c5aa5aec7e9cfe05f6bf2c9d8058437b8df;p=gldbg.git diff --git a/source/glwrap.funcs.t b/source/glwrap.funcs.t index 6770ec7..f1527ba 100644 --- a/source/glwrap.funcs.t +++ b/source/glwrap.funcs.t @@ -7,40 +7,43 @@ !handcode eglGetProcAddress wl('%s APIENTRY %s(%s)', ret.ctype, func.name, ", ".join([p.ctype+" "+p.name for p in params])) wl('{') -wl(' static %s (*orig)(%s);', ret.ctype, ", ".join([p.ctype for p in params])) +wl(' static %s (*orig)(%s) = NULL;', ret.ctype, ", ".join([p.ctype for p in params])) +wl(' GlPacket *pkt;') if ret.ctype!='void': wl(' %s ret;', ret.ctype) wl(' if(!orig)') wl(' orig = glsym("%s");', func.name) -wl(' begin_packet(FUNC_%s);', func.name.upper()) +wl(' tracepoint(FUNC_%s, BREAK_CALL);', func.name.upper()) +wl(' pkt = packet_begin(FUNC_%s);', func.name.upper()) head_sent = False for p in params: if p.direction=="out" and not head_sent: - wl(' send_partial_packet();') + wl(' packet_send_partial(pkt, get_out_fd());') w(' ') if ret.ctype!='void': w('ret = ') wl('orig(%s);', ", ".join([q.name for q in params])) head_sent = True if p.kind=="value": - wl(' write_%s(%s);', p.io[0].replace(' ', '_'), p.name) + wl(' packet_write_%s(pkt, %s);', p.io[0].replace(' ', '_'), p.name) elif p.kind=="array" and p.io and p.io[0]=="string": - wl(' write_string_array(%s, %s);', p.name, p.csize) + wl(' packet_write_string_array(pkt, %s, %s);', p.name, p.csize) elif p.csize: - wl(' write_data(%s, %s);', p.name, p.csize) + wl(' packet_write_data(pkt, %s, %s);', p.name, p.csize) else: - wl(' write_pointer(%s);', p.name) + wl(' packet_write_pointer(pkt, %s);', p.name) if ret.ctype!='void': if not head_sent: - wl(' send_partial_packet();') + wl(' packet_send_partial(pkt, get_out_fd());') wl(' ret = orig(%s);', ", ".join([p.name for p in params])) head_sent = True - wl(' write_%s(ret);', ret.io[0].replace(' ', '_')) -wl(' send_packet();') + wl(' packet_write_%s(pkt, ret);', ret.io[0].replace(' ', '_')) +wl(' packet_send(pkt, get_out_fd());') if not head_sent: wl(' orig(%s);', ", ".join([p.name for p in params])) if not func.name.startswith("glX"): wl(' check_error();') +wl(' tracepoint(FUNC_%s, BREAK_RETURN);', func.name.upper()) if ret.ctype!='void': wl(' return ret;') wl('}')