OP_BREAKPOINT.cpp revision 92c1f6f1b4249e4e379452ee7b49f027052bf4ce
1HANDLE_OPCODE(OP_BREAKPOINT)
2    {
3        /*
4         * Restart this instruction with the original opcode.  We do
5         * this by simply jumping to the handler.
6         *
7         * It's probably not necessary to update "inst", but we do it
8         * for the sake of anything that needs to do disambiguation in a
9         * common handler with INST_INST.
10         *
11         * The breakpoint itself is handled over in updateDebugger(),
12         * because we need to detect other events (method entry, single
13         * step) and report them in the same event packet, and we're not
14         * yet handling those through breakpoint instructions.  By the
15         * time we get here, the breakpoint has already been handled and
16         * the thread resumed.
17         */
18        u1 originalOpcode = dvmGetOriginalOpcode(pc);
19        ALOGV("+++ break 0x%02x (0x%04x -> 0x%04x)", originalOpcode, inst,
20            INST_REPLACE_OP(inst, originalOpcode));
21        inst = INST_REPLACE_OP(inst, originalOpcode);
22        FINISH_BKPT(originalOpcode);
23    }
24OP_END
25