richard miller Fix incorrect interpretation of arm condition codes (affects single stepping). Note that case 13 (LE) must be the converse of case 12 (GT). Perhaps not coincidentally, the same mistake appears in my paper copy of the ARM architecture reference manual (1996 ed). Reference: /n/atom/patch/applied2013/db5condcode Date: Sat Aug 3 22:34:05 CES 2013 Signed-off-by: quanstro@quanstro.net --- /sys/src/libmach/5db.c Sat Aug 3 22:33:57 2013 +++ /sys/src/libmach/5db.c Sat Aug 3 22:33:58 2013 @@ -61,7 +61,7 @@ */ Machdata armmach = { - {0x70, 0x00, 0x20, 0xD1}, /* break point */ /* D1200070 */ + {0x70, 0x00, 0x20, 0xE1}, /* break point */ /* E1200070 */ 4, /* break point size */ leswab, /* short to local byte order */ @@ -254,8 +254,7 @@ ((w >> 7) & 0x1); else if(((w >> 16) & 0x7) == 0x7) op = 117; - } - else + }else switch((w >> 16) & 0x7){ case 0: case 4: @@ -410,7 +409,7 @@ if(i->op == 120) { format("MOVW", i, "PSR, %x"); return; - } else + } else if(i->op == 121) { format("MOVW", i, "%x, PSR"); return; @@ -602,7 +601,7 @@ case 10: return n == v; case 11: return n != v; case 12: return !z && (n == v); - case 13: return z && (n != v); + case 13: return z || (n != v); case 14: return 1; case 15: return 0; }