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

Unified Diff: src/debug.cc

Issue 1216193002: Debugger: ensure that break points are set in code that contain debug break slots. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: assert that break points are always set in code that has debug break slots Created 5 years, 6 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 | « no previous file | src/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.cc
diff --git a/src/debug.cc b/src/debug.cc
index d62586a2e5c7a796135ac3e44ba25f855510e529..77711ecb8fb39cc4ba72321b7cda4b3f9a6ef46f 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -253,6 +253,7 @@ BreakLocation BreakLocation::FromPosition(Handle<DebugInfo> debug_info,
void BreakLocation::SetBreakPoint(Handle<Object> break_point_object) {
// If there is not already a real break point here patch code with debug
// break.
+ DCHECK(code()->has_debug_break_slots());
if (!HasBreakPoint()) SetDebugBreak();
DCHECK(IsDebugBreak() || IsDebuggerStatement());
// Set the break point information.
@@ -1083,8 +1084,8 @@ void Debug::ClearAllBreakPoints() {
void Debug::FloodWithOneShot(Handle<JSFunction> function,
BreakLocatorType type) {
- // Do not ever break in native functions.
- if (function->IsFromNativeScript()) return;
+ // Do not ever break in native and extension functions.
+ if (!function->IsSubjectToDebugging()) return;
PrepareForBreakPoints();
@@ -1109,7 +1110,7 @@ void Debug::FloodBoundFunctionWithOneShot(Handle<JSFunction> function) {
isolate_);
if (!bindee.is_null() && bindee->IsJSFunction() &&
- !JSFunction::cast(*bindee)->IsFromNativeScript()) {
+ JSFunction::cast(*bindee)->IsSubjectToDebugging()) {
Handle<JSFunction> bindee_function(JSFunction::cast(*bindee));
FloodWithOneShotGeneric(bindee_function);
}
@@ -1307,9 +1308,9 @@ void Debug::PrepareStep(StepAction step_action,
DCHECK(location.IsExit());
frames_it.Advance();
}
- // Skip builtin functions on the stack.
+ // Skip native and extension functions on the stack.
while (!frames_it.done() &&
- frames_it.frame()->function()->IsFromNativeScript()) {
+ !frames_it.frame()->function()->IsSubjectToDebugging()) {
frames_it.Advance();
}
// Step out: If there is a JavaScript caller frame, we need to
@@ -1965,9 +1966,12 @@ void Debug::PrepareForBreakPoints() {
for (int i = 0; i < active_functions.length(); i++) {
Handle<JSFunction> function = active_functions[i];
Handle<SharedFunctionInfo> shared(function->shared());
-
- // If recompilation is not possible just skip it.
- if (!shared->allows_lazy_compilation()) continue;
+ if (!shared->allows_lazy_compilation()) {
+ // Ignore functions that cannot be recompiled. Fortunately, those are
+ // only ones that are not subject to debugging in the first place.
+ DCHECK(!function->IsSubjectToDebugging());
+ continue;
+ }
if (shared->code()->kind() == Code::BUILTIN) continue;
EnsureFunctionHasDebugBreakSlots(function);
« no previous file with comments | « no previous file | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698