The attached patch implements disassembly of Thumb-2 conditional instructions. Unlike ARM mode, Thumb-2 conditional execution is part of the CPU state, not explicitly encoded in the instruction. An IT (If Then) instruction causes subsequent instructions to be conditionally executed. Fortunately the architecture prohibits branches in or out of IT blocks, so most of the time the disassembler just needs to keep track of the CPU condexec state as it works through the instructions. The interesting part is when disassembly starts at an arbitrary location (eg. from inside gdb). In this case we need to scan backwards to determine if the current instruction is within an IT block. This is somewhat complicated by the variable length instruction encoding. We scan backwards until something that looks like an IT instruction is found, then search for a preceding instruction boundary that proves it isn't the second half of a 32-bit instruction. The scan for a candidate IT instruction is bounded by the maximum size of an IT block (4 insns). The scan for an instruction boundary is potentially unbounded, though in practice the encodings are such that the search terminates quickly. Because IT blocks may not be nested a single linear search is sufficient. Tested with cross to arm-none-eabi. Ok? Paul 2006-04-19 Paul Brook opcodes/ * arm-dis.c (coprocessor_opcodes): Add %c to unconditional arm instructions. (neon_opcodes): Add conditional execution specifiers. (thumb_opcodes): Ditto. (thumb32_opcodes): Ditto. (arm_conditional): Change 0xe to "al" and add "" to end. (ifthen_state, ifthen_next_state, ifthen_address): New. (IFTHEN_COND): Define. (print_insn_coprocessor, print_insn_neon): Print thumb conditions. (print_insn_arm): Change %c to use new values of arm_conditional. (print_insn_thumb16): Print thumb conditions. Add %I. (print_insn_thumb32): Print thumb conditions. (find_ifthen_state): New function. (print_insn): Track IT block state. gas/testsuite/ * gas/arm/thumb2_bcond.d: Update expected output. * gas/arm/thumb32.d: Ditto. * gas/arm/vfp1_t2.d: Ditto. * gas/arm/vfp1xD_t2.d: Ditto. binutils/testsuite/ * binutils-all/arm/objdump.exp: New file. * binutils-all/arm/thumb2-cond.s: New test.