rbug: Add function to get opcode name string
authorJakob Bornecrantz <wallbraker@gmail.com>
Fri, 10 Sep 2010 02:39:26 +0000 (04:39 +0200)
committerJakob Bornecrantz <wallbraker@gmail.com>
Sun, 19 Sep 2010 22:03:58 +0000 (00:03 +0200)
src/gallium/auxiliary/rbug/rbug_demarshal.c
src/gallium/auxiliary/rbug/rbug_proto.h

index 47390fbcee714e687f859853a44a383876c1cc43..06caa45469da6c6e3aa6436d7281b333cb1ede8f 100644 (file)
@@ -91,3 +91,67 @@ struct rbug_header * rbug_demarshal(struct rbug_proto_header *header)
                return NULL;
        }
 }
+
+const char* rbug_proto_get_name(enum rbug_opcode opcode)
+{
+       switch(opcode) {
+       case RBUG_OP_NOOP:
+               return "RBUG_OP_NOOP";
+       case RBUG_OP_PING:
+               return "RBUG_OP_PING";
+       case RBUG_OP_ERROR:
+               return "RBUG_OP_ERROR";
+       case RBUG_OP_PING_REPLY:
+               return "RBUG_OP_PING_REPLY";
+       case RBUG_OP_ERROR_REPLY:
+               return "RBUG_OP_ERROR_REPLY";
+       case RBUG_OP_TEXTURE_LIST:
+               return "RBUG_OP_TEXTURE_LIST";
+       case RBUG_OP_TEXTURE_INFO:
+               return "RBUG_OP_TEXTURE_INFO";
+       case RBUG_OP_TEXTURE_WRITE:
+               return "RBUG_OP_TEXTURE_WRITE";
+       case RBUG_OP_TEXTURE_READ:
+               return "RBUG_OP_TEXTURE_READ";
+       case RBUG_OP_TEXTURE_LIST_REPLY:
+               return "RBUG_OP_TEXTURE_LIST_REPLY";
+       case RBUG_OP_TEXTURE_INFO_REPLY:
+               return "RBUG_OP_TEXTURE_INFO_REPLY";
+       case RBUG_OP_TEXTURE_READ_REPLY:
+               return "RBUG_OP_TEXTURE_READ_REPLY";
+       case RBUG_OP_CONTEXT_LIST:
+               return "RBUG_OP_CONTEXT_LIST";
+       case RBUG_OP_CONTEXT_INFO:
+               return "RBUG_OP_CONTEXT_INFO";
+       case RBUG_OP_CONTEXT_DRAW_BLOCK:
+               return "RBUG_OP_CONTEXT_DRAW_BLOCK";
+       case RBUG_OP_CONTEXT_DRAW_STEP:
+               return "RBUG_OP_CONTEXT_DRAW_STEP";
+       case RBUG_OP_CONTEXT_DRAW_UNBLOCK:
+               return "RBUG_OP_CONTEXT_DRAW_UNBLOCK";
+       case RBUG_OP_CONTEXT_DRAW_RULE:
+               return "RBUG_OP_CONTEXT_DRAW_RULE";
+       case RBUG_OP_CONTEXT_FLUSH:
+               return "RBUG_OP_CONTEXT_FLUSH";
+       case RBUG_OP_CONTEXT_LIST_REPLY:
+               return "RBUG_OP_CONTEXT_LIST_REPLY";
+       case RBUG_OP_CONTEXT_INFO_REPLY:
+               return "RBUG_OP_CONTEXT_INFO_REPLY";
+       case RBUG_OP_CONTEXT_DRAW_BLOCKED:
+               return "RBUG_OP_CONTEXT_DRAW_BLOCKED";
+       case RBUG_OP_SHADER_LIST:
+               return "RBUG_OP_SHADER_LIST";
+       case RBUG_OP_SHADER_INFO:
+               return "RBUG_OP_SHADER_INFO";
+       case RBUG_OP_SHADER_DISABLE:
+               return "RBUG_OP_SHADER_DISABLE";
+       case RBUG_OP_SHADER_REPLACE:
+               return "RBUG_OP_SHADER_REPLACE";
+       case RBUG_OP_SHADER_LIST_REPLY:
+               return "RBUG_OP_SHADER_LIST_REPLY";
+       case RBUG_OP_SHADER_INFO_REPLY:
+               return "RBUG_OP_SHADER_INFO_REPLY";
+       default:
+               return NULL;
+       }
+}
index 4f3eb75dc4dd3ab81bb94af7252621e1718a60c6..2fce725bc9efe0a3bb964bd6299ef40c28aaf2ff 100644 (file)
@@ -91,4 +91,9 @@ struct rbug_proto_header
  */
 struct rbug_connection;
 
+/**
+ * Get printable string for opcode.
+ */
+const char* rbug_proto_get_name(enum rbug_opcode opcode);
+
 #endif