ART: Stash any exception before dumping a stack

Dumping a managed stack entails dumping held locks, in the process
of which the verifier will be run. The verifier works under the
assumption that there were no exceptions when started. This
assumption is violated for example on certain JNI aborts.

The solution is to stash any pending exception before dumping the
stack, and re-installing it afterwards.

Bug: 17669899

(cherry picked from commit d87bc135dba41f0f21cf0018a3b2cb46809890d7)

Change-Id: Ic44780bad90a8e1ba80858c807e2bef3bf6651c6
1 file changed