In armv6 and armv7, breakpoint instruction is conditionally executed, so use ALWAYS condition in the instruction to ensure the breakpoint will be activated whatever the condition code is in the PSR. Unfortunately on kirkwood (and possibly other armv5?) this changes the exception type from Undefined Instruction to Prefetch Abort, so trap.c must be changed to allow for both possibilities. After applying this patch, rebuild db and acid, and /arm/9plug if applicable. Reference: /n/sources/patch/applied/arm-bkpt-cond Date: Fri Aug 2 23:03:49 CES 2013 Signed-off-by: miller@hamnavoe.com --- /sys/src/libmach/5db.c Fri Aug 2 22:55:38 2013 +++ /sys/src/libmach/5db.c Fri Aug 2 22:55:32 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 */ --- /sys/src/9/kw/trap.c Fri Aug 2 22:55:45 2013 +++ /sys/src/9/kw/trap.c Fri Aug 2 22:55:41 2013 @@ -428,6 +428,9 @@ case PsrMabt: /* prefetch fault */ ldrexvalid = 0; faultarm(ureg, ureg->pc, user, 1); + if(up->nnote == 0 && + (*(u32int*)ureg->pc & ~(0xF<<28)) == 0x01200070) + postnote(up, 1, "sys: breakpoint", NDebug); break; case PsrMabt+1: /* data fault */ ldrexvalid = 0; @@ -492,10 +495,9 @@ case PsrMund: /* undefined instruction */ if(user){ if(seg(up, ureg->pc, 0) != nil && - *(u32int*)ureg->pc == 0xD1200070){ - snprint(buf, sizeof buf, "sys: breakpoint"); - postnote(up, 1, buf, NDebug); - }else{ + (*(u32int*)ureg->pc & ~(0xF<<28)) == 0x01200070) + postnote(up, 1, "sys: breakpoint", NDebug); + else{ /* look for floating point instructions to interpret */ x = spllo(); rv = fpiarm(ureg);