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

Unified Diff: src/debug/debug.cc

Issue 1663113002: [debugger] Use code offsets from frame summary in FromFrame Function. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug.cc
diff --git a/src/debug/debug.cc b/src/debug/debug.cc
index 4bd5fa0cf0cd64b761d4bacb59195ac52b2ab28d..e1279a25fa222ffe03dbbd198bb4bc9c285169df 100644
--- a/src/debug/debug.cc
+++ b/src/debug/debug.cc
@@ -149,13 +149,20 @@ BreakLocation BreakLocation::FromCodeOffset(Handle<DebugInfo> debug_info,
return it.GetBreakLocation();
}
+// Move GetFirstFrameSummary Definition to here as FromFrame use it.
+FrameSummary GetFirstFrameSummary(JavaScriptFrame* frame) {
+ List<FrameSummary> frames(FLAG_max_inlining_levels + 1);
+ frame->Summarize(&frames);
+ return frames.first();
+}
+
BreakLocation BreakLocation::FromFrame(Handle<DebugInfo> debug_info,
JavaScriptFrame* frame) {
// Code offset to the instruction after the current one, possibly a break
// location as well. So the "- 1" to exclude it from the search.
- Code* code = frame->LookupCode();
- int code_offset = static_cast<int>(frame->pc() - code->instruction_start());
- return FromCodeOffset(debug_info, code_offset - 1);
+ // Get code offset from the unoptimized code.
+ FrameSummary summary = GetFirstFrameSummary(frame);
+ return FromCodeOffset(debug_info, summary.code_offset() - 1);
}
// Find the break point at the supplied address, or the closest one before
@@ -794,13 +801,6 @@ bool Debug::IsBreakOnException(ExceptionBreakType type) {
}
-FrameSummary GetFirstFrameSummary(JavaScriptFrame* frame) {
- List<FrameSummary> frames(FLAG_max_inlining_levels + 1);
- frame->Summarize(&frames);
- return frames.first();
-}
-
-
void Debug::PrepareStepIn(Handle<JSFunction> function) {
if (!is_active()) return;
if (last_step_action() < StepIn) return;
« 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