]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Improved pretty-printing:
authorNicholas Nethercote <n.nethercote@gmail.com>
Fri, 16 Apr 2004 11:33:53 +0000 (11:33 +0000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Fri, 16 Apr 2004 11:33:53 +0000 (11:33 +0000)
 - now showing conditions for CC2VAL and CMOV
 - fixed indenting on JumpKind (-c, -r, -sys, etc)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2367

coregrind/vg_translate.c

index f6a399e0014f3f280737722c9a263ec0343d32d9..55db62f9b36fffa181a24d228ec2569c7c9fb9d7 100644 (file)
@@ -962,7 +962,8 @@ void pp_UInstrWorker ( Int instrNo, UInstr* u, Bool ppRegsLiveness )
 {
    VG_(printf)("\t%4d: %s", instrNo, 
                             VG_(name_UOpcode)(True, u->opcode));
-   if (u->opcode == JMP || u->opcode == CC2VAL)
+   // For JMP, the condition goes before the size
+   if (u->opcode == JMP)
       VG_(printf)("%s", VG_(name_UCondcode)(u->cond));
 
    switch (u->size) {
@@ -975,6 +976,21 @@ void pp_UInstrWorker ( Int instrNo, UInstr* u, Bool ppRegsLiveness )
       default: VG_(printf)("%d", (Int)u->size); break;
    }
 
+   // For CC2VAL and CMOV, the condition goes after the size
+   if (u->opcode == CC2VAL || u->opcode == CMOV)
+      VG_(printf)("%s", VG_(name_UCondcode)(u->cond));
+
+   // Append jmpkind
+   if (u->opcode == JMP) {
+      switch (u->jmpkind) {
+         case JmpCall:      VG_(printf)("-c"); break;
+         case JmpRet:       VG_(printf)("-r"); break;
+         case JmpSyscall:   VG_(printf)("-sys"); break;
+         case JmpClientReq: VG_(printf)("-cli"); break;
+         case JmpYield:     VG_(printf)("-yld"); break;
+         default: break;
+      }
+   }
    VG_(printf)("       \t");
 
    switch (u->opcode) {
@@ -1131,14 +1147,6 @@ void pp_UInstrWorker ( Int instrNo, UInstr* u, Bool ppRegsLiveness )
          break;
 
       case JMP:
-         switch (u->jmpkind) {
-            case JmpCall:      VG_(printf)("-c"); break;
-            case JmpRet:       VG_(printf)("-r"); break;
-            case JmpSyscall:   VG_(printf)("-sys"); break;
-            case JmpClientReq: VG_(printf)("-cli"); break;
-            case JmpYield:     VG_(printf)("-yld"); break;
-            default: break;
-         }
          VG_(pp_UOperand)(u, 1, u->size, False);
          if (CondAlways == u->cond) {
             /* Print x86 instruction size if filled in */