}
+function GetLoadedScripts() {
+ ClearMirrorCache(); // The mirror cache may be holding onto scripts.
+ return %DebugGetLoadedScripts();
+}
+
+
Debug.setListener = function(listener, opt_data) {
if (!IS_FUNCTION(listener) && !IS_UNDEFINED(listener) && !IS_NULL(listener)) {
throw new Error('Parameters have wrong types.');
// scanning the heap.
Debug.scripts = function() {
// Collect all scripts in the heap.
- return %DebugGetLoadedScripts();
+ return GetLoadedScripts();
};
}
// Collect all scripts in the heap.
- var scripts = %DebugGetLoadedScripts();
+ var scripts = GetLoadedScripts();
response.body = [];
var script_id = request.arguments.script_id;
var preview_only = !!request.arguments.preview_only;
- var scripts = %DebugGetLoadedScripts();
+ var scripts = GetLoadedScripts();
var the_script = null;
for (var i = 0; i < scripts.length; i++) {
void Debugger::UpdateState() {
+ Debug* debug = isolate_->debug();
bool activate = message_handler_ != NULL ||
!event_listener_.is_null() ||
- isolate_->debug()->InDebugger();
+ debug->InDebugger();
if (!is_active_ && activate) {
// Note that the debug context could have already been loaded to
// bootstrap test cases.
isolate_->compilation_cache()->Disable();
- activate = isolate_->debug()->Load();
- } else if (is_active_ && !activate) {
+ activate = debug->Load();
+ } else if (debug->IsLoaded() && !activate) {
isolate_->compilation_cache()->Enable();
- isolate_->debug()->ClearAllBreakPoints();
- isolate_->debug()->Unload();
+ debug->ClearAllBreakPoints();
+ debug->Unload();
}
is_active_ = activate;
// At this point the debug context is loaded iff the debugger is active.
- ASSERT(isolate_->debug()->IsLoaded() == is_active_);
+ ASSERT(debug->IsLoaded() == is_active_);
}
// JavaScript. This can happen if the v8::Debug::Call is used in which
// case the exception should end up in the calling code.
if (!isolate_->has_pending_exception()) {
- // Try to avoid any pending debug break breaking in the clear mirror
- // cache JavaScript code.
- if (isolate_->stack_guard()->CheckDebugBreak()) {
- debug->set_has_pending_interrupt(true);
- isolate_->stack_guard()->ClearDebugBreak();
- }
debug->ClearMirrorCache();
}
- // Request debug break when leaving the last debugger entry
- // if one was recorded while debugging.
- if (debug->has_pending_interrupt()) {
- debug->set_has_pending_interrupt(false);
- isolate_->stack_guard()->RequestDebugBreak();
- }
-
// If there are commands in the queue when leaving the debugger request
// that these commands are processed.
if (isolate_->debugger()->HasCommands()) {