Index: src/debug/debug-frames.cc |
diff --git a/src/debug/debug-frames.cc b/src/debug/debug-frames.cc |
index 012d29162234a6f26466b43bca5bdffc7926abb8..df395fcb1fd2a5f4ea8edec6488802cf54c2a214 100644 |
--- a/src/debug/debug-frames.cc |
+++ b/src/debug/debug-frames.cc |
@@ -69,8 +69,13 @@ Object* FrameInspector::GetExpression(int index) { |
int FrameInspector::GetSourcePosition() { |
- return is_optimized_ ? deoptimized_frame_->GetSourcePosition() |
- : frame_->LookupCode()->SourcePosition(frame_->pc()); |
+ if (is_optimized_) { |
+ return deoptimized_frame_->GetSourcePosition(); |
+ } else { |
+ Code* code = frame_->LookupCode(); |
+ int offset = static_cast<int>(frame_->pc() - code->instruction_start()); |
+ return code->SourcePosition(offset); |
+ } |
} |