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

Side by Side Diff: src/debug.cc

Issue 15685010: Find breakpoint by PC rather than source position when clearing breakpoint (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix method contract Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after
1234 HandleScope scope(isolate_); 1234 HandleScope scope(isolate_);
1235 1235
1236 DebugInfoListNode* node = debug_info_list_; 1236 DebugInfoListNode* node = debug_info_list_;
1237 while (node != NULL) { 1237 while (node != NULL) {
1238 Object* result = DebugInfo::FindBreakPointInfo(node->debug_info(), 1238 Object* result = DebugInfo::FindBreakPointInfo(node->debug_info(),
1239 break_point_object); 1239 break_point_object);
1240 if (!result->IsUndefined()) { 1240 if (!result->IsUndefined()) {
1241 // Get information in the break point. 1241 // Get information in the break point.
1242 BreakPointInfo* break_point_info = BreakPointInfo::cast(result); 1242 BreakPointInfo* break_point_info = BreakPointInfo::cast(result);
1243 Handle<DebugInfo> debug_info = node->debug_info(); 1243 Handle<DebugInfo> debug_info = node->debug_info();
1244 Handle<SharedFunctionInfo> shared(debug_info->shared());
1245 int source_position = break_point_info->statement_position()->value();
1246
1247 // Source positions starts with zero.
1248 ASSERT(source_position >= 0);
1249 1244
1250 // Find the break point and clear it. 1245 // Find the break point and clear it.
1251 BreakLocationIterator it(debug_info, SOURCE_BREAK_LOCATIONS); 1246 BreakLocationIterator it(debug_info, SOURCE_BREAK_LOCATIONS);
1252 it.FindBreakLocationFromPosition(source_position); 1247 it.FindBreakLocationFromAddress(debug_info->code()->entry() +
1248 break_point_info->code_position()->value());
1253 it.ClearBreakPoint(break_point_object); 1249 it.ClearBreakPoint(break_point_object);
1254 1250
1255 // If there are no more break points left remove the debug info for this 1251 // If there are no more break points left remove the debug info for this
1256 // function. 1252 // function.
1257 if (debug_info->GetBreakPointCount() == 0) { 1253 if (debug_info->GetBreakPointCount() == 0) {
1258 RemoveDebugInfo(debug_info); 1254 RemoveDebugInfo(debug_info);
1259 } 1255 }
1260 1256
1261 return; 1257 return;
1262 } 1258 }
(...skipping 2540 matching lines...) Expand 10 before | Expand all | Expand 10 after
3803 { 3799 {
3804 Locker locker(reinterpret_cast<v8::Isolate*>(isolate_)); 3800 Locker locker(reinterpret_cast<v8::Isolate*>(isolate_));
3805 isolate_->debugger()->CallMessageDispatchHandler(); 3801 isolate_->debugger()->CallMessageDispatchHandler();
3806 } 3802 }
3807 } 3803 }
3808 } 3804 }
3809 3805
3810 #endif // ENABLE_DEBUGGER_SUPPORT 3806 #endif // ENABLE_DEBUGGER_SUPPORT
3811 3807
3812 } } // namespace v8::internal 3808 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698