Keep track of debugger call results

The debugger can execute arbitrary methods in threads that are stopped
at a breakpoint.  The result is passed back from the target thread to
the debugger through the JDWP thread.  During this time, nothing else
has a copy of the return value, so if it's an object reference we need
to make sure the GC doesn't move or discard it.

The object is added to the "GC don't touch" list by the JDWP code,
but it was happening after the object was passed between threads.
We now register the object right after we get it.

Also, don't call dvmAddTrackedAlloc on a null object.

Bug 3009076

Change-Id: I5ab07a70ad7141b6867707c75843cfb60c35446d
1 file changed