qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH]: Display TCGCond name in tcg dumper
@ 2008-09-08 13:32 Tristan Gingold
  2008-09-09 15:54 ` Blue Swirl
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Tristan Gingold @ 2008-09-08 13:32 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 142 bytes --]

Hi,

currently TCGCond are displayed by value in tcg dumps - which is not  
very easy to read.
This patch displays names instead.

Tristan.



[-- Attachment #2: q-tcg.diff1 --]
[-- Type: application/octet-stream, Size: 1000 bytes --]

Index: tcg/tcg.c
===================================================================
--- tcg/tcg.c	(revision 5181)
+++ tcg/tcg.c	(working copy)
@@ -730,6 +730,9 @@
     return NULL;
 }
 
+static const char * const cond_name[] =
+{ "eq", "ne", "lt", "ge", "le", "gt", "ltu", "geu", "leu", "gtu" };
+
 void tcg_dump_ops(TCGContext *s, FILE *outfile)
 {
     const uint16_t *opc_ptr;
@@ -841,7 +844,20 @@
                 fprintf(outfile, "%s",
                         tcg_get_arg_str_idx(s, buf, sizeof(buf), args[k++]));
             }
-            for(i = 0; i < nb_cargs; i++) {
+	    if (c == INDEX_op_brcond_i32
+#if TCG_TARGET_REG_BITS == 32
+		|| c == INDEX_op_brcond2_i32
+#endif
+#if TCG_TARGET_REG_BITS == 64
+		|| c == INDEX_op_brcond_i64
+#endif
+		) {
+		fprintf(outfile, ",%s", cond_name[args[k++]]);
+		i = 1;
+	    }
+	    else
+		i = 0;
+            for(; i < nb_cargs; i++) {
                 if (k != 0)
                     fprintf(outfile, ",");
                 arg = args[k++];

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-09-14  7:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-08 13:32 [Qemu-devel] [PATCH]: Display TCGCond name in tcg dumper Tristan Gingold
2008-09-09 15:54 ` Blue Swirl
2008-09-09 17:00   ` Paul Brook
2008-09-10  7:45     ` Tristan Gingold
2008-09-10  7:58 ` Tristan Gingold
2008-09-14  7:49 ` Blue Swirl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).