OSDN Git Service

Fix a deadlock in the breakpoint code.
authorAndy McFadden <fadden@android.com>
Fri, 23 Apr 2010 00:08:11 +0000 (17:08 -0700)
committerAndy McFadden <fadden@android.com>
Fri, 23 Apr 2010 19:36:03 +0000 (12:36 -0700)
commit6efd446399ba7a9bb68bf8ddb5a458072a1381b0
tree57ff31574235f6cd176ef13d5a8820fd16ff2452
parent1dd42bb9da388c55191449b848f9d82dc4673229
Fix a deadlock in the breakpoint code.

In froyo we started using "hard" breakpoints, where we replace the
existing opcodes with breakpoint instructions.  This requires some
coordination to avoid confusing the verifier.  The previous approach
allowed the breakpoints to be inserted, and "undid" them while the
verifier ran; this worked, but caused us to be holding a lock for
an extended period.

The new approach just avoids altering the bytecode of unverified
classes, and then "flushes" the breakpoint set out between the time
when verification completes and class initialization starts.  This
removes the possibility of blocking with the lock held, and makes
everything much simpler.

For bug 2615063.

(cherry-pick from dalvik-dev)

Change-Id: I75f19b0cc71fc0babb50ab299c6c5a865e06c919
vm/analysis/DexVerify.c
vm/interp/Interp.c
vm/interp/Interp.h
vm/oo/Class.c