Index: src/inspector/v8-stack-trace-impl.cc |
diff --git a/src/inspector/v8-stack-trace-impl.cc b/src/inspector/v8-stack-trace-impl.cc |
index 1a38c6dd82a002b11db462beb6c6ef07e5f9f61f..6c86319603ede9ce3d1df07bc810653e0bb9ca41 100644 |
--- a/src/inspector/v8-stack-trace-impl.cc |
+++ b/src/inspector/v8-stack-trace-impl.cc |
@@ -5,6 +5,7 @@ |
#include "src/inspector/v8-stack-trace-impl.h" |
#include "src/inspector/string-util.h" |
+#include "src/inspector/v8-debugger-agent-impl.h" |
#include "src/inspector/v8-debugger.h" |
#include "src/inspector/v8-inspector-impl.h" |
#include "src/inspector/v8-profiler-agent-impl.h" |
@@ -23,7 +24,8 @@ static const v8::StackTrace::StackTraceOptions stackTraceOptions = |
v8::StackTrace::kScriptId | v8::StackTrace::kScriptNameOrSourceURL | |
v8::StackTrace::kFunctionName); |
-V8StackTraceImpl::Frame toFrame(v8::Local<v8::StackFrame> frame) { |
+V8StackTraceImpl::Frame toFrame(V8DebuggerAgentImpl* agent, |
+ v8::Local<v8::StackFrame> frame) { |
String16 scriptId = String16::fromInteger(frame->GetScriptId()); |
String16 sourceName; |
v8::Local<v8::String> sourceNameValue(frame->GetScriptNameOrSourceURL()); |
@@ -35,13 +37,17 @@ V8StackTraceImpl::Frame toFrame(v8::Local<v8::StackFrame> frame) { |
if (!functionNameValue.IsEmpty()) |
functionName = toProtocolString(functionNameValue); |
- int sourceLineNumber = frame->GetLineNumber(); |
- int sourceColumn = frame->GetColumn(); |
+ int sourceLineNumber = frame->GetLineNumber() - 1; |
+ int sourceColumn = frame->GetColumn() - 1; |
+ if (agent) |
+ agent->wasmTranslation()->TranslateProtocolLocationToWasmScriptLocation( |
dgozman
2016/11/16 19:00:10
This is a wrong place for translation - it could b
Clemens Hammacher
2016/11/16 20:31:30
Not sure if this is fixed with the switch from deb
dgozman
2016/11/16 22:01:27
We can translate here when debugger is disabled, a
Clemens Hammacher
2016/11/16 22:43:31
As discussed in chat: We postpone this, as it seem
|
+ &scriptId, &sourceLineNumber, &sourceColumn); |
return V8StackTraceImpl::Frame(functionName, scriptId, sourceName, |
- sourceLineNumber, sourceColumn); |
+ sourceLineNumber + 1, sourceColumn + 1); |
} |
-void toFramesVector(v8::Local<v8::StackTrace> stackTrace, |
+void toFramesVector(V8DebuggerAgentImpl* agent, |
+ v8::Local<v8::StackTrace> stackTrace, |
std::vector<V8StackTraceImpl::Frame>& frames, |
size_t maxStackSize, v8::Isolate* isolate) { |
DCHECK(isolate->InContext()); |
@@ -50,7 +56,7 @@ void toFramesVector(v8::Local<v8::StackTrace> stackTrace, |
frameCount = static_cast<int>(maxStackSize); |
for (int i = 0; i < frameCount; i++) { |
v8::Local<v8::StackFrame> stackFrame = stackTrace->GetFrame(i); |
- frames.push_back(toFrame(stackFrame)); |
+ frames.push_back(toFrame(agent, stackFrame)); |
} |
} |
@@ -112,8 +118,12 @@ std::unique_ptr<V8StackTraceImpl> V8StackTraceImpl::create( |
v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
v8::HandleScope scope(isolate); |
std::vector<V8StackTraceImpl::Frame> frames; |
+ V8DebuggerAgentImpl* agent = |
+ debugger |
+ ? debugger->inspector()->enabledDebuggerAgentForGroup(contextGroupId) |
+ : nullptr; |
if (!stackTrace.IsEmpty()) |
- toFramesVector(stackTrace, frames, maxStackSize, isolate); |
+ toFramesVector(agent, stackTrace, frames, maxStackSize, isolate); |
int maxAsyncCallChainDepth = 1; |
V8StackTraceImpl* asyncCallChain = nullptr; |