зеркало из https://github.com/mozilla/pjs.git
Bug 692722 - implement xpcshell -d for running in debug mode (r=mrbkap)
--HG-- extra : rebase_source : e54e3ccd8dc9da4e75629963f6702b4d3e7a95b2
This commit is contained in:
Родитель
c0eb2d7162
Коммит
e58689eb87
|
@ -1233,6 +1233,9 @@ ProcessArgs(JSContext *cx, JSObject *obj, char **argv, int argc)
|
||||||
case 'x':
|
case 'x':
|
||||||
JS_ToggleOptions(cx, JSOPTION_XML);
|
JS_ToggleOptions(cx, JSOPTION_XML);
|
||||||
break;
|
break;
|
||||||
|
case 'd':
|
||||||
|
xpc_ActivateDebugMode();
|
||||||
|
break;
|
||||||
case 'P':
|
case 'P':
|
||||||
if (JS_GET_CLASS(cx, JS_GetPrototype(cx, obj)) != &global_class) {
|
if (JS_GET_CLASS(cx, JS_GetPrototype(cx, obj)) != &global_class) {
|
||||||
JSObject *gobj;
|
JSObject *gobj;
|
||||||
|
|
|
@ -2578,6 +2578,14 @@ fail:
|
||||||
gDesiredDebugMode = gDebugMode = JS_FALSE;
|
gDesiredDebugMode = gDebugMode = JS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_EXPORT_(void)
|
||||||
|
xpc_ActivateDebugMode()
|
||||||
|
{
|
||||||
|
XPCJSRuntime* rt = nsXPConnect::GetRuntimeInstance();
|
||||||
|
nsXPConnect::GetXPConnect()->SetDebugModeWhenPossible(true, true);
|
||||||
|
nsXPConnect::CheckForDebugMode(rt->GetJSRuntime());
|
||||||
|
}
|
||||||
|
|
||||||
/* JSContext Pop (); */
|
/* JSContext Pop (); */
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsXPConnect::Pop(JSContext * *_retval)
|
nsXPConnect::Pop(JSContext * *_retval)
|
||||||
|
|
|
@ -595,6 +595,8 @@ public:
|
||||||
return gReportAllJSExceptions > 0;
|
return gReportAllJSExceptions > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void CheckForDebugMode(JSRuntime *rt);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
nsXPConnect();
|
nsXPConnect();
|
||||||
|
|
||||||
|
@ -624,7 +626,6 @@ private:
|
||||||
static PRUint32 gReportAllJSExceptions;
|
static PRUint32 gReportAllJSExceptions;
|
||||||
static JSBool gDebugMode;
|
static JSBool gDebugMode;
|
||||||
static JSBool gDesiredDebugMode;
|
static JSBool gDesiredDebugMode;
|
||||||
static inline void CheckForDebugMode(JSRuntime *rt);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static nsIScriptSecurityManager *gScriptSecurityManager;
|
static nsIScriptSecurityManager *gScriptSecurityManager;
|
||||||
|
|
|
@ -182,6 +182,11 @@ xpc_UnmarkGrayObject(JSObject *obj)
|
||||||
xpc_UnmarkGrayObjectRecursive(obj);
|
xpc_UnmarkGrayObjectRecursive(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// No JS can be on the stack when this is called. Probably only useful from
|
||||||
|
// xpcshell.
|
||||||
|
NS_EXPORT_(void)
|
||||||
|
xpc_ActivateDebugMode();
|
||||||
|
|
||||||
class nsIMemoryMultiReporterCallback;
|
class nsIMemoryMultiReporterCallback;
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче