From d1cc8363d4f4bbac7568b1d02a5ca481cd10830f Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 24 Oct 2011 16:58:50 -0700 Subject: Wire up enough of the pieces that we can connect ddms or jdb. (And die with an UNIMPLEMENTED as soon as they connect, of course.) Change-Id: I9abb25d581384361c215b3cd96b8278c751e79ea --- src/runtime.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/runtime.cc') diff --git a/src/runtime.cc b/src/runtime.cc index a144c44..5f2eddd 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -56,6 +56,8 @@ Runtime::Runtime() } Runtime::~Runtime() { + Dbg::StopJdwp(); + // Make sure our internal threads are dead before we start tearing down things they're using. delete signal_catcher_; // TODO: GC thread. @@ -402,7 +404,9 @@ void Runtime::Start() { // come after ClassLinker::RunRootClinits. started_ = true; - StartSignalCatcher(); + if (!is_zygote_) { + DidForkFromZygote(); + } StartDaemonThreads(); @@ -416,9 +420,13 @@ void Runtime::Start() { } void Runtime::DidForkFromZygote() { - CHECK(is_zygote_); is_zygote_ = false; + StartSignalCatcher(); + + // Start the JDWP thread. If the command-line debugger flags specified "suspend=y", + // this will pause the runtime, so we probably want this to come last. + Dbg::StartJdwp(); } void Runtime::StartSignalCatcher() { -- cgit v1.1