diff --git a/bin/ch/ChakraRtInterface.h b/bin/ch/ChakraRtInterface.h
index 0f38dbb7764..1e0a3f54d7b 100644
--- a/bin/ch/ChakraRtInterface.h
+++ b/bin/ch/ChakraRtInterface.h
@@ -243,7 +243,7 @@ class ChakraRTInterface
static JsErrorCode WINAPI JsDiagStartDebugging(JsRuntimeHandle runtimeHandle, JsDiagDebugEventCallback debugEventCallback, void* callbackState) { return m_jsApiHooks.pfJsrtDiagStartDebugging(runtimeHandle, debugEventCallback, callbackState); }
static JsErrorCode WINAPI JsDiagStopDebugging(JsRuntimeHandle runtimeHandle, void** callbackState) { return m_jsApiHooks.pfJsrtDiagStopDebugging(runtimeHandle, callbackState); }
static JsErrorCode WINAPI JsDiagGetSource(unsigned int scriptId, JsValueRef *source) { return m_jsApiHooks.pfJsrtDiagGetSource(scriptId, source); }
- static JsErrorCode WINAPI JsDiagSetBreakpoint(unsigned int scriptId, unsigned int lineNumber, unsigned int columnNumber, JsValueRef *breakPoint) { return m_jsApiHooks.pfJsrtDiagSetBreakpoint(scriptId, lineNumber, columnNumber, breakPoint); }
+ static JsErrorCode WINAPI JsDiagSetBreakpoint(unsigned int scriptId, unsigned int lineNumber, unsigned int columnNumber, JsValueRef *breakpoint) { return m_jsApiHooks.pfJsrtDiagSetBreakpoint(scriptId, lineNumber, columnNumber, breakpoint); }
static JsErrorCode WINAPI JsDiagGetStackTrace(JsValueRef *stackTrace) { return m_jsApiHooks.pfJsrtDiagGetStackTrace(stackTrace); }
static JsErrorCode WINAPI JsDiagRequestAsyncBreak(JsRuntimeHandle runtimeHandle) { return m_jsApiHooks.pfJsrtDiagRequestAsyncBreak(runtimeHandle); }
static JsErrorCode WINAPI JsDiagGetBreakpoints(JsValueRef * breakpoints) { return m_jsApiHooks.pfJsrtDiagGetBreakpoints(breakpoints); }
@@ -252,7 +252,7 @@ class ChakraRTInterface
static JsErrorCode WINAPI JsDiagGetBreakOnException(JsRuntimeHandle runtimeHandle, JsDiagBreakOnExceptionAttributes * exceptionAttributes) { return m_jsApiHooks.pfJsrtDiagGetBreakOnException(runtimeHandle, exceptionAttributes); }
static JsErrorCode WINAPI JsDiagSetStepType(JsDiagStepType stepType) { return m_jsApiHooks.pfJsrtDiagSetStepType(stepType); }
static JsErrorCode WINAPI JsDiagGetScripts(JsValueRef * scriptsArray) { return m_jsApiHooks.pfJsrtDiagGetScripts(scriptsArray); }
- static JsErrorCode WINAPI JsDiagGetFunctionPosition(JsValueRef value, JsValueRef * functionInfo) { return m_jsApiHooks.pfJsrtDiagGetFunctionPosition(value, functionInfo); }
+ static JsErrorCode WINAPI JsDiagGetFunctionPosition(JsValueRef value, JsValueRef * functionPosition) { return m_jsApiHooks.pfJsrtDiagGetFunctionPosition(value, functionPosition); }
static JsErrorCode WINAPI JsDiagGetStackProperties(unsigned int stackFrameIndex, JsValueRef * properties) { return m_jsApiHooks.pfJsrtDiagGetStackProperties(stackFrameIndex, properties); }
static JsErrorCode WINAPI JsDiagGetProperties(unsigned int objectHandle, unsigned int fromCount, unsigned int totalCount, JsValueRef * propertiesObject) { return m_jsApiHooks.pfJsrtDiagGetProperties(objectHandle, fromCount, totalCount, propertiesObject); }
static JsErrorCode WINAPI JsDiagGetObjectFromHandle(unsigned int handle, JsValueRef * handleObject) { return m_jsApiHooks.pfJsrtDiagGetObjectFromHandle(handle, handleObject); }
diff --git a/bin/ch/DbgController.js b/bin/ch/DbgController.js
index bef44ace08e..da698ee52c3 100644
--- a/bin/ch/DbgController.js
+++ b/bin/ch/DbgController.js
@@ -772,15 +772,15 @@ var controllerObj = (function () {
internalPrint(baseline);
}
},
- dumpFunctionInfo: function (funcInfo) {
- if (!funcInfo) {
- funcInfo = {};
+ dumpFunctionPosition: function (functionPosition) {
+ if (!functionPosition) {
+ functionPosition = {};
}
else {
- funcInfo["fileName"] = filterFileName(funcInfo["fileName"]);
+ functionPosition["fileName"] = filterFileName(functionPosition["fileName"]);
}
recordEvent({
- 'functionInfo': funcInfo
+ 'functionPosition': functionPosition
});
},
setInspectMaxStringLength: function (value) {
@@ -800,7 +800,7 @@ var controllerObj = (function () {
case 1:
return "JsDiagDebugEventCompileError";
case 2:
- return "JsDiagDebugEventBreak";
+ return "JsDiagDebugEventBreakpoint";
case 3:
return "JsDiagDebugEventStepComplete";
case 4:
@@ -828,7 +828,7 @@ var controllerObj = (function () {
var stackTrace = callHostFunction(hostDebugObject.JsDiagGetScripts);
break;
case 2:
- /*JsDiagDebugEventBreak*/
+ /*JsDiagDebugEventBreakpoint*/
case 3:
/*JsDiagDebugEventStepComplete*/
case 4:
@@ -929,8 +929,8 @@ function SetBaseline() {
function SetInspectMaxStringLength() {
return controllerObj.setInspectMaxStringLength.apply(controllerObj, arguments);
}
-function DumpFunctionInfo() {
- return controllerObj.dumpFunctionInfo.apply(controllerObj, arguments);
+function DumpFunctionPosition() {
+ return controllerObj.dumpFunctionPosition.apply(controllerObj, arguments);
}
diff --git a/bin/ch/Debugger.cpp b/bin/ch/Debugger.cpp
index 2e4922bb1ac..70a1f48230b 100644
--- a/bin/ch/Debugger.cpp
+++ b/bin/ch/Debugger.cpp
@@ -6,13 +6,13 @@
#define MAX_BASELINE_SIZE (1024*1024*200)
-void CHAKRA_CALLBACK Debugger::JsDiagDebugEventHandler(_In_ JsDiagDebugEvent debugEvent, _In_ JsValueRef eventData, _In_opt_ void* callbackState)
+void CHAKRA_CALLBACK Debugger::DebugEventHandler(_In_ JsDiagDebugEvent debugEvent, _In_ JsValueRef eventData, _In_opt_ void* callbackState)
{
Debugger* debugger = (Debugger*)callbackState;
debugger->HandleDebugEvent(debugEvent, eventData);
}
-JsValueRef Debugger::JsDiagGetSource(JsValueRef callee, bool isConstructCall, JsValueRef * arguments, unsigned short argumentCount, void * callbackState)
+JsValueRef Debugger::GetSource(JsValueRef callee, bool isConstructCall, JsValueRef * arguments, unsigned short argumentCount, void * callbackState)
{
int scriptId;
JsValueRef source = JS_INVALID_REFERENCE;
@@ -26,7 +26,7 @@ JsValueRef Debugger::JsDiagGetSource(JsValueRef callee, bool isConstructCall, Js
return source;
}
-JsValueRef Debugger::JsDiagSetBreakpoint(JsValueRef callee, bool isConstructCall, JsValueRef * arguments, unsigned short argumentCount, void * callbackState)
+JsValueRef Debugger::SetBreakpoint(JsValueRef callee, bool isConstructCall, JsValueRef * arguments, unsigned short argumentCount, void * callbackState)
{
int scriptId;
int line;
@@ -45,21 +45,21 @@ JsValueRef Debugger::JsDiagSetBreakpoint(JsValueRef callee, bool isConstructCall
return bpObject;
}
-JsValueRef Debugger::JsDiagGetStackTrace(JsValueRef callee, bool isConstructCall, JsValueRef * arguments, unsigned short argumentCount, void * callbackState)
+JsValueRef Debugger::GetStackTrace(JsValueRef callee, bool isConstructCall, JsValueRef * arguments, unsigned short argumentCount, void * callbackState)
{
JsValueRef stackInfo = JS_INVALID_REFERENCE;
IfJsErrorFailLogAndRet(ChakraRTInterface::JsDiagGetStackTrace(&stackInfo));
return stackInfo;
}
-JsValueRef Debugger::JsDiagGetBreakpoints(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState)
+JsValueRef Debugger::GetBreakpoints(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState)
{
JsValueRef breakpoints = JS_INVALID_REFERENCE;
IfJsErrorFailLogAndRet(ChakraRTInterface::JsDiagGetBreakpoints(&breakpoints));
return breakpoints;
}
-JsValueRef Debugger::JsDiagRemoveBreakpoint(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState)
+JsValueRef Debugger::RemoveBreakpoint(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState)
{
int bpId;
if (argumentCount > 1)
@@ -74,7 +74,7 @@ JsValueRef Debugger::JsDiagRemoveBreakpoint(JsValueRef callee, bool isConstructC
return JS_INVALID_REFERENCE;
}
-JsValueRef Debugger::JsDiagSetBreakOnException(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState)
+JsValueRef Debugger::SetBreakOnException(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState)
{
int exceptionAttributes;
@@ -90,7 +90,7 @@ JsValueRef Debugger::JsDiagSetBreakOnException(JsValueRef callee, bool isConstru
return JS_INVALID_REFERENCE;
}
-JsValueRef Debugger::JsDiagGetBreakOnException(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState)
+JsValueRef Debugger::GetBreakOnException(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState)
{
JsDiagBreakOnExceptionAttributes exceptionAttributes;
IfJsErrorFailLogAndRet(ChakraRTInterface::JsDiagGetBreakOnException(Debugger::GetRuntime(), &exceptionAttributes));
@@ -100,7 +100,7 @@ JsValueRef Debugger::JsDiagGetBreakOnException(JsValueRef callee, bool isConstru
return exceptionAttributesRef;
}
-JsValueRef Debugger::JsDiagSetStepType(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState)
+JsValueRef Debugger::SetStepType(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState)
{
int stepType;
@@ -113,14 +113,14 @@ JsValueRef Debugger::JsDiagSetStepType(JsValueRef callee, bool isConstructCall,
return JS_INVALID_REFERENCE;
}
-JsValueRef Debugger::JsDiagGetScripts(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState)
+JsValueRef Debugger::GetScripts(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState)
{
JsValueRef sourcesList = JS_INVALID_REFERENCE;
IfJsErrorFailLogAndRet(ChakraRTInterface::JsDiagGetScripts(&sourcesList));
return sourcesList;
}
-JsValueRef Debugger::JsDiagGetStackProperties(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState)
+JsValueRef Debugger::GetStackProperties(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState)
{
JsValueRef properties = JS_INVALID_REFERENCE;
int stackFrameIndex;
@@ -134,7 +134,7 @@ JsValueRef Debugger::JsDiagGetStackProperties(JsValueRef callee, bool isConstruc
return properties;
}
-JsValueRef Debugger::JsDiagGetProperties(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState)
+JsValueRef Debugger::GetProperties(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState)
{
JsValueRef properties = JS_INVALID_REFERENCE;
int objectHandle;
@@ -152,7 +152,7 @@ JsValueRef Debugger::JsDiagGetProperties(JsValueRef callee, bool isConstructCall
return properties;
}
-JsValueRef Debugger::JsDiagGetObjectFromHandle(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState)
+JsValueRef Debugger::GetObjectFromHandle(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState)
{
JsValueRef properties = JS_INVALID_REFERENCE;
int objectHandle;
@@ -166,7 +166,7 @@ JsValueRef Debugger::JsDiagGetObjectFromHandle(JsValueRef callee, bool isConstru
return properties;
}
-JsValueRef Debugger::JsDiagEvaluate(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState)
+JsValueRef Debugger::Evaluate(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState)
{
int stackFrameIndex;
JsValueRef result = JS_INVALID_REFERENCE;
@@ -188,7 +188,7 @@ Debugger::Debugger(JsRuntimeHandle runtime)
{
this->m_runtime = runtime;
this->m_context = JS_INVALID_REFERENCE;
- this->isDetached = true;
+ this->m_isDetached = true;
}
Debugger::~Debugger()
@@ -273,19 +273,19 @@ bool Debugger::Initialize()
bool Debugger::InstallDebugCallbacks(JsValueRef hostDebugObject)
{
HRESULT hr = S_OK;
- IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagGetSource"), Debugger::JsDiagGetSource));
- IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagSetBreakpoint"), Debugger::JsDiagSetBreakpoint));
- IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagGetStackTrace"), Debugger::JsDiagGetStackTrace));
- IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagGetBreakpoints"), Debugger::JsDiagGetBreakpoints));
- IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagRemoveBreakpoint"), Debugger::JsDiagRemoveBreakpoint));
- IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagSetBreakOnException"), Debugger::JsDiagSetBreakOnException));
- IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagGetBreakOnException"), Debugger::JsDiagGetBreakOnException));
- IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagSetStepType"), Debugger::JsDiagSetStepType));
- IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagGetScripts"), Debugger::JsDiagGetScripts));
- IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagGetStackProperties"), Debugger::JsDiagGetStackProperties));
- IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagGetProperties"), Debugger::JsDiagGetProperties));
- IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagGetObjectFromHandle"), Debugger::JsDiagGetObjectFromHandle));
- IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagEvaluate"), Debugger::JsDiagEvaluate));
+ IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagGetSource"), Debugger::GetSource));
+ IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagSetBreakpoint"), Debugger::SetBreakpoint));
+ IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagGetStackTrace"), Debugger::GetStackTrace));
+ IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagGetBreakpoints"), Debugger::GetBreakpoints));
+ IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagRemoveBreakpoint"), Debugger::RemoveBreakpoint));
+ IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagSetBreakOnException"), Debugger::SetBreakOnException));
+ IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagGetBreakOnException"), Debugger::GetBreakOnException));
+ IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagSetStepType"), Debugger::SetStepType));
+ IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagGetScripts"), Debugger::GetScripts));
+ IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagGetStackProperties"), Debugger::GetStackProperties));
+ IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagGetProperties"), Debugger::GetProperties));
+ IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagGetObjectFromHandle"), Debugger::GetObjectFromHandle));
+ IfFalseGo(WScriptJsrt::InstallObjectsOnObject(hostDebugObject, _u("JsDiagEvaluate"), Debugger::Evaluate));
Error:
return hr != S_OK;
}
@@ -342,11 +342,20 @@ bool Debugger::SetBaseline()
}
Error:
if (script)
+ {
delete[] script;
+ }
+
if (wideScript)
+ {
delete[] wideScript;
+ }
+
if (file)
+ {
fclose(file);
+ }
+
return hr == S_OK;
}
@@ -408,16 +417,16 @@ bool Debugger::CallFunctionNoResult(char16 const * functionName, JsValueRef arg1
return this->CallFunction(functionName, &result, arg1, arg2);
}
-bool Debugger::DumpFunctionInfo(JsValueRef functionInfo)
+bool Debugger::DumpFunctionPosition(JsValueRef functionPosition)
{
- return this->CallFunctionNoResult(_u("DumpFunctionInfo"), functionInfo);
+ return this->CallFunctionNoResult(_u("DumpFunctionPosition"), functionPosition);
}
bool Debugger::StartDebugging(JsRuntimeHandle runtime)
{
- IfJsrtErrorFailLogAndRetFalse(ChakraRTInterface::JsDiagStartDebugging(runtime, Debugger::JsDiagDebugEventHandler, this));
+ IfJsrtErrorFailLogAndRetFalse(ChakraRTInterface::JsDiagStartDebugging(runtime, Debugger::DebugEventHandler, this));
- this->isDetached = false;
+ this->m_isDetached = false;
return true;
}
@@ -429,7 +438,7 @@ bool Debugger::StopDebugging(JsRuntimeHandle runtime)
Assert(callbackState == this);
- this->isDetached = true;
+ this->m_isDetached = true;
return true;
}
diff --git a/bin/ch/Debugger.h b/bin/ch/Debugger.h
index b24ac2bf07f..4529edff137 100644
--- a/bin/ch/Debugger.h
+++ b/bin/ch/Debugger.h
@@ -20,35 +20,35 @@ class Debugger
bool HandleDebugEvent(JsDiagDebugEvent debugEvent, JsValueRef eventData);
bool CompareOrWriteBaselineFile(LPCWSTR fileName);
bool SourceRunDown();
- bool DumpFunctionInfo(JsValueRef functionInfo);
- bool IsDetached() const { return isDetached; }
+ bool DumpFunctionPosition(JsValueRef functionPosition);
+ bool IsDetached() const { return m_isDetached; }
private:
Debugger(JsRuntimeHandle runtime);
~Debugger();
bool Initialize();
JsRuntimeHandle m_runtime;
JsContextRef m_context;
- bool isDetached;
+ bool m_isDetached;
bool InstallDebugCallbacks(JsValueRef hostDebugObject);
bool SetBaseline();
bool SetInspectMaxStringLength();
bool CallFunction(char16 const * functionName, JsValueRef *result, JsValueRef arg1 = JS_INVALID_REFERENCE, JsValueRef arg2 = JS_INVALID_REFERENCE);
bool CallFunctionNoResult(char16 const * functionName, JsValueRef arg1 = JS_INVALID_REFERENCE, JsValueRef arg2 = JS_INVALID_REFERENCE);
public:
- static void CALLBACK JsDiagDebugEventHandler(_In_ JsDiagDebugEvent debugEvent, _In_ JsValueRef eventData, _In_opt_ void* callbackState);
- static JsValueRef CALLBACK JsDiagGetSource(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
- static JsValueRef CALLBACK JsDiagSetBreakpoint(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
- static JsValueRef CALLBACK JsDiagGetStackTrace(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
- static JsValueRef CALLBACK JsDiagGetBreakpoints(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
- static JsValueRef CALLBACK JsDiagRemoveBreakpoint(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
- static JsValueRef CALLBACK JsDiagSetBreakOnException(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
- static JsValueRef CALLBACK JsDiagGetBreakOnException(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
- static JsValueRef CALLBACK JsDiagSetStepType(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
- static JsValueRef CALLBACK JsDiagGetScripts(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
- static JsValueRef CALLBACK JsDiagGetStackProperties(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
- static JsValueRef CALLBACK JsDiagGetProperties(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
- static JsValueRef CALLBACK JsDiagGetObjectFromHandle(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
- static JsValueRef CALLBACK JsDiagEvaluate(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
+ static void CALLBACK DebugEventHandler(_In_ JsDiagDebugEvent debugEvent, _In_ JsValueRef eventData, _In_opt_ void* callbackState);
+ static JsValueRef CALLBACK GetSource(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
+ static JsValueRef CALLBACK SetBreakpoint(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
+ static JsValueRef CALLBACK GetStackTrace(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
+ static JsValueRef CALLBACK GetBreakpoints(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
+ static JsValueRef CALLBACK RemoveBreakpoint(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
+ static JsValueRef CALLBACK SetBreakOnException(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
+ static JsValueRef CALLBACK GetBreakOnException(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
+ static JsValueRef CALLBACK SetStepType(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
+ static JsValueRef CALLBACK GetScripts(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
+ static JsValueRef CALLBACK GetStackProperties(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
+ static JsValueRef CALLBACK GetProperties(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
+ static JsValueRef CALLBACK GetObjectFromHandle(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
+ static JsValueRef CALLBACK Evaluate(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
static Debugger* debugger;
};
diff --git a/bin/ch/Encode.js b/bin/ch/Encode.js
index 4bba9d3c9dc..153634b7995 100644
--- a/bin/ch/Encode.js
+++ b/bin/ch/Encode.js
@@ -3,8 +3,7 @@
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
-if (WScript.arguments.length != 2)
-{
+if (WScript.arguments.length != 2) {
WScript.Echo("ERROR: Invalid number of argument");
WScript.Quit(-1);
}
@@ -13,37 +12,34 @@ var input = WScript.arguments(0);
var output = WScript.arguments(1);
var fso = WScript.CreateObject("Scripting.FileSystemObject");
-try
-{
+try {
var f = fso.OpenTextFile(input, 1);
}
-catch (e)
-{
+catch (e) {
WScript.Echo("ERROR: unable to open input file " + input);
WScript.Quit(-1);
}
+
var str = f.ReadAll();
+
f.Close();
-if (str.length == 0)
-{
+if (str.length == 0) {
WScript.Echo("ERROR: input file is empty");
WScript.Quit(-1);
}
-try
-{
+try {
var out = fso.OpenTextFile(output, 2, true, -1);
}
-catch (e)
-{
+catch (e) {
WScript.Echo("ERROR: unable to open output file " + output);
WScript.Quit(-1);
}
-function writeChar(c)
-{
+function writeChar(c) {
var line = false;
+
if (c == "\\") {
c = "\\\\";
} else if (c == "'" || c == "\"") {
@@ -54,20 +50,16 @@ function writeChar(c)
c = "\\n";
line = true;
}
-
+
out.Write("L'" + c + "'");
out.Write(",");
- if (line) out.WriteLine("");
-
+ if (line) {
+ out.WriteLine("");
+ }
}
-for (var i = 0; i < str.length; i++)
-{
- writeChar(str.charAt(i));
+for (var i = 0; i < str.length; i++) {
+ writeChar(str.charAt(i));
}
out.Close();
-
-
-
-
diff --git a/bin/ch/HostConfigFlagsList.h b/bin/ch/HostConfigFlagsList.h
index 48902cbabcf..aae051082b1 100644
--- a/bin/ch/HostConfigFlagsList.h
+++ b/bin/ch/HostConfigFlagsList.h
@@ -5,7 +5,7 @@
#ifdef FLAG
FLAG(BSTR, dbgbaseline, "Baseline file to compare debugger output", NULL)
-FLAG(BSTR, DebugLaunch, "Create the test debugger and execute test in the debug mode", NULL)
+FLAG(bool, DebugLaunch, "Create the test debugger and execute test in the debug mode", false)
FLAG(BSTR, GenerateLibraryByteCodeHeader, "Generate bytecode header file from library code", NULL)
FLAG(int, InspectMaxStringLength, "Max string length to dump in locals inspection", 16)
FLAG(BSTR, Serialized, "If source is UTF8, deserializes from bytecode file", NULL)
diff --git a/bin/ch/WScriptJsrt.cpp b/bin/ch/WScriptJsrt.cpp
index 82793158757..c5a376b5a28 100644
--- a/bin/ch/WScriptJsrt.cpp
+++ b/bin/ch/WScriptJsrt.cpp
@@ -445,7 +445,7 @@ JsValueRef WScriptJsrt::AttachCallback(JsValueRef callee, bool isConstructCall,
{
goto Error;
}
- QueueDebugOperation(arguments[1], [=](WScriptJsrt::CallbackMessage& msg)
+ QueueDebugOperation(arguments[1], [](WScriptJsrt::CallbackMessage& msg)
{
JsContextRef currentContext = JS_INVALID_REFERENCE;
ChakraRTInterface::JsGetCurrentContext(¤tContext);
@@ -486,7 +486,7 @@ JsValueRef WScriptJsrt::DetachCallback(JsValueRef callee, bool isConstructCall,
{
goto Error;
}
- QueueDebugOperation(arguments[1], [=](WScriptJsrt::CallbackMessage& msg)
+ QueueDebugOperation(arguments[1], [](WScriptJsrt::CallbackMessage& msg)
{
JsContextRef currentContext = JS_INVALID_REFERENCE;
ChakraRTInterface::JsGetCurrentContext(¤tContext);
@@ -514,21 +514,21 @@ JsValueRef WScriptJsrt::DetachCallback(JsValueRef callee, bool isConstructCall,
return JS_INVALID_REFERENCE;
}
-JsValueRef WScriptJsrt::DumpFunctionInfoCallback(JsValueRef callee, bool isConstructCall, JsValueRef * arguments, unsigned short argumentCount, void * callbackState)
+JsValueRef WScriptJsrt::DumpFunctionPositionCallback(JsValueRef callee, bool isConstructCall, JsValueRef * arguments, unsigned short argumentCount, void * callbackState)
{
- JsValueRef functionInfo = JS_INVALID_REFERENCE;
+ JsValueRef functionPosition = JS_INVALID_REFERENCE;
if (argumentCount > 1)
{
- if (ChakraRTInterface::JsDiagGetFunctionPosition(arguments[1], &functionInfo) != JsNoError)
+ if (ChakraRTInterface::JsDiagGetFunctionPosition(arguments[1], &functionPosition) != JsNoError)
{
- // If we can't get the functionInfo pass undefined
- IfJsErrorFailLogAndRet(ChakraRTInterface::JsGetUndefinedValue(&functionInfo));
+ // If we can't get the functionPosition pass undefined
+ IfJsErrorFailLogAndRet(ChakraRTInterface::JsGetUndefinedValue(&functionPosition));
}
if (Debugger::debugger != nullptr)
{
- Debugger::debugger->DumpFunctionInfo(functionInfo);
+ Debugger::debugger->DumpFunctionPosition(functionPosition);
}
}
@@ -587,10 +587,8 @@ bool WScriptJsrt::Initialize()
IfFalseGo(WScriptJsrt::InstallObjectsOnObject(wscript, L"SetTimeout", SetTimeoutCallback));
IfFalseGo(WScriptJsrt::InstallObjectsOnObject(wscript, L"ClearTimeout", ClearTimeoutCallback));
IfFalseGo(WScriptJsrt::InstallObjectsOnObject(wscript, L"Attach", AttachCallback));
- IfFalseGo(WScriptJsrt::InstallObjectsOnObject(wscript, L"SetTimeout", SetTimeoutCallback));
- IfFalseGo(WScriptJsrt::InstallObjectsOnObject(wscript, L"SetTimeout", SetTimeoutCallback));
IfFalseGo(WScriptJsrt::InstallObjectsOnObject(wscript, L"Detach", DetachCallback));
- IfFalseGo(WScriptJsrt::InstallObjectsOnObject(wscript, L"DumpFunctionInfo", DumpFunctionInfoCallback));
+ IfFalseGo(WScriptJsrt::InstallObjectsOnObject(wscript, L"DumpFunctionPosition", DumpFunctionPositionCallback));
IfFalseGo(WScriptJsrt::InstallObjectsOnObject(wscript, L"RequestAsyncBreak", RequestAsyncBreakCallback));
// ToDo Remove
diff --git a/bin/ch/WScriptJsrt.h b/bin/ch/WScriptJsrt.h
index b7b645ecce4..d5da326fa1e 100644
--- a/bin/ch/WScriptJsrt.h
+++ b/bin/ch/WScriptJsrt.h
@@ -76,7 +76,7 @@ class WScriptJsrt
static JsValueRef __stdcall ClearTimeoutCallback(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
static JsValueRef __stdcall AttachCallback(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
static JsValueRef __stdcall DetachCallback(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
- static JsValueRef __stdcall DumpFunctionInfoCallback(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
+ static JsValueRef __stdcall DumpFunctionPositionCallback(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
static JsValueRef __stdcall RequestAsyncBreakCallback(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
static JsValueRef __stdcall EmptyCallback(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState);
diff --git a/bin/ch/ch.cpp b/bin/ch/ch.cpp
index d401436e2bd..458c4bdb17a 100644
--- a/bin/ch/ch.cpp
+++ b/bin/ch/ch.cpp
@@ -298,7 +298,7 @@ HRESULT ExecuteTest(LPCWSTR fileName)
}
IfJsErrorFailLog(ChakraRTInterface::JsCreateRuntime(jsrtAttributes, nullptr, &runtime));
- if (HostConfigFlags::flags.DebugLaunchIsEnabled)
+ if (HostConfigFlags::flags.DebugLaunch)
{
Debugger* debugger = Debugger::GetDebugger(runtime);
debugger->StartDebugging(runtime);
diff --git a/lib/Jsrt/ChakraCommon.h b/lib/Jsrt/ChakraCommon.h
index 46a167ac09f..8d896fbec7e 100644
--- a/lib/Jsrt/ChakraCommon.h
+++ b/lib/Jsrt/ChakraCommon.h
@@ -245,7 +245,7 @@ typedef unsigned char* ChakraBytePtr;
///
/// The debugging API can only be called when VM is in debug mode
///
- JsErrorDiagNotDebugging,
+ JsErrorDiagNotInDebugMode,
///
/// The debugging API can only be called when VM is at a break
///
diff --git a/lib/Jsrt/ChakraDebug.h b/lib/Jsrt/ChakraDebug.h
index 3c6d897b727..9b3b12cb252 100644
--- a/lib/Jsrt/ChakraDebug.h
+++ b/lib/Jsrt/ChakraDebug.h
@@ -32,7 +32,7 @@
///
/// Indicates a new script being compiled, this includes script, eval, new function.
///
- JsDiagDebugEventSourceCompile= 0,
+ JsDiagDebugEventSourceCompile = 0,
///
/// Indicates compile error for a script.
///
@@ -40,7 +40,7 @@
///
/// Indicates a break due to a breakpoint.
///
- JsDiagDebugEventBreak = 2,
+ JsDiagDebugEventBreakpoint = 2,
///
/// Indicates a break after completion of step action.
///
@@ -118,7 +118,7 @@
/// The code JsNoError if the operation succeeded, a failure code otherwise.
///
///
- /// The runtime should be active on the current thread and should not be in debug state
+ /// The runtime should be active on the current thread and should not be in debug state.
///
CHAKRA_API
JsDiagStartDebugging(
@@ -186,7 +186,7 @@
/// Id of script from JsDiagGetScripts or JsDiagGetSource to put breakpoint.
/// 0 based line number to put breakpoint.
/// 0 based column number to put breakpoint.
- /// Breakpoint object with id, line and column if success.
+ /// Breakpoint object with id, line and column if success.
///
///
/// {
@@ -207,7 +207,7 @@
_In_ unsigned int scriptId,
_In_ unsigned int lineNumber,
_In_ unsigned int columnNumber,
- _Out_ JsValueRef *breakPoint);
+ _Out_ JsValueRef *breakpoint);
///
/// Remove a breakpoint.
@@ -338,7 +338,7 @@
/// Gets the source information for a function object.
///
/// JavaScript function.
- /// Function info, scriptId, start line, start column, line number of first statement, column number of first statement.
+ /// Function position - scriptId, start line, start column, line number of first statement, column number of first statement.
///
///
/// {
@@ -360,7 +360,7 @@
CHAKRA_API
JsDiagGetFunctionPosition(
_In_ JsValueRef function,
- _Out_ JsValueRef *functionInfo);
+ _Out_ JsValueRef *functionPosition);
///
/// Gets the stack trace information.
@@ -459,10 +459,10 @@
_Out_ JsValueRef *properties);
///
- /// Gets the list of childrens of a handle.
+ /// Gets the list of children of a handle.
///
/// Handle of object.
- /// 0-based from count of properties, ideally 0.
+ /// 0-based from count of properties, usually 0.
/// Number of properties to return.
/// Array of properties.
/// Handle should be from objects returned from call to JsDiagGetStackProperties.
@@ -505,7 +505,7 @@
_Out_ JsValueRef *propertiesObject);
///
- /// Get the object corresponding to handle.
+ /// Gets the object corresponding to handle.
///
/// Handle of object.
/// Object corresponding to the handle.
@@ -534,7 +534,7 @@
#ifdef _WIN32
///
- /// Evaluate an expression on given frame.
+ /// Evaluates an expression on given frame.
///
/// Expression to evaluate.
/// Index of stack frame on which to evaluate the expression.
diff --git a/lib/Jsrt/JsrtDebugManager.cpp b/lib/Jsrt/JsrtDebugManager.cpp
index ea2d8700f42..7b49cc54e9f 100644
--- a/lib/Jsrt/JsrtDebugManager.cpp
+++ b/lib/Jsrt/JsrtDebugManager.cpp
@@ -95,7 +95,7 @@ void JsrtDebugManager::DispatchHalt(Js::InterpreterHaltState* haltState)
{
switch (haltState->stopType)
{
- case Js::STOP_BREAKPOINT: /*JsDiagDebugEventBreak*/
+ case Js::STOP_BREAKPOINT: /*JsDiagDebugEventBreakpoint*/
case Js::STOP_INLINEBREAKPOINT: /*JsDiagDebugEventDebuggerStatement*/
case Js::STOP_ASYNCBREAK: /*JsDiagDebugEventAsyncBreak*/
this->ReportBreak(haltState);
@@ -224,7 +224,7 @@ void JsrtDebugManager::ReportBreak(Js::InterpreterHaltState* haltState)
Js::ProbeContainer* probeContainer = scriptContext->GetDebugContext()->GetProbeContainer();
- if (jsDiagDebugEvent == JsDiagDebugEventBreak)
+ if (jsDiagDebugEvent == JsDiagDebugEventBreakpoint)
{
UINT bpId = 0;
probeContainer->MapProbesUntil([&](int i, Js::Probe* pProbe)
@@ -238,7 +238,7 @@ void JsrtDebugManager::ReportBreak(Js::InterpreterHaltState* haltState)
return false;
});
- AssertMsg(bpId != 0, "How come we don't have a breakpoint id for JsDiagDebugEventBreak");
+ AssertMsg(bpId != 0, "How come we don't have a breakpoint id for JsDiagDebugEventBreakpoint");
JsrtDebugUtils::AddPropertyToObject(eventDataObject, JsrtDebugPropertyId::breakpointId, bpId, scriptContext);
}
@@ -300,20 +300,11 @@ void JsrtDebugManager::ReportExceptionBreak(Js::InterpreterHaltState* haltState)
void JsrtDebugManager::HandleResume(Js::InterpreterHaltState* haltState, BREAKRESUMEACTION resumeAction)
{
+ Assert(resumeAction != BREAKRESUMEACTION_ABORT);
+
Js::ScriptContext* scriptContext = haltState->framePointers->Peek()->GetScriptContext();
- if (resumeAction == BREAKRESUMEACTION_ABORT)
- {
- // In this case we need to abort script execution entirely and also stop working on any breakpoint for this engine.
- scriptContext->GetDebugContext()->GetProbeContainer()->RemoveAllProbes();
- scriptContext->GetDebugContext()->GetProbeContainer()->UninstallInlineBreakpointProbe(NULL);
- scriptContext->GetDebugContext()->GetProbeContainer()->UninstallDebuggerScriptOptionCallback();
- throw Js::ScriptAbortException();
- }
- else
- {
- scriptContext->GetThreadContext()->GetDebugManager()->stepController.HandleResumeAction(haltState, resumeAction);
- }
+ scriptContext->GetThreadContext()->GetDebugManager()->stepController.HandleResumeAction(haltState, resumeAction);
}
void JsrtDebugManager::SetResumeType(BREAKRESUMEACTION resumeAction)
@@ -437,10 +428,9 @@ Js::JavascriptArray* JsrtDebugManager::GetScripts(Js::ScriptContext* scriptConte
tempScriptContext != nullptr && !tempScriptContext->IsClosed();
tempScriptContext = tempScriptContext->next)
{
- tempScriptContext->GetSourceList()->Map([&](int i, RecyclerWeakReference* utf8SourceInfoWeakRef)
+ tempScriptContext->MapScript([&](Js::Utf8SourceInfo* utf8SourceInfo)
{
- Js::Utf8SourceInfo* utf8SourceInfo = utf8SourceInfoWeakRef->Get();
- if (utf8SourceInfo != nullptr && !utf8SourceInfo->GetIsLibraryCode() && utf8SourceInfo->HasDebugDocument())
+ if (!utf8SourceInfo->GetIsLibraryCode() && utf8SourceInfo->HasDebugDocument())
{
bool isCallerLibraryCode = false;
@@ -465,7 +455,7 @@ Js::JavascriptArray* JsrtDebugManager::GetScripts(Js::ScriptContext* scriptConte
if (sourceObj != nullptr)
{
Js::Var marshaledObj = Js::CrossSite::MarshalVar(scriptContext, sourceObj);
- Js::JavascriptOperators::OP_SetElementI((Js::Var)scriptsArray, Js::JavascriptNumber::ToVar(index, scriptContext), marshaledObj, scriptContext);
+ scriptsArray->DirectSetItemAt(index, marshaledObj);
index++;
}
}
@@ -484,10 +474,9 @@ Js::DynamicObject* JsrtDebugManager::GetSource(Js::ScriptContext* scriptContext,
tempScriptContext != nullptr && utf8SourceInfo == nullptr && !tempScriptContext->IsClosed();
tempScriptContext = tempScriptContext->next)
{
- tempScriptContext->GetSourceList()->MapUntil([&](int i, RecyclerWeakReference* sourceInfoWeakRef) -> bool
+ tempScriptContext->MapScript([&](Js::Utf8SourceInfo* sourceInfo) -> bool
{
- Js::Utf8SourceInfo* sourceInfo = sourceInfoWeakRef->Get();
- if (sourceInfo != nullptr && sourceInfo->IsInDebugMode() && sourceInfo->GetSourceInfoId() == scriptId)
+ if (sourceInfo->IsInDebugMode() && sourceInfo->GetSourceInfoId() == scriptId)
{
utf8SourceInfo = sourceInfo;
return true;
@@ -537,8 +526,8 @@ Js::DynamicObject* JsrtDebugManager::SetBreakPoint(Js::ScriptContext* scriptCont
Js::DebugDocument* debugDocument = utf8SourceInfo->GetDebugDocument();
if (debugDocument != nullptr && SUCCEEDED(utf8SourceInfo->EnsureLineOffsetCacheNoThrow()) && lineNumber < utf8SourceInfo->GetLineCount())
{
- charcount_t charPosition;
- charcount_t byteOffset;
+ charcount_t charPosition = 0;
+ charcount_t byteOffset = 0;
utf8SourceInfo->GetCharPositionForLineInfo((charcount_t)lineNumber, &charPosition, &byteOffset);
long ibos = charPosition + columnNumber + 1;
@@ -550,7 +539,7 @@ Js::DynamicObject* JsrtDebugManager::SetBreakPoint(Js::ScriptContext* scriptCont
// Don't see a use case for supporting multiple breakpoints at same location.
// If a breakpoint already exists, just return that
- Js::BreakpointProbe* probe = debugDocument->FindBreakpointId(statement);
+ Js::BreakpointProbe* probe = debugDocument->FindBreakpoint(statement);
if (probe == nullptr)
{
probe = debugDocument->SetBreakPoint(statement, BREAKPOINT_ENABLED);
@@ -677,7 +666,7 @@ JsDiagDebugEvent JsrtDebugManager::GetDebugEventFromStopType(Js::StopType stopTy
{
switch (stopType)
{
- case Js::STOP_BREAKPOINT: return JsDiagDebugEventBreak;
+ case Js::STOP_BREAKPOINT: return JsDiagDebugEventBreakpoint;
case Js::STOP_INLINEBREAKPOINT: return JsDiagDebugEventDebuggerStatement;
case Js::STOP_STEPCOMPLETE: return JsDiagDebugEventStepComplete;
case Js::STOP_EXCEPTIONTHROW: return JsDiagDebugEventRuntimeException;
@@ -689,5 +678,5 @@ JsDiagDebugEvent JsrtDebugManager::GetDebugEventFromStopType(Js::StopType stopTy
break;
}
- return JsDiagDebugEventBreak;
+ return JsDiagDebugEventBreakpoint;
}
diff --git a/lib/Jsrt/JsrtDebuggerObject.cpp b/lib/Jsrt/JsrtDebuggerObject.cpp
index 462cc241333..97afb9a4bda 100644
--- a/lib/Jsrt/JsrtDebuggerObject.cpp
+++ b/lib/Jsrt/JsrtDebuggerObject.cpp
@@ -26,13 +26,13 @@ JsrtDebuggerObjectsManager * JsrtDebuggerObjectBase::GetDebuggerObjectsManager()
return this->debuggerObjectsManager;
}
-Js::DynamicObject * JsrtDebuggerObjectBase::GetChildrens(Js::ScriptContext * scriptContext, uint fromCount, uint totalCount)
+Js::DynamicObject * JsrtDebuggerObjectBase::GetChildren(Js::ScriptContext * scriptContext, uint fromCount, uint totalCount)
{
- AssertMsg(false, "Wrong type for GetChildrens");
+ AssertMsg(false, "Wrong type for GetChildren");
return nullptr;
}
-Js::DynamicObject * JsrtDebuggerObjectBase::GetChildrens(WeakArenaReference* walkerRef, Js::ScriptContext * scriptContext, uint fromCount, uint totalCount)
+Js::DynamicObject * JsrtDebuggerObjectBase::GetChildren(WeakArenaReference* walkerRef, Js::ScriptContext * scriptContext, uint fromCount, uint totalCount)
{
Js::DynamicObject* childrensObject = scriptContext->GetLibrary()->CreateObject();
@@ -562,7 +562,7 @@ Js::DynamicObject * JsrtDebuggerObjectProperty::GetJSONObject(Js::ScriptContext*
return propertyObject;
}
-Js::DynamicObject* JsrtDebuggerObjectProperty::GetChildrens(Js::ScriptContext* scriptContext, uint fromCount, uint totalCount)
+Js::DynamicObject* JsrtDebuggerObjectProperty::GetChildren(Js::ScriptContext* scriptContext, uint fromCount, uint totalCount)
{
Js::IDiagObjectModelDisplay* objectDisplayRef = objectDisplay->GetStrongReference();
if (objectDisplayRef == nullptr)
@@ -575,7 +575,7 @@ Js::DynamicObject* JsrtDebuggerObjectProperty::GetChildrens(Js::ScriptContext* s
this->walkerRef = objectDisplayRef->CreateWalker();
}
- Js::DynamicObject* childrens = __super::GetChildrens(this->walkerRef, scriptContext, fromCount, totalCount);
+ Js::DynamicObject* childrens = __super::GetChildren(this->walkerRef, scriptContext, fromCount, totalCount);
objectDisplay->ReleaseStrongReference();
@@ -633,7 +633,7 @@ Js::DynamicObject * JsrtDebuggerObjectScope::GetJSONObject(Js::ScriptContext* sc
return scopeObject;
}
-Js::DynamicObject * JsrtDebuggerObjectScope::GetChildrens(Js::ScriptContext * scriptContext, uint fromCount, uint totalCount)
+Js::DynamicObject * JsrtDebuggerObjectScope::GetChildren(Js::ScriptContext * scriptContext, uint fromCount, uint totalCount)
{
Js::IDiagObjectModelDisplay* objectDisplayRef = objectDisplay->GetStrongReference();
if (objectDisplayRef == nullptr)
@@ -646,7 +646,7 @@ Js::DynamicObject * JsrtDebuggerObjectScope::GetChildrens(Js::ScriptContext * sc
this->walkerRef = objectDisplayRef->CreateWalker();
}
- Js::DynamicObject* childrens = __super::GetChildrens(this->walkerRef, scriptContext, fromCount, totalCount);
+ Js::DynamicObject* childrens = __super::GetChildren(this->walkerRef, scriptContext, fromCount, totalCount);
objectDisplay->ReleaseStrongReference();
@@ -743,7 +743,7 @@ Js::DynamicObject * JsrtDebuggerObjectGlobalsNode::GetJSONObject(Js::ScriptConte
return globalsNode;
}
-Js::DynamicObject * JsrtDebuggerObjectGlobalsNode::GetChildrens(Js::ScriptContext * scriptContext, uint fromCount, uint totalCount)
+Js::DynamicObject * JsrtDebuggerObjectGlobalsNode::GetChildren(Js::ScriptContext * scriptContext, uint fromCount, uint totalCount)
{
Js::IDiagObjectModelDisplay* objectDisplayRef = objectDisplay->GetStrongReference();
if (objectDisplayRef == nullptr)
@@ -756,7 +756,7 @@ Js::DynamicObject * JsrtDebuggerObjectGlobalsNode::GetChildrens(Js::ScriptContex
this->walkerRef = objectDisplayRef->CreateWalker();
}
- Js::DynamicObject* childrens = __super::GetChildrens(this->walkerRef, scriptContext, fromCount, totalCount);
+ Js::DynamicObject* childrens = __super::GetChildren(this->walkerRef, scriptContext, fromCount, totalCount);
objectDisplay->ReleaseStrongReference();
diff --git a/lib/Jsrt/JsrtDebuggerObject.h b/lib/Jsrt/JsrtDebuggerObject.h
index 32bec7c6789..895ba8d5a66 100644
--- a/lib/Jsrt/JsrtDebuggerObject.h
+++ b/lib/Jsrt/JsrtDebuggerObject.h
@@ -28,7 +28,7 @@ class JsrtDebuggerObjectBase
uint GetHandle() const { return handle; }
JsrtDebuggerObjectsManager* GetDebuggerObjectsManager();
virtual Js::DynamicObject* GetJSONObject(Js::ScriptContext* scriptContext) = 0;
- virtual Js::DynamicObject* GetChildrens(Js::ScriptContext* scriptContext, uint fromCount, uint totalCount);
+ virtual Js::DynamicObject* GetChildren(Js::ScriptContext* scriptContext, uint fromCount, uint totalCount);
template
static void CreateDebuggerObject(JsrtDebuggerObjectsManager* debuggerObjectsManager, Js::ResolvedObject resolvedObject, Js::ScriptContext* scriptContext, PostFunction postFunction)
@@ -47,7 +47,7 @@ class JsrtDebuggerObjectBase
}
protected:
- Js::DynamicObject* GetChildrens(WeakArenaReference* walkerRef, Js::ScriptContext * scriptContext, uint fromCount, uint totalCount);
+ Js::DynamicObject* GetChildren(WeakArenaReference* walkerRef, Js::ScriptContext * scriptContext, uint fromCount, uint totalCount);
private:
JsrtDebuggerObjectType type;
@@ -73,7 +73,7 @@ class JsrtDebuggerObjectProperty : public JsrtDebuggerObjectBase
static JsrtDebuggerObjectBase* Make(JsrtDebuggerObjectsManager* debuggerObjectsManager, WeakArenaReference* objectDisplay);
Js::DynamicObject* GetJSONObject(Js::ScriptContext* scriptContext);
- Js::DynamicObject* GetChildrens(Js::ScriptContext* scriptContext, uint fromCount, uint totalCount);
+ Js::DynamicObject* GetChildren(Js::ScriptContext* scriptContext, uint fromCount, uint totalCount);
private:
JsrtDebuggerObjectProperty(JsrtDebuggerObjectsManager* debuggerObjectsManager, WeakArenaReference* objectDisplay);
@@ -88,7 +88,7 @@ class JsrtDebuggerObjectGlobalsNode : public JsrtDebuggerObjectBase
static JsrtDebuggerObjectBase* Make(JsrtDebuggerObjectsManager* debuggerObjectsManager, WeakArenaReference* objectDisplay);
Js::DynamicObject* GetJSONObject(Js::ScriptContext* scriptContext);
- Js::DynamicObject* GetChildrens(Js::ScriptContext* scriptContext, uint fromCount, uint totalCount);
+ Js::DynamicObject* GetChildren(Js::ScriptContext* scriptContext, uint fromCount, uint totalCount);
private:
JsrtDebuggerObjectGlobalsNode(JsrtDebuggerObjectsManager* debuggerObjectsManager, WeakArenaReference* objectDisplay);
@@ -103,7 +103,7 @@ class JsrtDebuggerObjectScope : public JsrtDebuggerObjectBase
static JsrtDebuggerObjectBase* Make(JsrtDebuggerObjectsManager* debuggerObjectsManager, WeakArenaReference* objectDisplay, uint index);
Js::DynamicObject* GetJSONObject(Js::ScriptContext* scriptContext);
- Js::DynamicObject* GetChildrens(Js::ScriptContext* scriptContext, uint fromCount, uint totalCount);
+ Js::DynamicObject* GetChildren(Js::ScriptContext* scriptContext, uint fromCount, uint totalCount);
private:
JsrtDebuggerObjectScope(JsrtDebuggerObjectsManager* debuggerObjectsManager, WeakArenaReference* objectDisplay, uint index);
diff --git a/lib/Jsrt/JsrtDiag.cpp b/lib/Jsrt/JsrtDiag.cpp
index b6b7c419907..a266cd02fcb 100644
--- a/lib/Jsrt/JsrtDiag.cpp
+++ b/lib/Jsrt/JsrtDiag.cpp
@@ -12,7 +12,7 @@
#define VALIDATE_IS_DEBUGGING(jsrtDebugManager) \
if (jsrtDebugManager == nullptr || !jsrtDebugManager->IsDebugEventCallbackSet()) \
{ \
- return JsErrorDiagNotDebugging; \
+ return JsErrorDiagNotInDebugMode; \
}
#define VALIDATE_RUNTIME_IS_AT_BREAK(runtime) \
@@ -21,6 +21,25 @@
return JsErrorDiagNotAtBreak; \
}
+#define VALIDATE_RUNTIME_STATE_FOR_START_STOP_DEBUGGING(threadContext) \
+ if (threadContext->GetRecycler() && threadContext->GetRecycler()->IsHeapEnumInProgress()) \
+ { \
+ return JsErrorHeapEnumInProgress; \
+ } \
+ else if (threadContext->IsInThreadServiceCallback()) \
+ { \
+ return JsErrorInThreadServiceCallback; \
+ } \
+ else if (threadContext->IsInScript()) \
+ { \
+ return JsErrorRuntimeInUse; \
+ } \
+ ThreadContextScope scope(threadContext); \
+ if (!scope.IsValid()) \
+ { \
+ return JsErrorWrongThread; \
+ }
+
CHAKRA_API JsDiagStartDebugging(
_In_ JsRuntimeHandle runtimeHandle,
_In_ JsDiagDebugEventCallback debugEventCallback,
@@ -35,28 +54,11 @@ CHAKRA_API JsDiagStartDebugging(
JsrtRuntime * runtime = JsrtRuntime::FromHandle(runtimeHandle);
ThreadContext * threadContext = runtime->GetThreadContext();
- if (threadContext->GetRecycler() && threadContext->GetRecycler()->IsHeapEnumInProgress())
- {
- return JsErrorHeapEnumInProgress;
- }
- else if (threadContext->IsInThreadServiceCallback())
- {
- return JsErrorInThreadServiceCallback;
- }
- else if (threadContext->IsInScript())
- {
- return JsErrorRuntimeInUse;
- }
- else if (runtime->GetJsrtDebugManager() != nullptr && runtime->GetJsrtDebugManager()->IsDebugEventCallbackSet())
- {
- return JsErrorDiagAlreadyInDebugMode;
- }
-
- ThreadContextScope scope(threadContext);
+ VALIDATE_RUNTIME_STATE_FOR_START_STOP_DEBUGGING(threadContext);
- if (!scope.IsValid())
+ if (runtime->GetJsrtDebugManager() != nullptr && runtime->GetJsrtDebugManager()->IsDebugEventCallbackSet())
{
- return JsErrorWrongThread;
+ return JsErrorDiagAlreadyInDebugMode;
}
// Create the debug object to save callback function and data
@@ -86,8 +88,8 @@ CHAKRA_API JsDiagStartDebugging(
if (FAILED(scriptContext->OnDebuggerAttached()))
{
- AssertMsg(false, "Failed to start debugging");
- return JsErrorFatal; // Inconsistent state, we can't continue from here?
+ Debugger_AttachDetach_fatal_error(); // Inconsistent state, we can't continue from here
+ return JsErrorFatal;
}
Js::ProbeContainer* probeContainer = debugContext->GetProbeContainer();
@@ -114,25 +116,7 @@ CHAKRA_API JsDiagStopDebugging(
JsrtRuntime * runtime = JsrtRuntime::FromHandle(runtimeHandle);
ThreadContext * threadContext = runtime->GetThreadContext();
- if (threadContext->GetRecycler() && threadContext->GetRecycler()->IsHeapEnumInProgress())
- {
- return JsErrorHeapEnumInProgress;
- }
- else if (threadContext->IsInThreadServiceCallback())
- {
- return JsErrorInThreadServiceCallback;
- }
- else if (threadContext->IsInScript())
- {
- return JsErrorRuntimeInUse;
- }
-
- ThreadContextScope scope(threadContext);
-
- if (!scope.IsValid())
- {
- return JsErrorWrongThread;
- }
+ VALIDATE_RUNTIME_STATE_FOR_START_STOP_DEBUGGING(threadContext);
JsrtDebugManager* jsrtDebugManager = runtime->GetJsrtDebugManager();
@@ -146,8 +130,8 @@ CHAKRA_API JsDiagStopDebugging(
if (FAILED(scriptContext->OnDebuggerDetached()))
{
- AssertMsg(false, "Failed to stop debugging");
- return JsErrorFatal; // Inconsistent state, we can't continue from here?
+ Debugger_AttachDetach_fatal_error(); // Inconsistent state, we can't continue from here
+ return JsErrorFatal;
}
Js::DebugContext* debugContext = scriptContext->GetDebugContext();
@@ -287,13 +271,13 @@ CHAKRA_API JsDiagSetBreakpoint(
_In_ unsigned int scriptId,
_In_ unsigned int lineNumber,
_In_ unsigned int columnNumber,
- _Out_ JsValueRef *breakPoint)
+ _Out_ JsValueRef *breakpoint)
{
return GlobalAPIWrapper([&]() -> JsErrorCode {
- PARAM_NOT_NULL(breakPoint);
+ PARAM_NOT_NULL(breakpoint);
- *breakPoint = JS_INVALID_REFERENCE;
+ *breakpoint = JS_INVALID_REFERENCE;
JsrtContext *currentContext = JsrtContext::GetCurrent();
@@ -314,10 +298,9 @@ CHAKRA_API JsDiagSetBreakpoint(
scriptContext != nullptr && utf8SourceInfo == nullptr && !scriptContext->IsClosed();
scriptContext = scriptContext->next)
{
- scriptContext->GetSourceList()->MapUntil([&](int i, RecyclerWeakReference* sourceInfoWeakRef) -> bool
+ scriptContext->MapScript([&](Js::Utf8SourceInfo* sourceInfo) -> bool
{
- Js::Utf8SourceInfo* sourceInfo = sourceInfoWeakRef->Get();
- if (sourceInfo != nullptr && sourceInfo->GetSourceInfoId() == scriptId)
+ if (sourceInfo->GetSourceInfoId() == scriptId)
{
utf8SourceInfo = sourceInfo;
return true;
@@ -334,7 +317,7 @@ CHAKRA_API JsDiagSetBreakpoint(
if(bpObject != nullptr)
{
- *breakPoint = bpObject;
+ *breakpoint = bpObject;
return JsNoError;
}
@@ -451,14 +434,14 @@ CHAKRA_API JsDiagSetStepType(
CHAKRA_API JsDiagGetFunctionPosition(
_In_ JsValueRef function,
- _Out_ JsValueRef *functionInfo)
+ _Out_ JsValueRef *functionPosition)
{
return ContextAPIWrapper([&](Js::ScriptContext *scriptContext) -> JsErrorCode {
VALIDATE_INCOMING_REFERENCE(function, scriptContext);
- PARAM_NOT_NULL(functionInfo);
+ PARAM_NOT_NULL(functionPosition);
- *functionInfo = JS_INVALID_REFERENCE;
+ *functionPosition = JS_INVALID_REFERENCE;
if (!Js::RecyclableObject::Is(function) || !Js::ScriptFunction::Is(function))
{
@@ -481,18 +464,18 @@ CHAKRA_API JsDiagGetFunctionPosition(
if (functionBody->GetLineCharOffsetFromStartChar(startOffset, &firstStatementLine, &firstStatementColumn))
{
- Js::DynamicObject* funcInfoObject = (Js::DynamicObject*)Js::CrossSite::MarshalVar(utf8SourceInfo->GetScriptContext(), scriptContext->GetLibrary()->CreateObject());
+ Js::DynamicObject* funcPositionObject = (Js::DynamicObject*)Js::CrossSite::MarshalVar(utf8SourceInfo->GetScriptContext(), scriptContext->GetLibrary()->CreateObject());
- if (funcInfoObject != nullptr)
+ if (funcPositionObject != nullptr)
{
- JsrtDebugUtils::AddScriptIdToObject(funcInfoObject, utf8SourceInfo);
- JsrtDebugUtils::AddFileNameOrScriptTypeToObject(funcInfoObject, utf8SourceInfo);
- JsrtDebugUtils::AddPropertyToObject(funcInfoObject, JsrtDebugPropertyId::line, lineNumber, scriptContext);
- JsrtDebugUtils::AddPropertyToObject(funcInfoObject, JsrtDebugPropertyId::column, columnNumber, scriptContext);
- JsrtDebugUtils::AddPropertyToObject(funcInfoObject, JsrtDebugPropertyId::firstStatementLine, firstStatementLine, scriptContext);
- JsrtDebugUtils::AddPropertyToObject(funcInfoObject, JsrtDebugPropertyId::firstStatementColumn, firstStatementColumn, scriptContext);
+ JsrtDebugUtils::AddScriptIdToObject(funcPositionObject, utf8SourceInfo);
+ JsrtDebugUtils::AddFileNameOrScriptTypeToObject(funcPositionObject, utf8SourceInfo);
+ JsrtDebugUtils::AddPropertyToObject(funcPositionObject, JsrtDebugPropertyId::line, lineNumber, scriptContext);
+ JsrtDebugUtils::AddPropertyToObject(funcPositionObject, JsrtDebugPropertyId::column, columnNumber, scriptContext);
+ JsrtDebugUtils::AddPropertyToObject(funcPositionObject, JsrtDebugPropertyId::firstStatementLine, firstStatementLine, scriptContext);
+ JsrtDebugUtils::AddPropertyToObject(funcPositionObject, JsrtDebugPropertyId::firstStatementColumn, firstStatementColumn, scriptContext);
- *functionInfo = funcInfoObject;
+ *functionPosition = funcPositionObject;
return JsNoError;
}
@@ -593,7 +576,7 @@ CHAKRA_API JsDiagGetProperties(
return JsErrorDiagInvalidHandle;
}
- Js::DynamicObject* properties = debuggerObject->GetChildrens(scriptContext, fromCount, totalCount);
+ Js::DynamicObject* properties = debuggerObject->GetChildren(scriptContext, fromCount, totalCount);
if (properties != nullptr)
{
diff --git a/lib/Runtime/Debug/BreakpointProbe.cpp b/lib/Runtime/Debug/BreakpointProbe.cpp
index ac1998a5454..0d654ab5d40 100644
--- a/lib/Runtime/Debug/BreakpointProbe.cpp
+++ b/lib/Runtime/Debug/BreakpointProbe.cpp
@@ -6,13 +6,13 @@
namespace Js
{
- BreakpointProbe::BreakpointProbe(DebugDocument* debugDocument, StatementLocation& statement) :
+ BreakpointProbe::BreakpointProbe(DebugDocument* debugDocument, StatementLocation& statement, int breakpointId) :
debugDocument(debugDocument),
functionBody(statement.function),
characterOffset(statement.statement.begin),
- byteOffset(statement.bytecodeSpan.begin)
+ byteOffset(statement.bytecodeSpan.begin),
+ breakpointId(breakpointId)
{
- this->breakPointId = functionBody->GetScriptContext()->GetThreadContext()->GetDebugManager()->GetNextBreakpointId();
}
bool BreakpointProbe::Install(ScriptContext* pScriptContext)
diff --git a/lib/Runtime/Debug/BreakpointProbe.h b/lib/Runtime/Debug/BreakpointProbe.h
index ad8de26497c..937091f6a4a 100644
--- a/lib/Runtime/Debug/BreakpointProbe.h
+++ b/lib/Runtime/Debug/BreakpointProbe.h
@@ -12,10 +12,10 @@ namespace Js
int byteOffset;
DebugDocument* debugDocument;
FunctionBody* functionBody;
- UINT breakPointId;
+ UINT breakpointId;
public:
- BreakpointProbe(DebugDocument* debugDocument, StatementLocation& statement);
+ BreakpointProbe(DebugDocument* debugDocument, StatementLocation& statement, int breakpointId);
virtual bool Install(ScriptContext* pScriptContext);
virtual bool Uninstall(ScriptContext* pScriptContext);
@@ -27,7 +27,7 @@ namespace Js
bool Matches(StatementLocation statement);
bool Matches(FunctionBody* _pBody, DebugDocument* debugDocument, int byteOffset);
- UINT GetId() const { return this->breakPointId; }
+ UINT GetId() const { return this->breakpointId; }
void GetStatementLocation(StatementLocation * statement);
FunctionBody* GetFunctionBody() const { return this->functionBody; }
int GetBytecodeOffset() const { return this->byteOffset; }
diff --git a/lib/Runtime/Debug/DebugContext.cpp b/lib/Runtime/Debug/DebugContext.cpp
index 5ae4b6d1ff0..e80e21f8317 100644
--- a/lib/Runtime/Debug/DebugContext.cpp
+++ b/lib/Runtime/Debug/DebugContext.cpp
@@ -398,13 +398,8 @@ namespace Js
template
void DebugContext::MapUTF8SourceInfoUntil(TMapFunction map)
{
- this->scriptContext->GetSourceList()->MapUntil([=](int i, RecyclerWeakReference* sourceInfoWeakRef) -> bool {
- Js::Utf8SourceInfo* sourceInfo = sourceInfoWeakRef->Get();
- if (sourceInfo)
- {
- return map(sourceInfo);
- }
- return false;
+ this->scriptContext->MapScript([=](Js::Utf8SourceInfo* sourceInfo) -> bool {
+ return map(sourceInfo);
});
}
}
diff --git a/lib/Runtime/Debug/DebugDocument.cpp b/lib/Runtime/Debug/DebugDocument.cpp
index 13e6a2b626d..a15d9a3f2c5 100644
--- a/lib/Runtime/Debug/DebugDocument.cpp
+++ b/lib/Runtime/Debug/DebugDocument.cpp
@@ -128,7 +128,9 @@ namespace Js
}
case BREAKPOINT_ENABLED:
{
- BreakpointProbe* pProbe = Anew(scriptContext->AllocatorForDiagnostics(), BreakpointProbe, this, statement);
+ BreakpointProbe* pProbe = Anew(scriptContext->AllocatorForDiagnostics(), BreakpointProbe, this, statement,
+ scriptContext->GetThreadContext()->GetDebugManager()->GetNextBreakpointId());
+
scriptContext->GetDebugContext()->GetProbeContainer()->AddProbe(pProbe);
BreakpointProbeList* pBreakpointList = this->GetBreakpointList();
pBreakpointList->Add(pProbe);
@@ -157,7 +159,7 @@ namespace Js
}
}
- Js::BreakpointProbe* DebugDocument::FindBreakpointId(StatementLocation statement)
+ Js::BreakpointProbe* DebugDocument::FindBreakpoint(StatementLocation statement)
{
Js::BreakpointProbe* probe = nullptr;
if (m_breakpointList != nullptr)
diff --git a/lib/Runtime/Debug/DebugDocument.h b/lib/Runtime/Debug/DebugDocument.h
index f677a9db35d..8f42d6d387a 100644
--- a/lib/Runtime/Debug/DebugDocument.h
+++ b/lib/Runtime/Debug/DebugDocument.h
@@ -27,7 +27,7 @@ namespace Js
void RemoveBreakpointProbe(BreakpointProbe *probe);
void ClearAllBreakPoints(void);
- BreakpointProbe* FindBreakpointId(StatementLocation statement);
+ BreakpointProbe* FindBreakpoint(StatementLocation statement);
bool FindBPStatementLocation(UINT bpId, StatementLocation * statement);
BOOL GetStatementSpan(long ibos, StatementSpan* pBos);
diff --git a/test/Debugger/JsDiagGetFunctionPosition.js b/test/Debugger/JsDiagGetFunctionPosition.js
index b103d940df5..8a03c27c203 100644
--- a/test/Debugger/JsDiagGetFunctionPosition.js
+++ b/test/Debugger/JsDiagGetFunctionPosition.js
@@ -8,7 +8,7 @@ var x = 1;
function foo() {
x = 2;
}
-WScript.DumpFunctionInfo(foo);
+WScript.DumpFunctionPosition(foo);
// Function property
var obj = {
@@ -16,24 +16,24 @@ var obj = {
WScript.Echo('');
}
};
-WScript.DumpFunctionInfo(obj.func);
+WScript.DumpFunctionPosition(obj.func);
var global = WScript.LoadScript("function foo(){}", "samethread", "dummyFileName.js");
-WScript.DumpFunctionInfo(global.foo);
+WScript.DumpFunctionPosition(global.foo);
var evalFunc = eval('new Function("a", "b", "/*some comments\\r\\n*/ return a + b;")');
-WScript.DumpFunctionInfo(evalFunc);
+WScript.DumpFunctionPosition(evalFunc);
/*some function not at 0 column*/function blah() {
/* First statement not at 0 */
var xyz = 1;
}
-WScript.DumpFunctionInfo(blah);
+WScript.DumpFunctionPosition(blah);
-// Shouldn't get functionInfo of built-ins
-WScript.DumpFunctionInfo(JSON.stringify);
-WScript.DumpFunctionInfo(eval);
+// Shouldn't get functionPosition of built-ins
+WScript.DumpFunctionPosition(JSON.stringify);
+WScript.DumpFunctionPosition(eval);
-// Shouldn't get functionInfo of library code
-WScript.DumpFunctionInfo(Intl.DateTimeFormat);
+// Shouldn't get functionPosition of library code
+WScript.DumpFunctionPosition(Intl.DateTimeFormat);
WScript.Echo("pass");
diff --git a/test/Debugger/JsDiagGetFunctionPosition.js.dbg.baseline b/test/Debugger/JsDiagGetFunctionPosition.js.dbg.baseline
index 01d779d1f25..0fc5e173888 100644
--- a/test/Debugger/JsDiagGetFunctionPosition.js.dbg.baseline
+++ b/test/Debugger/JsDiagGetFunctionPosition.js.dbg.baseline
@@ -1,6 +1,6 @@
[
{
- "functionInfo": {
+ "functionPosition": {
"scriptId": 2,
"fileName": "jsdiaggetfunctionposition.js",
"line": 8,
@@ -10,7 +10,7 @@
}
},
{
- "functionInfo": {
+ "functionPosition": {
"scriptId": 2,
"fileName": "jsdiaggetfunctionposition.js",
"line": 15,
@@ -20,7 +20,7 @@
}
},
{
- "functionInfo": {
+ "functionPosition": {
"scriptId": 3,
"fileName": "dummyfilename.js",
"line": 1,
@@ -30,7 +30,7 @@
}
},
{
- "functionInfo": {
+ "functionPosition": {
"scriptId": 5,
"parentScriptId": 4,
"scriptType": "Function code",
@@ -42,7 +42,7 @@
}
},
{
- "functionInfo": {
+ "functionPosition": {
"scriptId": 2,
"fileName": "jsdiaggetfunctionposition.js",
"line": 27,
@@ -52,12 +52,12 @@
}
},
{
- "functionInfo": {}
+ "functionPosition": {}
},
{
- "functionInfo": {}
+ "functionPosition": {}
},
{
- "functionInfo": {}
+ "functionPosition": {}
}
]
\ No newline at end of file
diff --git a/test/Debugger/JsrtDebugUtilsAddPropertyType.js b/test/Debugger/JsrtDebugUtilsAddPropertyType.js
index ce919cac617..342878d3591 100644
--- a/test/Debugger/JsrtDebugUtilsAddPropertyType.js
+++ b/test/Debugger/JsrtDebugUtilsAddPropertyType.js
@@ -54,4 +54,5 @@ var obj2 = {
};
obj2; /**bp:evaluate('obj2.a1', 2);**/
+obj2; /**bp:evaluate('obj2.a2 = 1');**/
WScript.Echo("pass");
diff --git a/test/Debugger/JsrtDebugUtilsAddPropertyType.js.dbg.baseline b/test/Debugger/JsrtDebugUtilsAddPropertyType.js.dbg.baseline
index d5b36e51547..c5761a0808c 100644
--- a/test/Debugger/JsrtDebugUtilsAddPropertyType.js.dbg.baseline
+++ b/test/Debugger/JsrtDebugUtilsAddPropertyType.js.dbg.baseline
@@ -176,5 +176,10 @@
}
}
}
+ },
+ {
+ "evaluate": {
+ "obj2.a2 = 1": "number 1"
+ }
}
]
\ No newline at end of file
diff --git a/test/rlexedirs.xml b/test/rlexedirs.xml
index 83a6512c3bc..6df0f2e54a5 100644
--- a/test/rlexedirs.xml
+++ b/test/rlexedirs.xml
@@ -374,7 +374,7 @@
Debugger
- exclude_serialized,exclude_jshost
+ exclude_serialized,exclude_jshost,exclude_snap