Revision: 10449 Author: [email protected] Date: Thu Jan 19 08:52:16 2012 Log: Fix remote debugger crash.
Review URL: https://chromiumcodereview.appspot.com/9200006 http://code.google.com/p/v8/source/detail?r=10449 Modified: /branches/bleeding_edge/src/d8-debug.cc /branches/bleeding_edge/src/d8.cc ======================================= --- /branches/bleeding_edge/src/d8-debug.cc Fri Jan 13 05:09:52 2012 +++ /branches/bleeding_edge/src/d8-debug.cc Thu Jan 19 08:52:16 2012 @@ -1,4 +1,4 @@ -// Copyright 2011 the V8 project authors. All rights reserved. +// Copyright 2012 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -310,9 +310,7 @@ Handle<Value> request = Shell::DebugCommandToJSONRequest(String::New(command)); if (try_catch.HasCaught()) { - v8::String::Utf8Value exception(try_catch.Exception()); - const char* exception_string = Shell::ToCString(exception); - printf("%s\n", exception_string); + Shell::ReportException(&try_catch); PrintPrompt(); return; } ======================================= --- /branches/bleeding_edge/src/d8.cc Tue Jan 17 05:37:09 2012 +++ /branches/bleeding_edge/src/d8.cc Thu Jan 19 08:52:16 2012 @@ -526,6 +526,8 @@ void Shell::ReportException(v8::TryCatch* try_catch) { HandleScope handle_scope; + bool enter_context = !Context::InContext(); + if (enter_context) utility_context_->Enter(); v8::String::Utf8Value exception(try_catch->Exception()); const char* exception_string = ToCString(exception); Handle<Message> message = try_catch->Message(); @@ -560,6 +562,7 @@ } } printf("\n"); + if (enter_context) utility_context_->Exit(); } -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
