Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Unified Diff: src/debug.cc

Issue 21076: Fixed the debugger compile events.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/debug.h ('k') | src/debug-delay.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.cc
===================================================================
--- src/debug.cc (revision 1220)
+++ src/debug.cc (working copy)
@@ -1398,16 +1398,17 @@
Handle<Object> Debugger::MakeCompileEvent(Handle<Script> script,
- Handle<Object> script_function,
+ bool before,
bool* caught_exception) {
// Create the compile event object.
Handle<Object> exec_state = MakeExecutionState(caught_exception);
- Handle<Object> script_source(script->source());
- Handle<Object> script_name(script->name());
+ Handle<Object> script_wrapper = GetScriptWrapper(script);
const int argc = 3;
- Object** argv[argc] = { script_source.location(),
- script_name.location(),
- script_function.location() };
+ Object** argv[argc] = { exec_state.location(),
+ script_wrapper.location(),
+ before ? Factory::true_value().location() :
+ Factory::false_value().location() };
+
return MakeJSObject(CStrVector("MakeCompileEvent"),
argc,
argv,
@@ -1501,9 +1502,7 @@
// Create the event data object.
bool caught_exception = false;
- Handle<Object> event_data = MakeCompileEvent(script,
- Factory::undefined_value(),
- &caught_exception);
+ Handle<Object> event_data = MakeCompileEvent(script, true, &caught_exception);
// Bail out and don't call debugger if exception.
if (caught_exception) {
return;
@@ -1524,6 +1523,9 @@
// No more to do if not debugging.
if (!debugger_active()) return;
+ // Store whether in debugger before entering debugger.
+ bool in_debugger = Debug::InDebugger();
+
// Enter the debugger.
EnterDebugger debugger;
if (debugger.FailedToEnter()) return;
@@ -1556,12 +1558,12 @@
return;
}
// Bail out based on state or if there is no listener for this event
- if (Debug::InDebugger()) return;
+ if (in_debugger) return;
if (!Debugger::EventActive(v8::AfterCompile)) return;
// Create the compile state object.
Handle<Object> event_data = MakeCompileEvent(script,
- Factory::undefined_value(),
+ false,
&caught_exception);
// Bail out and don't call debugger if exception.
if (caught_exception) {
« no previous file with comments | « src/debug.h ('k') | src/debug-delay.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698