From 7f6a7a110adc8733496b6090e5898f1535c93a1d Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sat, 4 Sep 2010 11:16:02 +0100 Subject: [PATCH] Add some contexttag debugging printfs Signed-off-by: Jon TURNEY --- glx/glxcmds.c | 10 ++++++++++ glx/glxext.c | 7 ++++++- 2 files changed, 16 insertions(+), 1 deletions(-) diff --git a/glx/glxcmds.c b/glx/glxcmds.c index 8d13c15..e137b7c 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -400,6 +400,7 @@ static int AddCurrentContext(__GLXclientState *cl, __GLXcontext *glxc) for (i=0; i < num; i++) { if (!table[i]) { table[i] = glxc; + ErrorF("AddCurrentContext: Context %x was allocated tag %d\n", glxc, i+1); return i+1; } } @@ -415,6 +416,7 @@ static int AddCurrentContext(__GLXclientState *cl, __GLXcontext *glxc) table[num] = glxc; cl->currentContexts = table; cl->numCurrentContexts++; + ErrorF("AddCurrentContext: Context %x was allocated tag %d (grew table)\n", glxc, num+1); return num+1; } @@ -426,6 +428,7 @@ static void ChangeCurrentContext(__GLXclientState *cl, __GLXcontext *glxc, { __GLXcontext **table = cl->currentContexts; table[tag-1] = glxc; + ErrorF("ChangeCurrentContext: Tag %d was changed to context %x\n", tag, glxc); } /* @@ -438,8 +441,10 @@ __GLXcontext *__glXLookupContextByTag(__GLXclientState *cl, GLXContextTag tag) int num = cl->numCurrentContexts; if (tag < 1 || tag > num) { + ErrorF("__glXLookupContextByTag: tag %d (max %d) invalid\n", tag, num); return 0; } else { + ErrorF("__glXLookupContextByTag: tag %d (max %d) found context %x\n", tag, num, cl->currentContexts[tag-1]); return cl->currentContexts[tag-1]; } } @@ -552,6 +557,8 @@ DoMakeCurrent(__GLXclientState *cl, int error; GLuint mask; + ErrorF("DoMakeCurrent: oldtag %d\n", tag); + /* ** If one is None and the other isn't, it's a bad match. */ @@ -615,6 +622,7 @@ DoMakeCurrent(__GLXclientState *cl, readPriv = 0; } + ErrorF("DoMakeCurrent: context %x\n", glxc); if (prevglxc) { /* @@ -672,6 +680,8 @@ DoMakeCurrent(__GLXclientState *cl, reply.contextTag = 0; } + ErrorF("DoMakeCurrent: replying with tag %d\n", reply.contextTag); + reply.length = 0; reply.type = X_Reply; reply.sequenceNumber = client->sequence; diff --git a/glx/glxext.c b/glx/glxext.c index e203156..c80035d 100644 --- a/glx/glxext.c +++ b/glx/glxext.c @@ -126,6 +126,8 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid) { __GLXcontext *c; + ErrorF("DrawableGone: drawable %x XID %x\n", glxPriv, xid); + /* If this drawable was created using glx 1.3 drawable * constructors, we added it as a glx drawable resource under both * its glx drawable ID and it X drawable ID. Remove the other @@ -155,7 +157,10 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid) for (j = 0; j < cl->numCurrentContexts; j++) { if (cl->currentContexts[j] == c) - cl->currentContexts[j] = NULL; + { + ErrorF("DrawableGone: clearing tag %d, was context %x\n", j+1, cl->currentContexts[j]); + cl->currentContexts[j] = NULL; + } } } } -- 1.7.1