If you'd like to debug framework code in the emulator, you need to do
two things:
(1) After the emulator has launched, use DDMS (in Eclipse or
standalone) to select a process to debug. The selected process will
now have its java debug port available at port 8700.
(2) In Eclipse, create a debug configuration, of type "Remote Java
Application", and set the connection to localhost, port 8700. Save
the configuration. Then click "debug".
You are attaching to an already-running process, so you'll typically
use breakpoints to stop the process and step or examine your code.
There are a number of other caveats you'll discover - this is a useful
technique, and we use it for debugging framework and system code, but
it is not nearly as well integrated as application debugging with the
SDK.
I hope this helps,
--Andy